diff options
Diffstat (limited to 'gallery_dl/extractor/imgbox.py')
| -rw-r--r-- | gallery_dl/extractor/imgbox.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gallery_dl/extractor/imgbox.py b/gallery_dl/extractor/imgbox.py index 5def88d..8ac66f4 100644 --- a/gallery_dl/extractor/imgbox.py +++ b/gallery_dl/extractor/imgbox.py @@ -9,7 +9,7 @@ """Extractors for https://imgbox.com/""" from .common import Extractor, Message, AsynchronousMixin -from .. import text, util, exception +from .. import text, exception class ImgboxExtractor(Extractor): @@ -19,7 +19,7 @@ class ImgboxExtractor(Extractor): def items(self): data = self.get_job_metadata() - yield Message.Directory, data + yield Message.Directory, "", data for image_key in self.get_image_keys(): imgpage = self.request(self.root + "/" + image_key).text @@ -69,7 +69,7 @@ class ImgboxGalleryExtractor(AsynchronousMixin, ImgboxExtractor): page = self.request(self.root + "/g/" + self.gallery_key).text if "The specified gallery could not be found." in page: raise exception.NotFoundError("gallery") - self.image_keys = util.re( + self.image_keys = text.re( r'<a href="/([^"]+)"><img alt="').findall(page) title = text.extr(page, "<h1>", "</h1>") @@ -88,7 +88,10 @@ class ImgboxImageExtractor(ImgboxExtractor): """Extractor for single images from imgbox.com""" subcategory = "image" archive_fmt = "{image_key}" - pattern = r"(?:https?://)?(?:www\.)?imgbox\.com/([A-Za-z0-9]{8})" + pattern = (r"(?:https?://)?(?:" + r"(?:www\.|i\.)?imgbox\.com|" + r"images\d+\.imgbox\.com/[0-9a-f]{2}/[0-9a-f]{2}" + r")/([A-Za-z0-9]{8})") example = "https://imgbox.com/1234abcd" def __init__(self, match): |
