[imgadult] add 'image' extractor (#7893)
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
22
test/results/imgadult.py
Normal 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",
|
||||
},
|
||||
|
||||
)
|
||||
Reference in New Issue
Block a user