Skip to content

Commit 41021b9

Browse files
Dragonatorulclaude
andcommitted
[wpmadara/toonily/webtoonxyz] add WP-Manga/Madara base and site extractors
Add WPMadara base classes and extractors for toonily.com and webtoon.xyz. wpmadara: - Add WPMadaraBase with manga_data() and parse_chapter_string() helpers - Add WPMadaraChapterExtractor, WPMadaraMangaExtractor (admin-ajax.php), and WPMadaraHomeExtractor with pagination support toonily: - Add Chapter, Manga, Home, Tag, and Genre extractors - cookies_domain for Cloudflare bypass via browser cookies - family-mode option controlling toonily-mature cookie webtoonxyz: - Add Chapter, Manga, and Home extractors - browser = firefox for browser impersonation - family-mode option controlling wpmanga-adault cookie Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent ba6367a commit 41021b9

File tree

12 files changed

+1561
-0
lines changed

12 files changed

+1561
-0
lines changed

docs/configuration.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6403,6 +6403,21 @@ Note
64036403
It is possible to use ``"all"`` instead of listing all values separately.
64046404

64056405

6406+
extractor.toonily.family-mode
6407+
------------------------------
6408+
Type
6409+
``bool``
6410+
Default
6411+
``false``
6412+
Description
6413+
Controls whether adult content is accessible.
6414+
6415+
``true``
6416+
Enable family mode — adult content is hidden (``toonily-mature`` cookie is not set)
6417+
``false``
6418+
Disable family mode — set ``toonily-mature=1`` to allow adult content
6419+
6420+
64066421
extractor.tumblr.avatar
64076422
-----------------------
64086423
Type
@@ -7367,6 +7382,21 @@ Description
73677382
Useful for creating CBZ archives with actual source thumbnails.
73687383

73697384

7385+
extractor.webtoonxyz.family-mode
7386+
---------------------------------
7387+
Type
7388+
``bool``
7389+
Default
7390+
``false``
7391+
Description
7392+
Controls whether adult content is accessible.
7393+
7394+
``true``
7395+
Enable family mode — adult content is hidden (``wpmanga-adault`` cookie is not set)
7396+
``false``
7397+
Disable family mode — set ``wpmanga-adault=1`` to allow adult content
7398+
7399+
73707400
extractor.weebdex.data-saver
73717401
----------------------------
73727402
Type

docs/supportedsites.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,6 +1159,12 @@ Consider all listed sites to potentially be NSFW.
11591159
<td>Galleries</td>
11601160
<td></td>
11611161
</tr>
1162+
<tr id="toonily" title="toonily">
1163+
<td>Toonily</td>
1164+
<td>https://toonily.com/</td>
1165+
<td>Chapters, Genres, Home Feed, Manga, Tag Searches</td>
1166+
<td><a href="https://github.com/mikf/gallery-dl#cookies">Cookies</a></td>
1167+
</tr>
11621168
<tr id="toyhouse" title="toyhouse">
11631169
<td>Toyhouse</td>
11641170
<td>https://toyhou.se/</td>
@@ -1273,6 +1279,12 @@ Consider all listed sites to potentially be NSFW.
12731279
<td>Artists, Comics, Episodes</td>
12741280
<td></td>
12751281
</tr>
1282+
<tr id="webtoonxyz" title="webtoonxyz">
1283+
<td>Webtoonxyz</td>
1284+
<td>https://www.webtoon.xyz/</td>
1285+
<td>Chapters, Home Feed, Manga</td>
1286+
<td><a href="https://github.com/mikf/gallery-dl#cookies">Cookies</a></td>
1287+
</tr>
12761288
<tr id="weebcentral" title="weebcentral">
12771289
<td>Weeb Central</td>
12781290
<td>https://weebcentral.com/</td>

gallery_dl/extractor/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@
218218
"thehentaiworld",
219219
"tiktok",
220220
"tmohentai",
221+
"toonily",
221222
"toyhouse",
222223
"tumblr",
223224
"tumblrgallery",
@@ -240,13 +241,15 @@
240241
"weasyl",
241242
"webmshare",
242243
"webtoons",
244+
"webtoonxyz",
243245
"weebcentral",
244246
"weebdex",
245247
"weibo",
246248
"whyp",
247249
"wikiart",
248250
"wikifeet",
249251
"wikimedia",
252+
"wpmadara",
250253
"xasiat",
251254
"xenforo",
252255
"xfolio",

gallery_dl/extractor/toonily.py

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# -*- coding: utf-8 -*-
2+
3+
# This program is free software; you can redistribute it and/or modify
4+
# it under the terms of the GNU General Public License version 2 as
5+
# published by the Free Software Foundation.
6+
7+
"""Extractors for https://toonily.com/"""
8+
9+
from .. import text
10+
from .wpmadara import (
11+
WPMadaraChapterExtractor,
12+
WPMadaraHomeExtractor,
13+
WPMadaraMangaExtractor,
14+
)
15+
16+
17+
class ToonilyChapterExtractor(WPMadaraChapterExtractor):
18+
"""Extractor for manga chapters from toonily.com"""
19+
category = "toonily"
20+
root = "https://toonily.com"
21+
cookies_domain = ".toonily.com"
22+
pattern = r"(?:https?://)?(?:www\.)?toonily\.com(/serie/[^/?#]+/[^/?#]+)"
23+
example = "https://toonily.com/serie/MANGA/chapter-1/"
24+
25+
def initialize(self):
26+
WPMadaraChapterExtractor.initialize(self)
27+
if not self.config("family-mode", False):
28+
self.cookies.update({"toonily-mature": "1"})
29+
30+
def images(self, page):
31+
return [
32+
(url, data)
33+
for url, data in WPMadaraChapterExtractor.images(self, page)
34+
if "wp-content/assets" not in url
35+
]
36+
37+
38+
class ToonilyMangaExtractor(WPMadaraMangaExtractor):
39+
"""Extractor for manga from toonily.com"""
40+
category = "toonily"
41+
chapterclass = ToonilyChapterExtractor
42+
root = "https://toonily.com"
43+
cookies_domain = ".toonily.com"
44+
pattern = r"(?:https?://)?(?:www\.)?toonily\.com(/serie/[^/?#]+)/?$"
45+
example = "https://toonily.com/serie/MANGA/"
46+
47+
def initialize(self):
48+
WPMadaraMangaExtractor.initialize(self)
49+
if not self.config("family-mode", False):
50+
self.cookies.update({"toonily-mature": "1"})
51+
52+
53+
class ToonilyListExtractor(WPMadaraHomeExtractor):
54+
"""Base class for manga listings from toonily.com"""
55+
category = "toonily"
56+
root = "https://toonily.com"
57+
cookies_domain = ".toonily.com"
58+
mangaextractor = ToonilyMangaExtractor
59+
60+
def initialize(self):
61+
WPMadaraHomeExtractor.initialize(self)
62+
if not self.config("family-mode", False):
63+
self.cookies.update({"toonily-mature": "1"})
64+
65+
66+
class ToonilyHomeExtractor(ToonilyListExtractor):
67+
"""Extractor for manga listings from toonily.com"""
68+
pattern = r"(?:https?://)?(?:www\.)?toonily\.com(?:/page/(\d+))?/?$"
69+
example = "https://toonily.com/"
70+
71+
72+
class ToonilyTaxonomyExtractor(ToonilyListExtractor):
73+
"""Base class for taxonomy listings from toonily.com"""
74+
taxonomy = ""
75+
76+
def __init__(self, match):
77+
ToonilyListExtractor.__init__(self, match)
78+
self.term = match[1]
79+
self.page = text.parse_int(match[2], 1)
80+
81+
def page_url(self, page_num):
82+
url = "{}/{}/{}/".format(
83+
self.root.rstrip("/"), self.taxonomy, self.term)
84+
if page_num == 1:
85+
return url
86+
return "{}page/{}/".format(url, page_num)
87+
88+
89+
class ToonilyTagExtractor(ToonilyTaxonomyExtractor):
90+
"""Extractor for tag listings from toonily.com"""
91+
subcategory = "tag"
92+
taxonomy = "tag"
93+
pattern = (r"(?:https?://)?(?:www\.)?toonily\.com/tag/"
94+
r"([^/?#]+)(?:/page/(\d+))?/?$")
95+
example = "https://toonily.com/tag/TAG/"
96+
97+
98+
class ToonilyGenreExtractor(ToonilyTaxonomyExtractor):
99+
"""Extractor for genre listings from toonily.com"""
100+
subcategory = "genre"
101+
taxonomy = "genre"
102+
pattern = (r"(?:https?://)?(?:www\.)?toonily\.com/genre/"
103+
r"([^/?#]+)(?:/page/(\d+))?/?$")
104+
example = "https://toonily.com/genre/GENRE/"

gallery_dl/extractor/webtoonxyz.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# -*- coding: utf-8 -*-
2+
3+
# This program is free software; you can redistribute it and/or modify
4+
# it under the terms of the GNU General Public License version 2 as
5+
# published by the Free Software Foundation.
6+
7+
"""Extractors for https://www.webtoon.xyz/"""
8+
9+
from .wpmadara import (
10+
WPMadaraChapterExtractor,
11+
WPMadaraHomeExtractor,
12+
WPMadaraMangaExtractor,
13+
)
14+
15+
16+
class WebtoonxyzBase():
17+
"""Base class for webtoon.xyz extractors"""
18+
category = "webtoonxyz"
19+
root = "https://www.webtoon.xyz"
20+
cookies_domain = ".webtoon.xyz"
21+
browser = "firefox"
22+
23+
def initialize(self):
24+
super().initialize()
25+
if not self.config("family-mode", False):
26+
self.cookies.update({"wpmanga-adault": "1"})
27+
28+
29+
class WebtoonxyzChapterExtractor(WebtoonxyzBase, WPMadaraChapterExtractor):
30+
"""Extractor for webtoon.xyz chapter pages"""
31+
pattern = (
32+
r"(?:https?://)?(?:www\.)?webtoon\.xyz"
33+
r"(/read/[^/?#]+/[^/?#]+)"
34+
)
35+
example = "https://www.webtoon.xyz/read/MANGA/chapter-1/"
36+
37+
38+
class WebtoonxyzMangaExtractor(WebtoonxyzBase, WPMadaraMangaExtractor):
39+
"""Extractor for webtoon.xyz manga pages"""
40+
chapterclass = WebtoonxyzChapterExtractor
41+
pattern = r"(?:https?://)?(?:www\.)?webtoon\.xyz(/read/[^/?#]+)/?$"
42+
example = "https://www.webtoon.xyz/read/MANGA/"
43+
44+
45+
class WebtoonxyzHomeExtractor(WebtoonxyzBase, WPMadaraHomeExtractor):
46+
"""Extractor for the webtoon.xyz home feed"""
47+
mangaextractor = WebtoonxyzMangaExtractor
48+
pattern = r"(?:https?://)?(?:www\.)?webtoon\.xyz(?:/page/(\d+))?/?$"
49+
example = "https://www.webtoon.xyz/"

0 commit comments

Comments
 (0)