[piczel] fix extraction for single images
This commit is contained in:
@@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
from .common import Extractor, Message
|
from .common import Extractor, Message
|
||||||
from .. import text
|
from .. import text
|
||||||
import json
|
|
||||||
|
|
||||||
|
|
||||||
class PiczelExtractor(Extractor):
|
class PiczelExtractor(Extractor):
|
||||||
@@ -137,8 +136,5 @@ class PiczelImageExtractor(PiczelExtractor):
|
|||||||
self.image_id = match.group(1)
|
self.image_id = match.group(1)
|
||||||
|
|
||||||
def posts(self):
|
def posts(self):
|
||||||
url = "{}/gallery/image/{}".format(self.root, self.image_id)
|
url = "{}/api/gallery/{}".format(self.root, self.image_id)
|
||||||
page = self.request(url).text
|
return (self.request(url).json(),)
|
||||||
data = json.loads(text.extract(
|
|
||||||
page, 'window.__PRELOADED_STATE__ =', '</script>')[0])
|
|
||||||
return (data["gallery"]["images"]["byId"][self.image_id],)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user