dbvideostriketeam / wubloader

MIT License
15 stars 8 forks source link

chat_archiver_1 error: imgur api error #475

Closed dcollinsn closed 2 weeks ago

dcollinsn commented 2 weeks ago

On 5019b25, got the following exception from chat_archiver while trying to download an imgur album:

chat_archiver_1 | [2024-11-09 18:53:31,609] WARNING root(main:406): Unable to fetch link https://imgur.com/a/precious-baby-girl-4id4Sap?third_party=1 chat_archiver_1 | Traceback (most recent call last): chat_archiver_1 | File "/usr/lib/python3.9/site-packages/chat_archiver/main.py", line 388, in get_url chat_archiver_1 | download_media(url, media_dir) chat_archiver_1 | File "/usr/lib/python3.9/site-packages/common/stats.py", line 172, in wrapper chat_archiver_1 | raise error from None # re-raise error with original traceback chat_archiver_1 | File "/usr/lib/python3.9/site-packages/common/stats.py", line 135, in wrapper chat_archiver_1 | ret = fn(*args, **kwargs) chat_archiver_1 | File "/usr/lib/python3.9/site-packages/common/media.py", line 128, in download_media chat_archiver_1 | raise Exception(f"All retries failed for url {urls[-1]}: {errors}") chat_archiver_1 | Exception: All retries failed for url https://imgur.com/a/precious-baby-girl-4id4Sap?third_party=1: [HTTPError('400 Client Error: Bad Request for url: https://api.imgur.com/post/v1/albums/precious-baby-girl-4id4Sap?client_id=546c25a59c58ad7&include=media,adconfig,account'), HTTPError('400 Client Error: Bad Request for url: https://api.imgur.com/post/v1/albums/precious-baby-girl-4id4Sap?client_id=546c25a59c58ad7&include=media,adconfig,account'), HTTPError('400 Client Error: Bad Request for url: https://api.imgur.com/post/v1/albums/precious-baby-girl-4id4Sap?client_id=546c25a59c58ad7&include=media,adconfig,account')]

https://github.com/dbvideostriketeam/wubloader/blame/master/common/common/media.py#L360-L367

The error returned by the API is "id contains unsupported length of characters".

dcollinsn commented 2 weeks ago

It looks like only the last part of the url ("4id4Sap") should be passed in, at least, I'm not getting the same API error from https://api.imgur.com/post/v1/albums/4id4Sap?client_id=546c25a59c58ad7&include=media,adconfig,account

HubbeKing commented 2 weeks ago

Should be fixed as of https://github.com/dbvideostriketeam/wubloader/commit/9d45833ed189da9845e87c0a5486ccdfc8c682f6