Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(question) How to download a disabled blog from tumblr? #137

Closed
KaMyKaSii opened this issue Dec 11, 2018 · 18 comments
Closed

(question) How to download a disabled blog from tumblr? #137

KaMyKaSii opened this issue Dec 11, 2018 · 18 comments

Comments

@KaMyKaSii
Copy link

KaMyKaSii commented Dec 11, 2018

There is a disabled blog and I know a blog who has reblogged the content of this disabled blog in question. How can I download this content specifically?
The disabled blog was "kawaxxi-neko" but from what I saw Tumblr uses the name "kawaxxi-neko-deactivated2017112" now. I tried the command 'gallery-dl -o reblogs=true --filter "reblogged_root_name == kawaxxi-neko-deactivated2017112" number13-mw.tumblr.com' and the error "NameError: name 'kawaxxi' is not defined" was returned. Would you help me? Thank you!

screenshot_20181210-232632

@Hrxn
Copy link
Contributor

Hrxn commented Dec 11, 2018

Does it work without specifying the --filter option?

@KaMyKaSii
Copy link
Author

@Hrxn in case just the command 'gallery-dl -o reblogs=true number13-mw.tumblr.com'? Yes, it works!

@mikf
Copy link
Owner

mikf commented Dec 11, 2018

You need to put kawaxxi-neko-deactivated2017112 in quotation marks:
--filter "reblogged_root_name == 'kawaxxi-neko-deactivated2017112'"

Conceptually you want to compare a variable (reblogged_root_name) with a string literal (kawaxxi-neko-deactivated2017112), so you have to explicitly mark the latter as string. Otherwise it looks like another variable name (which isn't defined) to the Python interpreter.

@KaMyKaSii
Copy link
Author

@mikf Thank you very much, it worked! But what if I want to filter by any reblogged_root_name that contains kawaxxi? I tried '*kawaxxi*' but it did not work

@Hrxn
Copy link
Contributor

Hrxn commented Dec 11, 2018

Not sure what you are trying to do here..

It's kind of a habit that some blogs on Tumblr suddenly disappear, nothing new. So other blogs reblog them specifically, as a backup strategy..
And now you're downloading that backup blog, good for you that this opportunity still exists.
Otherwise it would be lost forever.

@mikf
Copy link
Owner

mikf commented Dec 11, 2018

'kawaxxi' in reblogged_root_name

or you could even use regular expressions:
re.search(r'\bkawaxxi\b', reblogged_root_name)

@KaMyKaSii
Copy link
Author

@mikf The first option worked perfectly, thank you! But anyway, I have some other problems and I hope it's not wrong to post here.

The gallery-dl downloads reblogged content from some blogs even when the "reblogs=false" parameter is used. Below an example blog, could you take a look?
https://finger-wings.tumblr.com

And gallery-dl is not downloading the attached image in the post below even with "posts=all" and "inline=true". Am I doing something wrong?
https://muyanna.tumblr.com/post/180692431632/could-you-please-post-your-armpit-for-us

And a request: could you consider including the profile pic and cover when downloading an entire tumblr blog? Thank you one more time!

@mikf
Copy link
Owner

mikf commented Dec 11, 2018

The gallery-dl downloads reblogged content from some blogs even when the "reblogs=false" parameter is used. Below an example blog, could you take a look?

I did and I couldn't find anything wrong. i ran

$ gallery-dl -o posts=all -o inline=true -o reblogs=false --filter "reblogged" https://finger-wings.tumblr.com/

and it didn't download anything, as it should. Could you point me to a specific post where this is supposed to happen?

And gallery-dl is not downloading the attached image in the post below even with "posts=all" and "inline=true". Am I doing something wrong?

Fixed with b7a9f6c

And a request: could you consider including the profile pic and cover when downloading an entire tumblr blog? Thank you one more time!

The profile picture or "avatar" is possible, but I don't know where to get the cover from when only using API calls. That's the background image in the header of a blog, right?

@KaMyKaSii
Copy link
Author

KaMyKaSii commented Dec 11, 2018

@mikf "and it didn't download anything, as it should. Could you point me to a specific post where this is supposed to happen?"
https://finger-wings.tumblr.com/post/143262946005
The "gallery-dl -o reblogs=false https://finger-wings.tumblr.com/post/143262946005" command downloads this content, which should not happen

"Fixed with b7a9f6c"
Thanks!

"The profile picture or "avatar" is possible, but I don't know where to get the cover from when only using API calls. That's the background image in the header of a blog, right?"
Exactly. From what I saw after making the posts request you just need to use the header_image or header_image_focused value. The problem is that the filename is static so you would have to do your magic to find out if the cover changed to download the new one

And now I'm trying to download another deleted blog from another blog that has reblogged its content but apparently has some error in processing. Could you take another look?
Here is one of the posts with the content I want, proving that it exists:
https://giornogiov.tumblr.com/post/178961932805

$ gallery-dl -v -d /sdcard/gallery-dl/tumblrs_deletados/pastinha-de-nudes -o reblogs=true --filter "'pastinha-de-nudes' in reblogged_root_name" https://giornogiov.tumblr.com
[gallery-dl][debug] Version 1.6.2-dev
[gallery-dl][debug] Python 3.7.1 - Linux-3.18.19-aarch64-with-libc
[gallery-dl][debug] requests 2.20.1 - urllib3 1.24.1
[gallery-dl][debug] Starting DownloadJob for 'https://giornogiov.tumblr.com'
[tumblr][debug] Using OAuth1.0 authentication
[tumblr][debug] Using TumblrUserExtractor for 'https://giornogiov.tumblr.com'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): api.tumblr.com:443
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/giornogiov.tumblr.com/posts?offset=0&limit=50&reblog_info=true HTTP/1.1" 200 None
[tumblr][error] Evaluating filter expression failed: NameError: name 'reblogged_root_name' is not defined
$

@mikf
Copy link
Owner

mikf commented Dec 11, 2018

reblogged_root_name is not available if it isn't a reblogged post.
Use --filter "reblogged and 'pastinha-de-nudes' in reblogged_root_name" to test if it is actually a reblog before accessing reblog-only values.

@KaMyKaSii
Copy link
Author

KaMyKaSii commented Dec 12, 2018

@mikf I tried this command but got no results. Are you sure that is not a post reblogged? It seems to me. But anyway, could you inform me a command to filter by the author name of the post regardless if it is a post reblogged or not?
And about my problem with gallery-dl downloading rebbloged content when it should not have been, could you replicate using that specific post that I sent the link to?

@mikf
Copy link
Owner

mikf commented Dec 13, 2018

I tried this command but got no results. Are you sure that is not a post reblogged? It seems to me. But anyway, could you inform me a command to filter by the author name of the post regardless if it is a post reblogged or not?

You should enable all post types, otherwise gallery-dl will only look at all photo posts of a blog:

gallery-dl -d /sdcard/gallery-dl/tumblrs_deletados/pastinha-de-nudes -o posts=all -o reblogs=true --filter "reblogged and 'pastinha-de-nudes' in reblogged_root_name" https://giornogiov.tumblr.com

The "gallery-dl -o reblogs=false https://finger-wings.tumblr.com/post/143262946005" command downloads this content, which should not happen
...
And about my problem with gallery-dl downloading rebbloged content when it should not have been, could you replicate using that specific post that I sent the link to?

If you use a URL pointing to a specific post, it will always download from it regardless of your settings for posts and reblogs. These "filters" only work for general blog URLs like https://finger-wings.tumblr.com. If you definitely and in any case don't want to download from reblogged posts, use --filter "not reblogged" (and extend it as needed).

@KaMyKaSii
Copy link
Author

@mikf Okay, there was a big misunderstanding here. I already have "posts=all" and "reblogs=false" in my configuration file, so I only explicitly "reblogs=true" in the command in the times I really needed it (download content from deleted blogs that were found in other blogs). But with this blog "pastinha-de-nudes" I'm not getting success, so I sent the link proving that this content exists in another blog and still the gallery-dl does not download anything.
And about the reblogged content that is still downloaded, I just sent the link from that post as an example of one of the posts that are downloaded even when explicitly stated that should not download reblogged content. I tested these three commands with the general URL and all returned reblogged content:
gallery-dl -o reblogs=false finger-wings.tumblr.com
gallery-dl --filter "not reblogged" finger-wings.tumblr.com
gallery-dl -o reblogs=false --filter "not reblogged" finger-wings.tumblr.com

I hope I have been able to clarify everything

@mikf
Copy link
Owner

mikf commented Dec 14, 2018

I'm not getting success, so I sent the link proving that this content exists in another blog and still the gallery-dl does not download anything.

Well, it is downloading 3 files for me, including the ones from the link you posted:

$ gallery-dl -o posts=all -o inline=true -o reblogs=true --filter "reblogged and 'pastinha-de-nudes' in reblogged_root_name" https://giornogiov.tumblr.com
/tmp/tumblr/giornogiov/tumblr_giornogiov_179059856380_01.jpg
/tmp/tumblr/giornogiov/tumblr_giornogiov_178961932805_01.jpg
/tmp/tumblr/giornogiov/tumblr_giornogiov_178961932805_02.jpg

And about the reblogged content that is still downloaded, I just sent the link from that post as an example of one of the posts that are downloaded even when explicitly stated that should not download reblogged content

The link you posted here (https://finger-wings.tumblr.com/post/143262946005) is technically not a reblogged post. It is a copy of another post from another blog, sure, but it doesn't count as a reblog from Tumblr's point of view.

@mikf
Copy link
Owner

mikf commented Dec 28, 2018

Downloading avatars / profile pictures should work now, but I'm still unsure about the header / cover images.

First of all the header_image and header_image_focused fields are only sometimes available.
Some posts don't have a trail field, which would contain said fields, or the trail is empty, or its theme is empty like in https://giornogiov.tumblr.com/post/178961932805:

   "trail": [
        {
          "blog": {
            "active": false,
            "can_be_followed": false,
            "name": "pastinha-de-nudes",
            "share_following": false,
            "share_likes": false,
            "theme": []  # <-- 
          },

That's not necessarily a problem, but there could be a blog out there were it's impossible to get the header image because its URL is never made available.

The more important issue is that the header image more often than not just doesn't match or is not what one would expect. The headers for "simple" blogs without custom theme work fine, but for blogs with a more interesting theme they are usually pretty useless.

The header for https://americasgreatoutdoors.tumblr.com/ for example would be this beautiful gray pattern: https://assets.tumblr.com/images/default_header/optica_pattern_03.png?_v=a0f20b51ed40eb5a930ab86effe42a40

For http://indolentjellyfish.tumblr.com you get a penguin which is nowhere to be found on the blog itself: https://static.tumblr.com/fa938f7ac8a9165214bed5e224f9f6d9/egrdxy9/mjtn56kzy/tumblr_static_2s1nrjtvlkowkc0k4c8skk48o.jpg

From what I can see, those header images are pretty useless, but if you want to download them regardless, let me know.

@KaMyKaSii
Copy link
Author

KaMyKaSii commented Dec 7, 2019

@mikf still in the saga of downloading content from deleted blogs through other blogs that reblogged it. The seemingly best possible variable to use in the gallery-dl command is "reblogged_root_name", which is present in all reblogged posts. The problem is that gallery-dl terminates before checking to the oldest blog post, saying the variable has not been defined, I believe it aborts when a single post does not have the "reblogged_root_name" variable. The "slug" variable is present in all posts as far as I could see, so gallery-dl scans through the blog to its oldest post properly. But when the post is a reblog of another reblog of the deleted blog, the slug variable gets no value and so gallery-dl doesn't download the content of that post. Could you tell me how I can download through the reblogged_root_name variable so that gallery-dl does a full blog scan? Thank you!

Below is the output using the two variables:
reblogged_root_name ( --filter "re.search(r'\brat-grrrrl\b', reblogged_root_name)" fails exactly on the same 450 off-set and --filter "'reblogged and 'brat-grrrrl' in reblogged_root_name" downloads content that has no "brat-grrrrl" in any of its variables) :

$ gallery-dl -v -o reblogs=true --filter "'brat-grrrrl' in reblogged_root_name" http://d
ocenic.tumblr.com
[gallery-dl][debug] Version 1.11.2-dev
[gallery-dl][debug] Python 3.8.0 - Linux-4.4.141-perf+-aarch64-with-libc
[gallery-dl][debug] requests 2.22.0 - urllib3 1.25.7
[gallery-dl][debug] Starting DownloadJob for 'http://docenic.tumblr.com'
[gallery-dl][debug] Updating urllib3 ciphers
[tumblr][debug] Using custom OAuth1.0 authentication
[tumblr][debug] Using TumblrUserExtractor for 'http://docenic.tumblr.com'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): api.tumblr.com:443
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=0&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/avatar?size=512 HTTP/1.1" 302 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=50&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=100&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=150&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=200&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=250&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=300&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=350&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=400&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=450&limit=50&reblog_info=true HTTP/1.1" 200 None
[tumblr][error] FilterError: Evaluating filter expression failed (NameError: name 'reblo
gged_root_name' is not defined)
$

Slug:

$ gallery-dl -v -o reblogs=true --filter "'brat-grrrrl' in slug" http://docenic.tumblr.c
om
[gallery-dl][debug] Version 1.11.2-dev
[gallery-dl][debug] Python 3.8.0 - Linux-4.4.141-perf+-aarch64-with-libc
[gallery-dl][debug] requests 2.22.0 - urllib3 1.25.7
[gallery-dl][debug] Starting DownloadJob for 'http://docenic.tumblr.com'
[gallery-dl][debug] Updating urllib3 ciphers
[tumblr][debug] Using custom OAuth1.0 authentication
[tumblr][debug] Using TumblrUserExtractor for 'http://docenic.tumblr.com'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): api.tumblr.com:443
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=0&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/avatar?size=512 HTTP/1.1" 302 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=50&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=100&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=150&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=200&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=250&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=300&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=350&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=400&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=450&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=500&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=550&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=600&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=650&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=700&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=750&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=800&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=850&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=900&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=950&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=1000&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=1050&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=1100&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=1150&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=1200&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=1250&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=1300&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=1350&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=1400&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=1450&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=1500&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=1550&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=1600&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=1650&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=1700&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=1750&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=1800&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=1850&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=1900&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=1950&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=2000&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=2050&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=2100&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=2150&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=2200&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=2250&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=2300&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=2350&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=2400&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=2450&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=2500&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=2550&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=2600&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=2650&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=2700&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=2750&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=2800&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=2850&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=2900&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=2950&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=3000&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=3050&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=3100&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=3150&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=3200&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=3250&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=3300&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=3350&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=3400&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=3450&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=3500&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=3550&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=3600&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=3650&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=3700&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=3750&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=3800&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=3850&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=3900&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=3950&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=4000&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=4050&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=4100&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=4150&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=4200&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=4250&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=4300&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=4350&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=4400&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=4450&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): 66.media.tumblr.com:4
43
[urllib3.connectionpool][debug] https://66.media.tumblr.com:443 "GET /2157fe610487a7606b
112b17b6da1054/tumblr_nypjiyhmlN1tiikqqo1_1280.png HTTP/1.1" 200 1221299
/sdcard/gallery-dl/tumblr/docenic/tumblr_docenic_134428120584_01.png
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=4500&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://66.media.tumblr.com:443 "GET /9849689d6ea94fcc96
fa8d5b27f4ce30/tumblr_nyg6wwROYd1tiikqqo1_1280.jpg HTTP/1.1" 200 135462
/sdcard/gallery-dl/tumblr/docenic/tumblr_docenic_134030594619_01.jpg
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=4550&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=4600&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://66.media.tumblr.com:443 "GET /52bbdd3d0ac707fb2b
524054d009b5cd/tumblr_ny4jgttMwq1tiikqqo1_1280.png HTTP/1.1" 200 1493629
/sdcard/gallery-dl/tumblr/docenic/tumblr_docenic_133624254404_01.png
[urllib3.connectionpool][debug] https://66.media.tumblr.com:443 "GET /c78478ac3bd8ff8b7c
677ce56ddf0886/tumblr_ny4jgttMwq1tiikqqo2_1280.png HTTP/1.1" 200 1499262
/sdcard/gallery-dl/tumblr/docenic/tumblr_docenic_133624254404_02.png
[urllib3.connectionpool][debug] https://66.media.tumblr.com:443 "GET /ceab9456ec7b2c43b2
96597b54713b9a/tumblr_nsme48leP71tiikqqo1_1280.png HTTP/1.1" 200 1073636
/sdcard/gallery-dl/tumblr/docenic/tumblr_docenic_132745992234_01.png
[urllib3.connectionpool][debug] https://66.media.tumblr.com:443 "GET /a223a34d5bf10a0c7a
8ef379c43f68cc/tumblr_nxbie077H51tiikqqo1_1280.png HTTP/1.1" 200 1279559
/sdcard/gallery-dl/tumblr/docenic/tumblr_docenic_132678223234_01.png
[urllib3.connectionpool][debug] https://66.media.tumblr.com:443 "GET /d80ad384980632ac75
df265cab45e300/tumblr_nxbkmvbO1Z1tiikqqo1_1280.png HTTP/1.1" 200 1256224
/sdcard/gallery-dl/tumblr/docenic/tumblr_docenic_132678149539_01.png
[urllib3.connectionpool][debug] https://66.media.tumblr.com:443 "GET /f853fbc4b28cf9b00c
61a195e02ecb00/tumblr_nxbjh95EMQ1tiikqqo1_1280.png HTTP/1.1" 200 1258225
/sdcard/gallery-dl/tumblr/docenic/tumblr_docenic_132677694394_01.png
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=4650&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://66.media.tumblr.com:443 "GET /ff4c5f20624fc222a5
11a641470764f7/tumblr_nx1xyna19Z1tiikqqo1_1280.png HTTP/1.1" 200 488626
/sdcard/gallery-dl/tumblr/docenic/tumblr_docenic_132232036894_01.png
[urllib3.connectionpool][debug] https://66.media.tumblr.com:443 "GET /3d4d315666dbaebbde
768d0b733398b1/tumblr_ntrlfm78Dd1tiikqqo1_r1_1280.png HTTP/1.1" 200 763453
/sdcard/gallery-dl/tumblr/docenic/tumblr_docenic_132231156444_01.png
[urllib3.connectionpool][debug] https://66.media.tumblr.com:443 "GET /7ccb554525e26b6f8b
24b8e7445f607f/tumblr_nx0f7iti1P1tiikqqo1_1280.png HTTP/1.1" 200 951471
/sdcard/gallery-dl/tumblr/docenic/tumblr_docenic_132224859009_01.png
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=4700&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=4750&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://66.media.tumblr.com:443 "GET /ac8e235a3559b380c7
5019cfc965968d/tumblr_nwmx6bfdKN1tiikqqo1_1280.jpg HTTP/1.1" 200 186911
/sdcard/gallery-dl/tumblr/docenic/tumblr_docenic_131980239119_01.jpg
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=4800&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=4850&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=4900&limit=50&reblog_info=true HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://66.media.tumblr.com:443 "GET /7195207f2ef422579e
5bd1329027d132/tumblr_nu0dt8z0R51tiikqqo1_1280.jpg HTTP/1.1" 200 162045
/sdcard/gallery-dl/tumblr/docenic/tumblr_docenic_129773663924_01.jpg
[urllib3.connectionpool][debug] https://66.media.tumblr.com:443 "GET /4356cc8139d8905b71
f80c60891c332b/tumblr_nuokynz2BU1tiikqqo1_640.jpg HTTP/1.1" 200 61114
/sdcard/gallery-dl/tumblr/docenic/tumblr_docenic_129530102409_01.jpg
[urllib3.connectionpool][debug] https://66.media.tumblr.com:443 "GET /0789d928a5fa462ddc
b6a23026bb6d8b/tumblr_nttkjzRHWD1tiikqqo1_1280.png HTTP/1.1" 200 964874
/sdcard/gallery-dl/tumblr/docenic/tumblr_docenic_129445841639_01.png
[urllib3.connectionpool][debug] https://66.media.tumblr.com:443 "GET /6d9ee2f889692edf60
112928c862ee92/tumblr_nttkjzRHWD1tiikqqo2_1280.png HTTP/1.1" 200 1023972
/sdcard/gallery-dl/tumblr/docenic/tumblr_docenic_129445841639_02.png
[urllib3.connectionpool][debug] https://66.media.tumblr.com:443 "GET /d3fd8f884f14e4699c
9c696fda152348/tumblr_nkrkan0VdJ1tiikqqo1_r1_1280.jpg HTTP/1.1" 200 31774
/sdcard/gallery-dl/tumblr/docenic/tumblr_docenic_129386402304_01.jpg
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/docenic.tumblr.
com/posts?offset=4950&limit=50&reblog_info=true HTTP/1.1" 200 None
$

@mikf
Copy link
Owner

mikf commented Dec 7, 2019

Since reblogged_root_name is only defined if it's a reblogged post, so you should check that first before accessing any other variable:
--filter "reblogged and re.search(r'\brat-grrrrl\b', reblogged_root_name)"

Also if you want to search for brat-grrrrl, you should change the regular expression to r'\bbrat-grrrrl\b'. \b checks for word-boundaries, and \brat would only match rat as a "new" word, but not brat.

"'reblogged and 'brat-grrrrl' in reblogged_root_name" downloads content that has no "brat-grrrrl" in any of its variables)

I think the issue here is the single quotation mark at the beginning of the filter expression (2nd character). If true, it would transform the whole expression into a single string, which is always "true". Try "reblogged and 'brat-grrrrl' in reblogged_root_name" without the first ':

$ gallery-dl --filter "reblogged and 'brat-grrrrl' in reblogged_root_name"  docenic.tumblr.com
/tmp/tumblr/docenic/tumblr_docenic_134428120584_01.png
/tmp/tumblr/docenic/tumblr_docenic_134030594619_01.jpg
/tmp/tumblr/docenic/tumblr_docenic_133967660634_01.png
/tmp/tumblr/docenic/tumblr_docenic_133624254404_01.png
/tmp/tumblr/docenic/tumblr_docenic_133624254404_02.png
…

@KaMyKaSii
Copy link
Author

Since reblogged_root_name is only defined if it's a reblogged post, so you should check that first before accessing any other variable:
--filter "reblogged and re.search(r'\brat-grrrrl\b', reblogged_root_name)"

Also if you want to search for brat-grrrrl, you should change the regular expression to r'\bbrat-grrrrl\b'. \b checks for word-boundaries, and \brat would only match rat as a "new" word, but not brat.

"'reblogged and 'brat-grrrrl' in reblogged_root_name" downloads content that has no "brat-grrrrl" in any of its variables)

I think the issue here is the single quotation mark at the beginning of the filter expression (2nd character). If true, it would transform the whole expression into a single string, which is always "true". Try "reblogged and 'brat-grrrrl' in reblogged_root_name" without the first ':

$ gallery-dl --filter "reblogged and 'brat-grrrrl' in reblogged_root_name"  docenic.tumblr.com
/tmp/tumblr/docenic/tumblr_docenic_134428120584_01.png
/tmp/tumblr/docenic/tumblr_docenic_134030594619_01.jpg
/tmp/tumblr/docenic/tumblr_docenic_133967660634_01.png
/tmp/tumblr/docenic/tumblr_docenic_133624254404_01.png
/tmp/tumblr/docenic/tumblr_docenic_133624254404_02.png
…

I can't believe a single quote gave me such a headache 🤦🏽‍♂️
Thanks for pointing me, now it's working perfectly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants