[mangadex] use '/manga' endpoint to get manga by author (#6372)
allows for more than 10 manga to be returned
This commit is contained in:
@@ -182,13 +182,10 @@ class MangadexAuthorExtractor(MangadexExtractor):
|
||||
"/01234567-89ab-cdef-0123-456789abcdef/NAME")
|
||||
|
||||
def items(self):
|
||||
author = self.api.author(self.uuid)
|
||||
author["_extractor"] = MangadexMangaExtractor
|
||||
|
||||
for item in author["relationships"]:
|
||||
if item["type"] == "manga":
|
||||
url = "{}/title/{}".format(self.root, item["id"])
|
||||
yield Message.Queue, url, author
|
||||
for manga in self.api.manga_author(self.uuid):
|
||||
manga["_extractor"] = MangadexMangaExtractor
|
||||
url = "{}/title/{}".format(self.root, manga["id"])
|
||||
yield Message.Queue, url, manga
|
||||
|
||||
|
||||
class MangadexAPI():
|
||||
@@ -231,6 +228,10 @@ class MangadexAPI():
|
||||
params = {"includes[]": ("artist", "author")}
|
||||
return self._call("/manga/" + uuid, params)["data"]
|
||||
|
||||
def manga_author(self, uuid_author):
|
||||
params = {"authorOrArtist": uuid_author}
|
||||
return self._pagination("/manga", params)
|
||||
|
||||
def manga_feed(self, uuid):
|
||||
order = "desc" if self.extractor.config("chapter-reverse") else "asc"
|
||||
params = {
|
||||
|
||||
@@ -144,18 +144,20 @@ __tests__ = (
|
||||
"#url" : "https://mangadex.org/author/7222d0d5-836c-4bf3-9174-72bceade8c87/kotoyama",
|
||||
"#class" : mangadex.MangadexAuthorExtractor,
|
||||
"#urls" : (
|
||||
"https://mangadex.org/title/f48bbb5f-8a23-4dea-8177-eb2dbbcbf4fa",
|
||||
"https://mangadex.org/title/00b68132-4e69-4ff9-ad4b-29138b377dc8",
|
||||
"https://mangadex.org/title/41cd6fa7-3e53-4900-88e6-4a06cd7df9ad",
|
||||
"https://mangadex.org/title/f1b70bba-3873-4c22-afa3-1d1c78299cd9",
|
||||
"https://mangadex.org/title/259dfd8a-f06a-4825-8fa6-a2dcd7274230",
|
||||
"https://mangadex.org/title/d0c88e3b-ea64-4e07-9841-c1d2ac982f4a",
|
||||
"https://mangadex.org/title/f48bbb5f-8a23-4dea-8177-eb2dbbcbf4fa",
|
||||
"https://mangadex.org/title/00b68132-4e69-4ff9-ad4b-29138b377dc8",
|
||||
"https://mangadex.org/title/f1b70bba-3873-4c22-afa3-1d1c78299cd9",
|
||||
"https://mangadex.org/title/41cd6fa7-3e53-4900-88e6-4a06cd7df9ad",
|
||||
),
|
||||
},
|
||||
|
||||
"id": "7222d0d5-836c-4bf3-9174-72bceade8c87",
|
||||
"type": "author",
|
||||
"attributes": dict,
|
||||
"relationships": list,
|
||||
{
|
||||
"#url" : "https://mangadex.org/author/254efca2-0ac0-432c-a3a3-55b7e207e87d/flipflops",
|
||||
"#class" : mangadex.MangadexAuthorExtractor,
|
||||
"#pattern" : mangadex.MangadexMangaExtractor.pattern,
|
||||
"#count" : ">= 15",
|
||||
},
|
||||
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user