mikf / gallery-dl

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

[Redgifs] HttpError: '400 Bad Requests' #1907

Closed TheGlassEyedVillian closed 3 years ago

TheGlassEyedVillian commented 3 years ago

Just Recently Redgifs extractor has been giving '400 Bad Requests' error for everything.

➜  gallery-dl -d ./ https://www.redgifs.com/watch/thornyfuzzyindianhare --verbose
[gallery-dl][debug] Version 1.18.4
[gallery-dl][debug] Python 3.9.7 - Linux-5.14.8-arch1-1-x86_64-with-glibc2.33
[gallery-dl][debug] requests 2.26.0 - urllib3 1.26.6
[gallery-dl][debug] Starting DownloadJob for 'https://www.redgifs.com/watch/thornyfuzzyindianhare'
[redgifs][debug] Using RedgifsImageExtractor for 'https://www.redgifs.com/watch/thornyfuzzyindianhare'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): api.redgifs.com:443
[urllib3.connectionpool][debug] https://api.redgifs.com:443 "POST /v1/oauth/webtoken HTTP/1.1" 400 127
[redgifs][error] HttpError: '400 Bad Request' for 'https://api.redgifs.com/v1/oauth/webtoken'
AlttiRi commented 3 years ago

I don't know why gallery-dl uses /v1/oauth/webtoken, but redgifs/gfycat's /v1/gfycats/${id} endpoint works OK (in order to receive the video information).

mikf commented 3 years ago

gallery-dl used to use them because redgifs/gfycat themselves used them on their own websites to get a Bearer token, which then got sent alongside all other API requests. That wasn't and isn't necessary, but I thought it would be better to replicate the website's behavior. Now /v1/oauth/webtoken on redgifs returns a 400 error even in a browser.