[manganelo] add 'bookmark' extractor (#8776)
This commit is contained in:
@@ -1570,25 +1570,25 @@ Consider all listed sites to potentially be NSFW.
|
|||||||
<tr id="nelomanga" title="nelomanga">
|
<tr id="nelomanga" title="nelomanga">
|
||||||
<td>MangaNelo</td>
|
<td>MangaNelo</td>
|
||||||
<td>https://www.nelomanga.net/</td>
|
<td>https://www.nelomanga.net/</td>
|
||||||
<td>Chapters, Manga</td>
|
<td>Bookmarks, Chapters, Manga</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="natomanga" title="natomanga">
|
<tr id="natomanga" title="natomanga">
|
||||||
<td>MangaNato</td>
|
<td>MangaNato</td>
|
||||||
<td>https://www.natomanga.com/</td>
|
<td>https://www.natomanga.com/</td>
|
||||||
<td>Chapters, Manga</td>
|
<td>Bookmarks, Chapters, Manga</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="manganato" title="manganato">
|
<tr id="manganato" title="manganato">
|
||||||
<td>MangaNato</td>
|
<td>MangaNato</td>
|
||||||
<td>https://www.manganato.gg/</td>
|
<td>https://www.manganato.gg/</td>
|
||||||
<td>Chapters, Manga</td>
|
<td>Bookmarks, Chapters, Manga</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="mangakakalot" title="mangakakalot">
|
<tr id="mangakakalot" title="mangakakalot">
|
||||||
<td>MangaKakalot</td>
|
<td>MangaKakalot</td>
|
||||||
<td>https://www.mangakakalot.gg/</td>
|
<td>https://www.mangakakalot.gg/</td>
|
||||||
<td>Chapters, Manga</td>
|
<td>Bookmarks, Chapters, Manga</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
|
|
||||||
"""Extractors for https://www.mangakakalot.gg/ and mirror sites"""
|
"""Extractors for https://www.mangakakalot.gg/ and mirror sites"""
|
||||||
|
|
||||||
from .common import BaseExtractor, ChapterExtractor, MangaExtractor
|
from .common import BaseExtractor, ChapterExtractor, MangaExtractor, Message
|
||||||
from .. import text, util
|
from .. import text, util, exception
|
||||||
|
|
||||||
|
|
||||||
class ManganeloExtractor(BaseExtractor):
|
class ManganeloExtractor(BaseExtractor):
|
||||||
@@ -126,3 +126,33 @@ class ManganeloMangaExtractor(ManganeloExtractor, MangaExtractor):
|
|||||||
"language": "English",
|
"language": "English",
|
||||||
}))
|
}))
|
||||||
return results
|
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
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
# published by the Free Software Foundation.
|
# published by the Free Software Foundation.
|
||||||
|
|
||||||
from gallery_dl.extractor import manganelo
|
from gallery_dl.extractor import manganelo
|
||||||
|
from gallery_dl import exception
|
||||||
|
|
||||||
|
|
||||||
__tests__ = (
|
__tests__ = (
|
||||||
@@ -70,4 +71,21 @@ __tests__ = (
|
|||||||
"#class" : manganelo.ManganeloMangaExtractor,
|
"#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,
|
||||||
|
},
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user