diff --git a/docs/supportedsites.md b/docs/supportedsites.md index 90669ed9..9b685736 100644 --- a/docs/supportedsites.md +++ b/docs/supportedsites.md @@ -445,6 +445,12 @@ Consider all listed sites to potentially be NSFW. individual Images + + ImgAdult + https://imgadult.com/ + individual Images + + ImgBB https://imgbb.com/ diff --git a/gallery_dl/extractor/imagehosts.py b/gallery_dl/extractor/imagehosts.py index f3c0075a..0e5ce7ef 100644 --- a/gallery_dl/extractor/imagehosts.py +++ b/gallery_dl/extractor/imagehosts.py @@ -210,6 +210,26 @@ class ImagetwistGalleryExtractor(ImagehostImageExtractor): yield Message.Queue, root + path, data +class ImgadultImageExtractor(ImagehostImageExtractor): + """Extractor for single images from imgadult.com""" + category = "imgadult" + _cookies = {"img_i_d": "1"} + pattern = r"(?:https?://)?((?:www\.)?imgadult\.com/img-([0-9a-f]+)\.html)" + example = "https://imgadult.com/img-0123456789abc.html" + + def get_info(self, page): + url , pos = text.extract(page, "' src='", "'") + name, pos = text.extract(page, "alt='", "'", pos) + + if name: + name, _, rhs = name.rpartition(" image hosted at ImgAdult.com") + if not name: + name = rhs + name = text.unescape(name) + + return url, name + + class ImgspiceImageExtractor(ImagehostImageExtractor): """Extractor for single images from imgspice.com""" category = "imgspice" diff --git a/scripts/supportedsites.py b/scripts/supportedsites.py index 36708ff3..d99bbebc 100755 --- a/scripts/supportedsites.py +++ b/scripts/supportedsites.py @@ -79,6 +79,7 @@ CATEGORY_MAP = { "imagebam" : "ImageBam", "imagefap" : "ImageFap", "imagepond" : "ImagePond", + "imgadult" : "ImgAdult", "imgbb" : "ImgBB", "imgbox" : "imgbox", "imagechest" : "ImageChest", diff --git a/test/results/imgadult.py b/test/results/imgadult.py new file mode 100644 index 00000000..c66af93c --- /dev/null +++ b/test/results/imgadult.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. + +from gallery_dl.extractor import imagehosts + + +__tests__ = ( +{ + "#url" : "https://imgadult.com/img-686b4f451af05.html", + "#class" : imagehosts.ImgadultImageExtractor, + "#results" : "https://imgadult.com/upload/big/2025/07/07/686b4f451af04.jpg", + "#sha1_content" : "6df0034ce96ad2347926037abe2dd0085ebc8d66", + + "extension": "jpg", + "filename" : "1612", + "token" : "686b4f451af05", +}, + +)