[imgadult] add 'image' extractor (#7893)

This commit is contained in:
Mike Fährmann
2025-07-25 18:58:29 +02:00
parent 3eb0b28d6d
commit d99b2ab47a
4 changed files with 49 additions and 0 deletions

View File

@@ -445,6 +445,12 @@ Consider all listed sites to potentially be NSFW.
<td>individual Images</td>
<td></td>
</tr>
<tr>
<td>ImgAdult</td>
<td>https://imgadult.com/</td>
<td>individual Images</td>
<td></td>
</tr>
<tr>
<td>ImgBB</td>
<td>https://imgbb.com/</td>

View File

@@ -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"

View File

@@ -79,6 +79,7 @@ CATEGORY_MAP = {
"imagebam" : "ImageBam",
"imagefap" : "ImageFap",
"imagepond" : "ImagePond",
"imgadult" : "ImgAdult",
"imgbb" : "ImgBB",
"imgbox" : "imgbox",
"imagechest" : "ImageChest",

22
test/results/imgadult.py Normal file
View File

@@ -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",
},
)