fix --range causing crashes (#4557)

regression caused by a383eca7
This commit is contained in:
Mike Fährmann
2023-09-21 23:14:08 +02:00
parent 3528974459
commit 2cd801232b
5 changed files with 29 additions and 7 deletions

View File

@@ -37,7 +37,7 @@ __tests__ = (
"#category": ("", "deviantart", "gallery"),
"#class" : deviantart.DeviantartGalleryExtractor,
"#pattern" : r"https://(images-)?wixmp-[^.]+\.wixmp\.com/f/.+/.+\.(jpg|png)\?token=.+",
"#count" : ">= 30",
"#count" : ">= 38",
"allows_comments" : bool,
"author" : {
@@ -82,6 +82,17 @@ __tests__ = (
"username" : "shimoda7",
},
{
"#url" : "https://www.deviantart.com/shimoda7/gallery/",
"#comment" : "range/skip (#4557)",
"#category": ("", "deviantart", "gallery"),
"#class" : deviantart.DeviantartGalleryExtractor,
"#options" : {"original": False},
"#pattern" : r"https://images-wixmp-[0-9a-f]+\.wixmp\.com/f/0e474835-ec35-4937-b647-b6830ed58bd1/d2idul-6158ded2-37ac-413d-802e-0689f0f020ad\.jpg\?token=[\w.]+",
"#range" : "38-",
"#count" : 1,
},
{
"#url" : "https://www.deviantart.com/yakuzafc/gallery",
"#comment" : "group",

View File

@@ -206,6 +206,7 @@ class ResultJob(job.DownloadJob):
self.extractor.filename_fmt).format_map
def run(self):
self._init()
for msg in self.extractor:
self.dispatch(msg)