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