Skip to content

Commit

Permalink
[bato] rename to 'batoto'
Browse files Browse the repository at this point in the history
to use the same category name as the previous bato.to site
  • Loading branch information
mikf committed Jan 6, 2024
1 parent 3aa24c3 commit b11c352
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion docs/supportedsites.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Consider all listed sites to potentially be NSFW.
<td></td>
</tr>
<tr>
<td>Bato</td>
<td>BATO.TO</td>
<td>https://bato.to/</td>
<td>Chapters, Manga</td>
<td></td>
Expand Down
2 changes: 1 addition & 1 deletion gallery_dl/extractor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"architizer",
"artstation",
"aryion",
"bato",
"batoto",
"bbc",
"behance",
"blogger",
Expand Down
12 changes: 6 additions & 6 deletions gallery_dl/extractor/bato.py → gallery_dl/extractor/batoto.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
r"(?:(?:ba|d|w)to\.to|\.to|(?:batotoo|mangatoto)\.com)")


class BatoBase():
"""Base class for bato extractors"""
category = "bato"
class BatotoBase():
"""Base class for batoto extractors"""
category = "batoto"
root = "https://bato.to"

def request(self, url, **kwargs):
kwargs["encoding"] = "utf-8"
return Extractor.request(self, url, **kwargs)


class BatoChapterExtractor(BatoBase, ChapterExtractor):
class BatotoChapterExtractor(BatotoBase, ChapterExtractor):
"""Extractor for bato.to manga chapters"""
pattern = BASE_PATTERN + r"/(?:title/[^/?#]+|chapter)/(\d+)"
example = "https://bato.to/title/12345-MANGA/54321"
Expand Down Expand Up @@ -72,10 +72,10 @@ def images(self, page):
]


class BatoMangaExtractor(BatoBase, MangaExtractor):
class BatotoMangaExtractor(BatotoBase, MangaExtractor):
"""Extractor for bato.to manga"""
reverse = False
chapterclass = BatoChapterExtractor
chapterclass = BatotoChapterExtractor
pattern = BASE_PATTERN + r"/(?:title|series)/(\d+)[^/?#]*/?$"
example = "https://bato.to/title/12345-MANGA/"

Expand Down
2 changes: 1 addition & 1 deletion scripts/supportedsites.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"atfbooru" : "ATFBooru",
"b4k" : "arch.b4k.co",
"baraag" : "baraag",
"bato" : "Bato",
"batoto" : "BATO.TO",
"bbc" : "BBC",
"comicvine" : "Comic Vine",
"coomerparty" : "Coomer",
Expand Down
26 changes: 13 additions & 13 deletions test/results/bato.py → test/results/batoto.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.

from gallery_dl.extractor import bato
from gallery_dl.extractor import batoto
from gallery_dl import exception

__tests__ = (
{
"#url" : "https://bato.to/title/86408-i-shall-master-this-family-official/1681030-ch_8",
"#category": ("", "bato", "chapter"),
"#class" : bato.BatoChapterExtractor,
"#category": ("", "batoto", "chapter"),
"#class" : batoto.BatotoChapterExtractor,
"#count" : 66,

"manga" : "I Shall Master this Family! [Official]",
Expand All @@ -21,8 +21,8 @@
{
"#url" : "https://bato.to/title/104929-86-eighty-six-official/1943513-vol_1-ch_5",
"#comment" : "volume (vol) in url",
"#category": ("", "bato", "chapter"),
"#class" : bato.BatoChapterExtractor,
"#category": ("", "batoto", "chapter"),
"#class" : batoto.BatotoChapterExtractor,
"#count" : 7,

"manga" : "86--EIGHTY-SIX (Official)",
Expand All @@ -32,34 +32,34 @@
},
{
"#url" : "https://bato.to/title/113742-futsutsuka-na-akujo-de-wa-gozaimasu-ga-suuguu-chouso-torikae-den-official",
"#category": ("", "bato", "manga"),
"#class" : bato.BatoMangaExtractor,
"#category": ("", "batoto", "manga"),
"#class" : batoto.BatotoMangaExtractor,
"#count" : ">= 21",

"manga" : "Futsutsuka na Akujo de wa Gozaimasu ga - Suuguu Chouso Torikae Den (Official)",
},
{
"#url" : "https://bato.to/title/104929-86-eighty-six-official",
"#comment" : "Manga with number in name",
"#category": ("", "bato", "manga"),
"#class" : bato.BatoMangaExtractor,
"#category": ("", "batoto", "manga"),
"#class" : batoto.BatotoMangaExtractor,
"#count" : ">= 18",

"manga" : "86--EIGHTY-SIX (Official)",
},
{
"#url" : "https://bato.to/title/140046-the-grand-duke-s-fox-princess-mgchan",
"#comment" : "Non-English translation (Indonesian)",
"#category": ("", "bato", "manga"),
"#class" : bato.BatoMangaExtractor,
"#category": ("", "batoto", "manga"),
"#class" : batoto.BatotoMangaExtractor,
"#count" : ">= 29",

"manga" : "The Grand Duke’s Fox Princess ⎝⎝MGCHAN⎠⎠",
},
{
"#url" : "https://bato.to/title/134270-removed",
"#category": ("", "bato", "manga"),
"#class" : bato.BatoMangaExtractor,
"#category": ("", "batoto", "manga"),
"#class" : batoto.BatotoMangaExtractor,
"#exception": exception.StopExtraction,
}
)

0 comments on commit b11c352

Please sign in to comment.