mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 10:42:34 +01:00
[nijie] fix dojin extraction
- correctly extract artist_id - set extension to "jpg" if it was empty and let filetype checks do the rest
This commit is contained in:
parent
7f7c16ae37
commit
f5f2d29f56
@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2015-2017 Mike Fährmann
|
||||
# Copyright 2015-2018 Mike Fährmann
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as
|
||||
@ -35,6 +35,8 @@ class NijieExtractor(AsynchronousExtractor):
|
||||
for image_id in images:
|
||||
for image_url, image_data in self.get_image_data(image_id):
|
||||
image_data.update(data)
|
||||
if not image_data["extension"]:
|
||||
image_data["extension"] = "jpg"
|
||||
yield Message.Url, image_url, image_data
|
||||
|
||||
def get_job_metadata(self):
|
||||
@ -138,7 +140,9 @@ class NijieImageExtractor(NijieExtractor):
|
||||
if 300 <= response.status_code < 400:
|
||||
raise exception.NotFoundError("image")
|
||||
self.page = response.text
|
||||
self.artist_id = text.extract(self.page, "/nijie_picture/sp/", "_")[0]
|
||||
self.artist_id = text.extract(
|
||||
self.page, "/nijie_picture/sp/", "_")[0] or text.extract(
|
||||
self.page, "/dojin_main/", "_")[0]
|
||||
return NijieExtractor.get_job_metadata(self)
|
||||
|
||||
def get_image_ids(self):
|
||||
|
@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2015-2017 Mike Fährmann
|
||||
# Copyright 2015-2018 Mike Fährmann
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as
|
||||
@ -26,6 +26,16 @@ class PowermangaMangaExtractor(foolslide.FoolslideMangaExtractor):
|
||||
category = "powermanga"
|
||||
pattern = foolslide.manga_pattern(r"read\.powermanga\.org")
|
||||
test = [("https://read.powermanga.org/series/one_piece/", {
|
||||
"url": "e5e9a64c14ca51a170e14c4b711aaa88fdf7a7aa",
|
||||
"keyword": "1245ab2a730f9129001a4589b1d8615a17dc4a7b",
|
||||
"count": ">= 1",
|
||||
"keyword": {
|
||||
"chapter": int,
|
||||
"chapter_minor": str,
|
||||
"chapter_string": str,
|
||||
"group": "PowerManga",
|
||||
"lang": "en",
|
||||
"language": "English",
|
||||
"manga": "One Piece",
|
||||
"title": str,
|
||||
"volume": int,
|
||||
},
|
||||
})]
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2015-2017 Mike Fährmann
|
||||
# Copyright 2015-2018 Mike Fährmann
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as
|
||||
@ -20,6 +20,7 @@ SKIP = {
|
||||
# temporary issues
|
||||
"chronos",
|
||||
"coreimg",
|
||||
"hosturimage",
|
||||
"yeet",
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user