Skip to content

Commit

Permalink
[piczel] fix extraction for single images
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Mar 31, 2020
1 parent 699036e commit c034159
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions gallery_dl/extractor/piczel.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

from .common import Extractor, Message
from .. import text
import json


class PiczelExtractor(Extractor):
Expand Down Expand Up @@ -137,8 +136,5 @@ def __init__(self, match):
self.image_id = match.group(1)

def posts(self):
url = "{}/gallery/image/{}".format(self.root, self.image_id)
page = self.request(url).text
data = json.loads(text.extract(
page, 'window.__PRELOADED_STATE__ =', '</script>')[0])
return (data["gallery"]["images"]["byId"][self.image_id],)
url = "{}/api/gallery/{}".format(self.root, self.image_id)
return (self.request(url).json(),)

0 comments on commit c034159

Please sign in to comment.