mikf / gallery-dl

Command-line program to download image galleries and collections from several image hosting sites
GNU General Public License v2.0
11.4k stars 931 forks source link

[Redgifs] Some redgifs v3 links not working #5898

Closed reasonabledoubt closed 1 month ago

reasonabledoubt commented 1 month ago

(label nsfw)

Attempting to extract a v3-watch-type redgifs URL via reddit isn't working for me currently:

./gallery-dl-1.27.1.bin --verbose https://www.reddit.com/r/adorableporn/comments/1edg5t8/a_simple_nude_post_today/

[gallery-dl][debug] Version 1.27.1 - Executable (stable/linux)
[gallery-dl][debug] Python 3.10.12 - Linux-5.19.0-38-generic-x86_64-with-glibc2.35
[gallery-dl][debug] requests 2.31.0 - urllib3 2.2.2
[gallery-dl][debug] Configuration Files ['gallery-dl.conf']
[gallery-dl][debug] Starting DownloadJob for 'https://www.reddit.com/r/adorableporn/comments/1edg5t8/a_simple_nude_post_today/'
[reddit][debug] Using RedditSubmissionExtractor for 'https://www.reddit.com/r/adorableporn/comments/1edg5t8/a_simple_nude_post_today/'
[reddit][debug] Using custom API credentials (client-id *****************)
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): oauth.reddit.com:443
[urllib3.connectionpool][debug] https://oauth.reddit.com:443 "GET /comments/1edg5t8/.json?limit=0&raw_json=1 HTTP/11" 200 3795
[reddit][debug] Using download archive './gallery-dl-archive-file.sqlite3'

Trying the redgifs URL directly:

./gallery-dl-1.27.1.bin --verbose https://v3.redgifs.com/watch/605025947780972895

[gallery-dl][debug] Version 1.27.1 - Executable (stable/linux)
[gallery-dl][debug] Python 3.10.12 - Linux-5.19.0-38-generic-x86_64-with-glibc2.35
[gallery-dl][debug] requests 2.31.0 - urllib3 2.2.2
[gallery-dl][debug] Configuration Files ['gallery-dl.conf']
[gallery-dl][debug] Starting DownloadJob for 'https://v3.redgifs.com/watch/605025947780972895'
[gallery-dl][error] Unsupported URL 'https://v3.redgifs.com/watch/605025947780972895'

From what I can tell from https://github.com/mikf/gallery-dl/pull/3589 and looking at the extractor directly at https://github.com/mikf/gallery-dl/blob/0fcd60349855c01ab38c113f946b7c954dfbb3d3/gallery_dl/extractor/redgifs.py#L186-L197 the regex thinks it's not supported because it was shared with a URL containing only numbers as an ID and not its [A-Za-z] ID (humblegrippingmole) (which is what's shown in the "share" button on the actual page).

I believe this is a simple fix and have a pull request forthcoming.

Hrxn commented 1 month ago

That's weird, why is it not returning the actual URL (https://www.redgifs.com/watch/humblegrippingmole?from=embed)? Is it just this one reddit post, or is it some recent site change?

reasonabledoubt commented 1 month ago

The v3 605025947780972895 URL was posted to reddit by the OP of that post, I imagine the URL had to have been given to them by the redgifs interface at some point. I just tried uploading a test video but I just got a normal [A-Za-Z] URL and couldn't find any option for an alternative numbers-only URL.

It might be some setting the user has? Most of their posts going back about 6 weeks are of the v3 [0-9] variety (and prior to that they're the [A-Za-z] variety).

Though looking through all v3 posts to reddit via (nsfw) https://www.reddit.com/domain/v3.redgifs.com/new/ I can see others posting with [0-9] URLs, but there's still plenty of [A-Za-z].

The api documentation still doesn't have anything about v3 https://api.redgifs.com/docs/index.html (same situation as back in February 2023 as noted in https://github.com/mikf/gallery-dl/issues/3588#issuecomment-1411662118)