1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-26 12:42:29 +01:00

improve/adjust default filename formats for manga sites

This commit is contained in:
Mike Fährmann 2017-10-02 19:06:24 +02:00
parent 41adb99e9c
commit 633b376f35
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
10 changed files with 33 additions and 24 deletions

View File

@ -113,8 +113,11 @@ class BatotoMangaExtractor(BatotoExtractor, MangaExtractor):
class BatotoChapterExtractor(BatotoExtractor, AsynchronousExtractor):
"""Extractor for manga-chapters from bato.to"""
subcategory = "chapter"
directory_fmt = ["{category}", "{manga}", "c{chapter:>03} - {title}"]
filename_fmt = "{manga}_c{chapter:>03}_{page:>03}.{extension}"
directory_fmt = [
"{category}", "{manga}",
"{volume:?v/ />02}c{chapter:>03}{chapter_minor}{title:?: //}"]
filename_fmt = (
"{manga}_c{chapter:>03}{chapter_minor}_{page:>03}.{extension}")
pattern = [r"(?:https?://)?(?:www\.)?bato\.to/reader#([0-9a-f]+)"]
test = [
("http://bato.to/reader#459878c8fda07502", {

View File

@ -18,9 +18,9 @@ class FallenangelsChapterExtractor(Extractor):
category = "fallenangels"
subcategory = "chapter"
directory_fmt = ["{category}", "{manga}",
"c{chapter:>03}{chapter_minor} - {title}"]
filename_fmt = ("{manga}_c{chapter:>03}{chapter_minor}_"
"{page:>03}.{extension}")
"c{chapter:>03}{chapter_minor}{title:?: //}"]
filename_fmt = (
"{manga}_c{chapter:>03}{chapter_minor}_{page:>03}.{extension}")
pattern = [(r"(?:https?://)?(manga|truyen)\.fascans\.com/"
r"manga/([^/]+)/(\d+)(\.[^/?&#]+)?")]
test = [

View File

@ -58,7 +58,8 @@ class FoolslideChapterExtractor(FoolslideExtractor):
"""Base class for chapter extractors for FoOlSlide based sites"""
subcategory = "chapter"
directory_fmt = ["{category}", "{manga}", "{chapter_string}"]
filename_fmt = "{manga}_{chapter:>03}_{page:>03}.{extension}"
filename_fmt = (
"{manga}_c{chapter:>03}{chapter_minor}_{page:>03}.{extension}")
single = True
def __init__(self, match, url=None):

View File

@ -24,10 +24,11 @@ IV = [
class KissmangaExtractor(Extractor):
"""Base class for kissmanga extractors"""
category = "kissmanga"
directory_fmt = ["{category}", "{manga}",
"c{chapter:>03}{chapter_minor} - {title}"]
filename_fmt = ("{manga}_c{chapter:>03}{chapter_minor}_"
"{page:>03}.{extension}")
directory_fmt = [
"{category}", "{manga}",
"{volume:?v/ />02}c{chapter:>03}{chapter_minor}{title:?: //}"]
filename_fmt = (
"{manga}_c{chapter:>03}{chapter_minor}_{page:>03}.{extension}")
root = "http://kissmanga.com"
def __init__(self, match):

View File

@ -17,9 +17,11 @@ class MangafoxChapterExtractor(AsynchronousExtractor):
"""Extractor for manga-chapters from mangafox.me"""
category = "mangafox"
subcategory = "chapter"
directory_fmt = ["{category}", "{manga}", "c{chapter:>03}{chapter_minor}"]
filename_fmt = ("{manga}_c{chapter:>03}{chapter_minor}_"
"{page:>03}.{extension}")
directory_fmt = [
"{category}", "{manga}",
"{volume:?v/ />02}c{chapter:>03}{chapter_minor}"]
filename_fmt = (
"{manga}_c{chapter:>03}{chapter_minor}_{page:>03}.{extension}")
pattern = [(r"(?:https?://)?(?:www\.)?(mangafox\.me/manga/"
r"[^/]+/(v\d+/)?c\d+[^/]*)")]
test = [(("http://mangafox.me/manga/kidou_keisatsu_patlabor/"

View File

@ -58,9 +58,11 @@ class MangahereChapterExtractor(AsynchronousExtractor):
"""Extractor for manga-chapters from mangahere.co"""
category = "mangahere"
subcategory = "chapter"
directory_fmt = ["{category}", "{manga}", "c{chapter:>03}{chapter_minor}"]
filename_fmt = ("{manga}_c{chapter:>03}{chapter_minor}_"
"{page:>03}.{extension}")
directory_fmt = [
"{category}", "{manga}",
"{volume:?v/ />02}c{chapter:>03}{chapter_minor}"]
filename_fmt = (
"{manga}_c{chapter:>03}{chapter_minor}_{page:>03}.{extension}")
pattern = [(r"(?:https?://)?(?:www\.)?mangahere\.co/manga/"
r"([^/]+(?:/v0*(\d+))?/c0*(\d+)(\.\d+)?)")]
test = [("http://www.mangahere.co/manga/dongguo_xiaojie/c003.2/", {

View File

@ -28,7 +28,6 @@ class MangapandaMangaExtractor(MangapandaBase, MangareaderMangaExtractor):
class MangapandaChapterExtractor(MangapandaBase, MangareaderChapterExtractor):
"""Extractor for manga-chapters from mangapanda.com"""
subcategory = "chapter"
pattern = [
(r"(?:https?://)?(?:www\.)?mangapanda\.com((/[^/]+)/(\d+))"),
(r"(?:https?://)?(?:www\.)?mangapanda\.com"

View File

@ -70,10 +70,11 @@ class MangaparkMangaExtractor(MangaparkExtractor, MangaExtractor):
class MangaparkChapterExtractor(MangaparkExtractor):
"""Extractor for manga-chapters from mangapark.me"""
subcategory = "chapter"
directory_fmt = ["{category}", "{manga}",
"c{chapter:>03}{chapter_minor} - {title}"]
filename_fmt = ("{manga}_c{chapter:>03}{chapter_minor}_"
"{page:>03}.{extension}")
directory_fmt = [
"{category}", "{manga}",
"{volume:?v/ />02}c{chapter:>03}{chapter_minor}{title:?: //}"]
filename_fmt = (
"{manga}_c{chapter:>03}{chapter_minor}_{page:>03}.{extension}")
pattern = [(r"(?:https?://)?(?:www\.)?mangapark\.me(/manga/[^/]+"
r"/s\d+(?:/v\d+)?/c\d+[^/]*(?:/e\d+)?)")]
test = [

View File

@ -15,8 +15,6 @@ from .. import text, util
class MangareaderBase():
"""Base class for mangareader extractors"""
category = "mangareader"
directory_fmt = ["{category}", "{manga}", "c{chapter:>03} - {title}"]
filename_fmt = "{manga}_c{chapter:>03}_{page:>03}.{extension}"
root = "http://www.mangareader.net"
@staticmethod
@ -62,6 +60,8 @@ class MangareaderMangaExtractor(MangareaderBase, MangaExtractor):
class MangareaderChapterExtractor(MangareaderBase, AsynchronousExtractor):
"""Extractor for manga-chapters from mangareader.net"""
subcategory = "chapter"
directory_fmt = ["{category}", "{manga}", "c{chapter:>03}{title:?: //}"]
filename_fmt = "{manga}_c{chapter:>03}_{page:>03}.{extension}"
pattern = [
(r"(?:https?://)?(?:www\.)?mangareader\.net((/[^/]+)/(\d+))"),
(r"(?:https?://)?(?:www\.)?mangareader\.net(/\d+-\d+-\d+(/[^/]+)/"

View File

@ -17,7 +17,7 @@ class MangastreamChapterExtractor(AsynchronousExtractor):
"""Extractor for manga-chapters from mangastream.com"""
category = "mangastream"
subcategory = "chapter"
directory_fmt = ["{category}", "{manga}", "c{chapter} - {title}"]
directory_fmt = ["{category}", "{manga}", "c{chapter}{title:?: //}"]
filename_fmt = "{manga}_c{chapter}_{page:>03}.{extension}"
pattern = [(r"(?:https?://)?(?:www\.)?(?:readms|mangastream)\.(?:com|net)/"
r"r(?:ead)?/([^/]*/([^/]+)/(\d+))")]