diff options
Diffstat (limited to 'gallery_dl/extractor/skeb.py')
| -rw-r--r-- | gallery_dl/extractor/skeb.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/gallery_dl/extractor/skeb.py b/gallery_dl/extractor/skeb.py index 6dfc907..cd8c238 100644 --- a/gallery_dl/extractor/skeb.py +++ b/gallery_dl/extractor/skeb.py @@ -16,13 +16,14 @@ class SkebExtractor(Extractor): category = "skeb" directory_fmt = ("{category}", "{creator[screen_name]}") filename_fmt = "{post_num}_{file_id}.{extension}" - archive_fmt = "{post_num}_{file_id}_{content_category}" + archive_fmt = "{post_num}_{_file_id}_{content_category}" root = "https://skeb.jp" def __init__(self, match): Extractor.__init__(self, match) self.user_name = match.group(1) self.thumbnails = self.config("thumbnails", False) + self.article = self.config("article", False) def items(self): for user_name, post_num in self.posts(): @@ -64,6 +65,7 @@ class SkebExtractor(Extractor): resp = self.request(url, headers=headers).json() creator = resp["creator"] post = { + "post_id" : resp["id"], "post_num" : post_num, "post_url" : self.root + resp["path"], "body" : resp["body"], @@ -102,12 +104,22 @@ class SkebExtractor(Extractor): if self.thumbnails and "og_image_url" in resp: post["content_category"] = "thumb" post["file_id"] = "thumb" + post["_file_id"] = str(resp["id"]) + "t" post["file_url"] = resp["og_image_url"] yield post + if self.article and "article_image_url" in resp: + url = resp["article_image_url"] + if url: + post["content_category"] = "article" + post["file_id"] = "article" + post["_file_id"] = str(resp["id"]) + "a" + post["file_url"] = url + yield post + for preview in resp["previews"]: post["content_category"] = "preview" - post["file_id"] = preview["id"] + post["file_id"] = post["_file_id"] = preview["id"] post["file_url"] = preview["url"] info = preview["information"] post["original"] = { |
