[8muses] skip albums without valid 'permalink' (#6717)
This commit is contained in:
@@ -57,7 +57,12 @@ class _8musesAlbumExtractor(Extractor):
|
|||||||
albums = data.get("albums")
|
albums = data.get("albums")
|
||||||
if albums:
|
if albums:
|
||||||
for album in albums:
|
for album in albums:
|
||||||
url = self.root + "/comics/album/" + album["permalink"]
|
permalink = album.get("permalink")
|
||||||
|
if not permalink:
|
||||||
|
self.log.debug("Private album")
|
||||||
|
continue
|
||||||
|
|
||||||
|
url = self.root + "/comics/album/" + permalink
|
||||||
yield Message.Queue, url, {
|
yield Message.Queue, url, {
|
||||||
"url" : url,
|
"url" : url,
|
||||||
"name" : album["name"],
|
"name" : album["name"],
|
||||||
|
|||||||
@@ -69,4 +69,12 @@ __tests__ = (
|
|||||||
"#exception": exception.HttpError,
|
"#exception": exception.HttpError,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"#url" : "https://comics.8muses.com/comics/album/Tufos-Comics/Gallery",
|
||||||
|
"#comment" : "private albums without 'permalink' (#6717)",
|
||||||
|
"#category": ("", "8muses", "album"),
|
||||||
|
"#class" : _8muses._8musesAlbumExtractor,
|
||||||
|
"#count" : range(100, 150),
|
||||||
|
},
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user