Closed jsimons256 closed 2 years ago
Thanks for opening a bug report.
Yep, this is RedGIFs making breaking changes to their API. Looks like all endpoints now require an API key which you have 0.1% of getting it (see this to know what I'm talking about).
I'm a bit busy right now IRL so I'll see what I can do about this later.
Just as a general information for others seeing this: The current version of the library (v1.3.1) is completely broken. No API methods work properly and it returns 401 error.
I need to implement an authentication system in the library so that it works again normally.
I've fixed this issue on 1.4.0 (08e42b638bc79ad46b2ef9108fbed003c3ca6a45) with a temporary login method. You can check the example in the README or in the examples folder on how to use it.
Summary
A couple days ago, the redgifs API started giving a 401 exception when calling api functions.
Reproduction Steps
Expected Result
Code executes and video is downloaded.
Actual Result
Traceback (most recent call last): File "/path/to/file.py", line 26, in
result = api.get_gif(sub.url.split('/')[-1])
File "/path/to/site-packages/redgifs/api.py", line 92, in get_gif
json: Dict[str, Any] = self.http.get_gif(id)['gif']
File "/path/to/site-packages/redgifs/http.py", line 123, in get_gif
return self.request(r, **params)
File "/path/to/site-packages/redgifs/http.py", line 111, in request
raise HTTPException(r, js)
redgifs.errors.HTTPException: 401 (Error: {'code': 'MissingAuthorizationHeader', 'description': 'authorization required to access this service', 'docs': 'https://github.com/Redgifs/api/wiki/API-access'})
System Information
Checklist
Additional Information
The code used to work a couple days ago, but suddenly stopped working.