[manganelo] add 'bookmark' extractor (#8776)

This commit is contained in:
Mike Fährmann
2025-12-31 10:59:32 +01:00
parent 9ff3cc4a8e
commit add9fbc13b
3 changed files with 54 additions and 6 deletions

View File

@@ -1570,25 +1570,25 @@ Consider all listed sites to potentially be NSFW.
<tr id="nelomanga" title="nelomanga">
<td>MangaNelo</td>
<td>https://www.nelomanga.net/</td>
<td>Chapters, Manga</td>
<td>Bookmarks, Chapters, Manga</td>
<td></td>
</tr>
<tr id="natomanga" title="natomanga">
<td>MangaNato</td>
<td>https://www.natomanga.com/</td>
<td>Chapters, Manga</td>
<td>Bookmarks, Chapters, Manga</td>
<td></td>
</tr>
<tr id="manganato" title="manganato">
<td>MangaNato</td>
<td>https://www.manganato.gg/</td>
<td>Chapters, Manga</td>
<td>Bookmarks, Chapters, Manga</td>
<td></td>
</tr>
<tr id="mangakakalot" title="mangakakalot">
<td>MangaKakalot</td>
<td>https://www.mangakakalot.gg/</td>
<td>Chapters, Manga</td>
<td>Bookmarks, Chapters, Manga</td>
<td></td>
</tr>

View File

@@ -9,8 +9,8 @@
"""Extractors for https://www.mangakakalot.gg/ and mirror sites"""
from .common import BaseExtractor, ChapterExtractor, MangaExtractor
from .. import text, util
from .common import BaseExtractor, ChapterExtractor, MangaExtractor, Message
from .. import text, util, exception
class ManganeloExtractor(BaseExtractor):
@@ -126,3 +126,33 @@ class ManganeloMangaExtractor(ManganeloExtractor, MangaExtractor):
"language": "English",
}))
return results
class ManganeloBookmarkExtractor(ManganeloExtractor):
"""Extractor for manganelo bookmarks"""
subcategory = "bookmark"
pattern = BASE_PATTERN + r"/bookmark"
example = "https://www.mangakakalot.gg/bookmark"
def items(self):
data = {"_extractor": ManganeloMangaExtractor}
url = self.root + "/bookmark"
params = {"page": 1}
response = self.request(url, params=params)
if response.history:
raise exception.AuthRequired(
"authenticated cookies", "your bookmarks")
page = response.text
last = text.parse_int(text.extr(page, ">Last(", ")"))
while True:
for bookmark in text.extract_iter(
page, 'class="user-bookmark-item ', '</a>'):
yield Message.Queue, text.extr(bookmark, ' href="', '"'), data
if params["page"] >= last:
break
params["page"] += 1
page = self.request(url, params=params).text

View File

@@ -5,6 +5,7 @@
# published by the Free Software Foundation.
from gallery_dl.extractor import manganelo
from gallery_dl import exception
__tests__ = (
@@ -70,4 +71,21 @@ __tests__ = (
"#class" : manganelo.ManganeloMangaExtractor,
},
{
"#url" : "https://www.nelomanga.net/bookmark",
"#category": ("manganelo", "nelomanga", "bookmark"),
"#class" : manganelo.ManganeloBookmarkExtractor,
"#pattern" : manganelo.ManganeloMangaExtractor.pattern,
"#auth" : "cookies",
"#count" : 23,
},
{
"#url" : "https://nelomanga.net/bookmark",
"#category": ("manganelo", "nelomanga", "bookmark"),
"#class" : manganelo.ManganeloBookmarkExtractor,
"#auth" : False,
"#exception": exception.AuthRequired,
},
)