Closed slowthgt closed 2 years ago
It's just RedGifs changing their api again.
The following works for me:
--- a/gallery_dl/extractor/redgifs.py
+++ b/gallery_dl/extractor/redgifs.py
@@ -174,12 +174,7 @@ class RedgifsAPI():
def _fetch_bearer_token(self, extr):
extr.log.debug("Retrieving Bearer token")
- page = extr.request(extr.root + "/").text
- index = text.extract(page, "/assets/js/index", ".js")[0]
-
- url = extr.root + "/assets/js/index" + index + ".js"
- page = extr.request(url, encoding="utf-8").text
- token = "ey" + text.extract(page, '="ey', '"')[0]
+ token = extr.request(self.API_ROOT + '/v2/auth/temporary').json()['token']
extr.log.debug("Token: '%s'", token)
return token
A follow-up from https://github.com/mikf/gallery-dl/issues/3037
Tested with current release and latest CI.
Could be that the text.extract is not functioning properly?