[gfycat] use public API endpoint
This commit is contained in:
parent
b1e22e8354
commit
770200888e
@ -1,5 +1,7 @@
|
||||
# Changelog
|
||||
|
||||
## Unreleased
|
||||
|
||||
## 1.6.1 - 2018-11-28
|
||||
- Added support for:
|
||||
- `joyreactor` - http://joyreactor.cc/ ([#114](https://github.com/mikf/gallery-dl/issues/114))
|
||||
|
@ -9,8 +9,6 @@
|
||||
"""Extract images from https://gfycat.com/"""
|
||||
|
||||
from .common import Extractor, Message
|
||||
from .. import text
|
||||
import json
|
||||
|
||||
|
||||
class GfycatExtractor(Extractor):
|
||||
@ -34,10 +32,8 @@ class GfycatExtractor(Extractor):
|
||||
return ""
|
||||
|
||||
def _get_info(self, gfycat_id):
|
||||
url = "{}/ifr/{}".format(self.root, gfycat_id)
|
||||
page = self.request(url).text
|
||||
data = json.loads(text.extract(page, '___INITIAL_STATE__=', ';')[0])
|
||||
return data["cache"]["gifs"][gfycat_id.lower()]
|
||||
url = "https://api.gfycat.com/v1/gfycats/" + gfycat_id
|
||||
return self.request(url).json()["gfyItem"]
|
||||
|
||||
|
||||
class GfycatImageExtractor(GfycatExtractor):
|
||||
|
@ -6,4 +6,4 @@
|
||||
# it under the terms of the GNU General Public License version 2 as
|
||||
# published by the Free Software Foundation.
|
||||
|
||||
__version__ = "1.6.1"
|
||||
__version__ = "1.6.2-dev"
|
||||
|
Loading…
x
Reference in New Issue
Block a user