summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/gfycat.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2021-10-05 23:30:05 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2021-10-05 23:30:05 -0400
commit34ba2951b8c523713425c98addb9256ea05c946f (patch)
tree6ec7e96d0c6e6f6e94b6b97ecd8c0a414ceef93d /gallery_dl/extractor/gfycat.py
parent3f5483df9075ae526f4c54f4cbe80edeabf6d4cc (diff)
New upstream version 1.19.0.upstream/1.19.0
Diffstat (limited to 'gallery_dl/extractor/gfycat.py')
-rw-r--r--gallery_dl/extractor/gfycat.py17
1 files changed, 0 insertions, 17 deletions
diff --git a/gallery_dl/extractor/gfycat.py b/gallery_dl/extractor/gfycat.py
index 6d31f7d..2757852 100644
--- a/gallery_dl/extractor/gfycat.py
+++ b/gallery_dl/extractor/gfycat.py
@@ -10,7 +10,6 @@
from .common import Extractor, Message
from .. import text, exception
-from ..cache import cache
class GfycatExtractor(Extractor):
@@ -155,7 +154,6 @@ class GfycatImageExtractor(GfycatExtractor):
class GfycatAPI():
API_ROOT = "https://api.gfycat.com"
- ACCESS_KEY = "Anr96uuqt9EdamSCwK4txKPjMsf2M95Rfa5FLLhPFucu8H5HTzeutyAa"
def __init__(self, extractor):
self.extractor = extractor
@@ -175,23 +173,8 @@ class GfycatAPI():
params = {"search_text": query, "count": 150}
return self._pagination(endpoint, params)
- @cache(keyarg=1, maxage=3600)
- def _authenticate_impl(self, category):
- if category == "redgifs":
- url = "https://api.redgifs.com/v1/oauth/webtoken"
- else:
- url = "https://weblogin." + category + ".com/oauth/webtoken"
- data = {"access_key": self.ACCESS_KEY}
- headers = {"Referer": self.extractor.root + "/",
- "Origin" : self.extractor.root}
- response = self.extractor.request(
- url, method="POST", headers=headers, json=data)
- return "Bearer " + response.json()["access_token"]
-
def _call(self, endpoint, params=None):
url = self.API_ROOT + endpoint
- self.headers["Authorization"] = self._authenticate_impl(
- self.extractor.category)
return self.extractor.request(
url, params=params, headers=self.headers).json()