[erome] improve error message for deleted & copyrighted albums (#8665)
This commit is contained in:
@@ -74,8 +74,12 @@ class EromeAlbumExtractor(EromeExtractor):
|
||||
try:
|
||||
page = self.request(url).text
|
||||
except exception.HttpError as exc:
|
||||
if exc.status == 410:
|
||||
msg = text.extr(exc.response.text, "<h1>", "<")
|
||||
else:
|
||||
msg = "Unable to fetch album page"
|
||||
raise exception.AbortExtraction(
|
||||
f"{album_id}: Unable to fetch album page ({exc})")
|
||||
f"{album_id}: {msg} ({exc})")
|
||||
|
||||
title, pos = text.extract(
|
||||
page, 'property="og:title" content="', '"')
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
# published by the Free Software Foundation.
|
||||
|
||||
from gallery_dl.extractor import erome
|
||||
from gallery_dl import exception
|
||||
|
||||
|
||||
__tests__ = (
|
||||
@@ -38,6 +39,20 @@ __tests__ = (
|
||||
"user" : "yYgWBZw8o8qsMzM",
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://www.erome.com/a/qlV5z90y",
|
||||
"#comment" : "deleted album (#8665)",
|
||||
"#class" : erome.EromeAlbumExtractor,
|
||||
"#exception": exception.AbortExtraction,
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://www.erome.com/a/ACGo2Pmy",
|
||||
"#comment" : "copyrighted album (#8665)",
|
||||
"#class" : erome.EromeAlbumExtractor,
|
||||
"#exception": exception.AbortExtraction,
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://www.erome.com/yYgWBZw8o8qsMzM",
|
||||
"#category": ("", "erome", "user"),
|
||||
|
||||
Reference in New Issue
Block a user