From 0afa913de492b56a0f1cbf58ead3518696c7d9e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Wed, 2 Jan 2019 16:04:34 +0100 Subject: [PATCH] [tumblr] add tests for hidden and private blogs (#145) Hidden / dashboard-only blogs are pretty straightforward and "only" require a valid 'access-token' and 'access-token-secret' for the given 'api-key' and 'api-secret', so that signed OAuth1.0 requests are possible. Private / password protected blogs on the other hand are a bit cumbersome. In addition to a valid 'access-token' and 'access-token-secret', they also require the account belonging to those tokens to be a member of the blog itself. Knowing the password and entering it in the website isn't enough to access a blog through the API. Following a private blog is also impossible, so that option can't work either. --- CHANGELOG.md | 2 ++ gallery_dl/extractor/tumblr.py | 12 ++++++++++++ gallery_dl/version.py | 2 +- test/test_results.py | 8 ++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91cffdc0..993a9dba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog +## Unreleased + ## 1.6.2 - 2019-01-01 - Added support for: - `instagram` - https://www.instagram.com ([#134](https://github.com/mikf/gallery-dl/issues/134)) diff --git a/gallery_dl/extractor/tumblr.py b/gallery_dl/extractor/tumblr.py index 31a8254f..80393994 100644 --- a/gallery_dl/extractor/tumblr.py +++ b/gallery_dl/extractor/tumblr.py @@ -206,6 +206,18 @@ class TumblrUserExtractor(TumblrExtractor): "count": 3, "options": (("posts", "all"), ("external", True)) }), + ("https://mikf123-hidden.tumblr.com/", { # dashbord-only + "count": 2, + "keyword": {"tags": ["test", "hidden"]}, + }), + ("https://mikf123-private.tumblr.com/", { # password protected + "count": 2, + "keyword": {"tags": ["test", "private"]}, + }), + ("https://mikf123-private-hidden.tumblr.com/", { # both + "count": 2, + "keyword": {"tags": ["test", "private", "hidden"]}, + }), ("https://demo.tumblr.com/page/2", None), ("https://demo.tumblr.com/archive", None), ("tumblr:http://www.b-authentique.com/", None), diff --git a/gallery_dl/version.py b/gallery_dl/version.py index d1dd0f3c..80e0e0c6 100644 --- a/gallery_dl/version.py +++ b/gallery_dl/version.py @@ -6,4 +6,4 @@ # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. -__version__ = "1.6.2" +__version__ = "1.6.3-dev" diff --git a/test/test_results.py b/test/test_results.py index 66a02c9a..0dccc299 100644 --- a/test/test_results.py +++ b/test/test_results.py @@ -38,11 +38,19 @@ def setup_test_config(): config.set(("extractor", "password"), name) config.set(("extractor", "nijie", "username"), email) config.set(("extractor", "seiga", "username"), email) + config.set(("extractor", "deviantart", "client-id"), "7777") config.set(("extractor", "deviantart", "client-secret"), "ff14994c744d9208e5caeec7aab4a026") + config.set(("extractor", "tumblr", "api-key"), "0cXoHfIqVzMQcc3HESZSNsVlulGxEXGDTTZCDrRrjaa0jmuTc6") + config.set(("extractor", "tumblr", "api-secret"), + "6wxAK2HwrXdedn7VIoZWxGqVhZ8JdYKDLjiQjL46MLqGuEtyVj") + config.set(("extractor", "tumblr", "access-token"), + "N613fPV6tOZQnyn0ERTuoEZn0mEqG8m2K8M3ClSJdEHZJuqFdG") + config.set(("extractor", "tumblr", "access-token-secret"), + "sgOA7ZTT4FBXdOGGVV331sSp0jHYp4yMDRslbhaQf7CaS71i4O") class TestExtractorResults(unittest.TestCase):