2016-11-03 15:46:04 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2023-07-28 14:18:47 +02:00
|
|
|
# Copyright 2016-2023 Mike Fährmann
|
2016-11-03 15:46:04 +01:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2016-11-03 18:14:33 +01:00
|
|
|
"""Collection of extractors for various imagehosts"""
|
2016-11-03 15:46:04 +01:00
|
|
|
|
2020-11-17 00:34:07 +01:00
|
|
|
from .common import Extractor, Message
|
2017-02-02 15:52:48 +01:00
|
|
|
from .. import text, exception
|
2018-02-22 23:50:50 +01:00
|
|
|
from ..cache import memcache
|
2016-11-03 15:46:04 +01:00
|
|
|
from os.path import splitext
|
|
|
|
|
2017-02-01 00:53:19 +01:00
|
|
|
|
2020-11-17 00:34:07 +01:00
|
|
|
class ImagehostImageExtractor(Extractor):
|
2016-11-03 18:14:33 +01:00
|
|
|
"""Base class for single-image extractors for various imagehosts"""
|
2019-02-06 17:37:56 +01:00
|
|
|
basecategory = "imagehost"
|
2016-11-03 15:46:04 +01:00
|
|
|
subcategory = "image"
|
2018-01-30 22:49:16 +01:00
|
|
|
archive_fmt = "{token}"
|
2023-07-28 14:18:47 +02:00
|
|
|
_https = True
|
|
|
|
_params = None
|
|
|
|
_cookies = None
|
|
|
|
_encoding = None
|
2016-11-03 15:46:04 +01:00
|
|
|
|
|
|
|
def __init__(self, match):
|
2019-02-11 13:31:10 +01:00
|
|
|
Extractor.__init__(self, match)
|
2019-02-12 10:20:21 +01:00
|
|
|
self.page_url = "http{}://{}".format(
|
2023-07-28 14:18:47 +02:00
|
|
|
"s" if self._https else "", match.group(1))
|
2016-11-03 15:46:04 +01:00
|
|
|
self.token = match.group(2)
|
2021-02-10 17:36:45 +01:00
|
|
|
|
2023-07-28 14:18:47 +02:00
|
|
|
if self._params == "simple":
|
|
|
|
self._params = {
|
2016-11-03 15:46:04 +01:00
|
|
|
"imgContinue": "Continue+to+image+...+",
|
|
|
|
}
|
2023-07-28 14:18:47 +02:00
|
|
|
elif self._params == "complex":
|
|
|
|
self._params = {
|
2016-11-03 15:46:04 +01:00
|
|
|
"op": "view",
|
|
|
|
"id": self.token,
|
|
|
|
"pre": "1",
|
|
|
|
"adb": "1",
|
|
|
|
"next": "Continue+to+image+...+",
|
|
|
|
}
|
|
|
|
|
|
|
|
def items(self):
|
2018-04-09 15:53:20 +02:00
|
|
|
page = self.request(
|
2019-02-12 10:20:21 +01:00
|
|
|
self.page_url,
|
2023-07-28 14:18:47 +02:00
|
|
|
method=("POST" if self._params else "GET"),
|
|
|
|
data=self._params,
|
|
|
|
cookies=self._cookies,
|
|
|
|
encoding=self._encoding,
|
2018-04-09 15:53:20 +02:00
|
|
|
).text
|
|
|
|
|
2016-11-03 15:46:04 +01:00
|
|
|
url, filename = self.get_info(page)
|
|
|
|
data = text.nameext_from_url(filename, {"token": self.token})
|
2022-11-11 08:53:07 +01:00
|
|
|
data.update(self.metadata(page))
|
2023-07-28 14:18:47 +02:00
|
|
|
if self._https and url.startswith("http:"):
|
2016-11-03 15:46:04 +01:00
|
|
|
url = "https:" + url[5:]
|
2018-04-09 15:53:20 +02:00
|
|
|
|
2016-11-03 15:46:04 +01:00
|
|
|
yield Message.Directory, data
|
|
|
|
yield Message.Url, url, data
|
|
|
|
|
2016-11-03 18:14:33 +01:00
|
|
|
def get_info(self, page):
|
|
|
|
"""Find image-url and string to get filename from"""
|
|
|
|
|
2022-11-11 08:53:07 +01:00
|
|
|
def metadata(self, page):
|
|
|
|
"""Return additional metadata"""
|
|
|
|
return ()
|
|
|
|
|
2016-11-03 15:46:04 +01:00
|
|
|
|
2018-04-09 15:53:20 +02:00
|
|
|
class ImxtoImageExtractor(ImagehostImageExtractor):
|
|
|
|
"""Extractor for single images from imx.to"""
|
|
|
|
category = "imxto"
|
2019-02-08 13:45:40 +01:00
|
|
|
pattern = (r"(?:https?://)?(?:www\.)?((?:imx\.to|img\.yt)"
|
|
|
|
r"/(?:i/|img-)(\w+)(\.html)?)")
|
2019-02-06 17:37:56 +01:00
|
|
|
test = (
|
2018-04-09 15:53:20 +02:00
|
|
|
("https://imx.to/i/1qdeva", { # new-style URL
|
|
|
|
"url": "ab2173088a6cdef631d7a47dec4a5da1c6a00130",
|
|
|
|
"content": "0c8768055e4e20e7c7259608b67799171b691140",
|
2022-11-11 08:53:07 +01:00
|
|
|
"keyword": {
|
|
|
|
"size" : 18,
|
|
|
|
"width" : 64,
|
|
|
|
"height": 32,
|
|
|
|
"hash" : "94d56c599223c59f3feb71ea603484d1",
|
|
|
|
},
|
2018-04-09 15:53:20 +02:00
|
|
|
}),
|
|
|
|
("https://imx.to/img-57a2050547b97.html", { # old-style URL
|
|
|
|
"url": "a83fe6ef1909a318c4d49fcf2caf62f36c3f9204",
|
2017-02-02 15:52:48 +01:00
|
|
|
"content": "54592f2635674c25677c6872db3709d343cdf92f",
|
2022-11-11 08:53:07 +01:00
|
|
|
"keyword": {
|
|
|
|
"size" : 5284,
|
|
|
|
"width" : 320,
|
|
|
|
"height": 160,
|
|
|
|
"hash" : "40da6aaa7b8c42b18ef74309bbc713fc",
|
|
|
|
},
|
2017-02-02 15:52:48 +01:00
|
|
|
}),
|
2018-04-09 15:53:20 +02:00
|
|
|
("https://img.yt/img-57a2050547b97.html", { # img.yt domain
|
|
|
|
"url": "a83fe6ef1909a318c4d49fcf2caf62f36c3f9204",
|
|
|
|
}),
|
|
|
|
("https://imx.to/img-57a2050547b98.html", {
|
2017-02-02 15:52:48 +01:00
|
|
|
"exception": exception.NotFoundError,
|
|
|
|
}),
|
2019-02-06 17:37:56 +01:00
|
|
|
)
|
2023-07-28 14:18:47 +02:00
|
|
|
_params = "simple"
|
|
|
|
_encoding = "utf-8"
|
2018-04-09 15:53:20 +02:00
|
|
|
|
|
|
|
def __init__(self, match):
|
|
|
|
ImagehostImageExtractor.__init__(self, match)
|
2019-02-12 10:20:21 +01:00
|
|
|
if "/img-" in self.page_url:
|
|
|
|
self.page_url = self.page_url.replace("img.yt", "imx.to")
|
|
|
|
self.url_ext = True
|
2018-04-09 15:53:20 +02:00
|
|
|
else:
|
2019-02-12 10:20:21 +01:00
|
|
|
self.url_ext = False
|
2016-11-03 15:46:04 +01:00
|
|
|
|
|
|
|
def get_info(self, page):
|
2018-04-09 15:53:20 +02:00
|
|
|
url, pos = text.extract(
|
|
|
|
page, '<div style="text-align:center;"><a href="', '"')
|
2017-02-02 15:52:48 +01:00
|
|
|
if not url:
|
|
|
|
raise exception.NotFoundError("image")
|
2018-04-09 15:53:20 +02:00
|
|
|
filename, pos = text.extract(page, ' title="', '"', pos)
|
2019-02-12 10:20:21 +01:00
|
|
|
if self.url_ext and filename:
|
2018-04-09 15:53:20 +02:00
|
|
|
filename += splitext(url)[1]
|
|
|
|
return url, filename or url
|
2016-11-03 15:46:04 +01:00
|
|
|
|
2022-11-11 08:53:07 +01:00
|
|
|
def metadata(self, page):
|
|
|
|
extr = text.extract_from(page, page.index("[ FILESIZE <"))
|
|
|
|
size = extr(">", "</span>").replace(" ", "")[:-1]
|
|
|
|
width, _, height = extr(">", " px</span>").partition("x")
|
|
|
|
return {
|
|
|
|
"size" : text.parse_bytes(size),
|
|
|
|
"width" : text.parse_int(width),
|
|
|
|
"height": text.parse_int(height),
|
|
|
|
"hash" : extr(">", "</span>"),
|
|
|
|
}
|
|
|
|
|
2017-02-01 00:53:19 +01:00
|
|
|
|
2023-04-17 20:49:09 +02:00
|
|
|
class ImxtoGalleryExtractor(ImagehostImageExtractor):
|
|
|
|
"""Extractor for image galleries from imx.to"""
|
|
|
|
category = "imxto"
|
|
|
|
subcategory = "gallery"
|
|
|
|
pattern = r"(?:https?://)?(?:www\.)?(imx\.to/g/([^/?#]+))"
|
|
|
|
test = ("https://imx.to/g/ozdy", {
|
|
|
|
"pattern": ImxtoImageExtractor.pattern,
|
|
|
|
"keyword": {"title": "untitled gallery"},
|
|
|
|
"count": 40,
|
|
|
|
})
|
|
|
|
|
|
|
|
def items(self):
|
|
|
|
page = self.request(self.page_url).text
|
|
|
|
title, pos = text.extract(page, '<div class="title', '<')
|
|
|
|
data = {
|
|
|
|
"_extractor": ImxtoImageExtractor,
|
|
|
|
"title": text.unescape(title.partition(">")[2]).strip(),
|
|
|
|
}
|
2023-04-30 15:20:45 +02:00
|
|
|
|
|
|
|
for url in text.extract_iter(page, "<a href=", " ", pos):
|
|
|
|
yield Message.Queue, url.strip("\"'"), data
|
2023-04-17 20:49:09 +02:00
|
|
|
|
|
|
|
|
2018-04-09 15:53:20 +02:00
|
|
|
class AcidimgImageExtractor(ImagehostImageExtractor):
|
2017-09-09 15:17:51 +02:00
|
|
|
"""Extractor for single images from acidimg.cc"""
|
|
|
|
category = "acidimg"
|
2019-02-08 13:45:40 +01:00
|
|
|
pattern = r"(?:https?://)?((?:www\.)?acidimg\.cc/img-([a-z0-9]+)\.html)"
|
2019-02-06 17:37:56 +01:00
|
|
|
test = ("https://acidimg.cc/img-5acb6b9de4640.html", {
|
2018-04-09 15:53:20 +02:00
|
|
|
"url": "f132a630006e8d84f52d59555191ed82b3b64c04",
|
2023-06-03 06:58:33 +02:00
|
|
|
"keyword": "135347ab4345002fc013863c0d9419ba32d98f78",
|
2018-04-09 15:53:20 +02:00
|
|
|
"content": "0c8768055e4e20e7c7259608b67799171b691140",
|
2019-02-06 17:37:56 +01:00
|
|
|
})
|
2023-07-28 14:18:47 +02:00
|
|
|
_params = "simple"
|
|
|
|
_encoding = "utf-8"
|
2018-04-09 15:53:20 +02:00
|
|
|
|
|
|
|
def get_info(self, page):
|
2023-07-28 14:23:11 +02:00
|
|
|
url, pos = text.extract(page, "<img class='centred' src='", "'")
|
2018-04-09 15:53:20 +02:00
|
|
|
if not url:
|
2023-07-28 14:23:11 +02:00
|
|
|
url, pos = text.extract(page, '<img class="centred" src="', '"')
|
|
|
|
if not url:
|
|
|
|
raise exception.NotFoundError("image")
|
|
|
|
|
|
|
|
filename, pos = text.extract(page, "alt='", "'", pos)
|
|
|
|
if not filename:
|
|
|
|
filename, pos = text.extract(page, 'alt="', '"', pos)
|
|
|
|
|
2018-04-09 15:53:20 +02:00
|
|
|
return url, (filename + splitext(url)[1]) if filename else url
|
2017-09-09 15:17:51 +02:00
|
|
|
|
|
|
|
|
2016-11-28 22:30:00 +01:00
|
|
|
class ImagevenueImageExtractor(ImagehostImageExtractor):
|
|
|
|
"""Extractor for single images from imagevenue.com"""
|
|
|
|
category = "imagevenue"
|
2021-07-09 20:13:18 +02:00
|
|
|
pattern = (r"(?:https?://)?((?:www|img\d+)\.imagevenue\.com"
|
|
|
|
r"/([A-Z0-9]{8,10}|view/.*|img\.php\?.*))")
|
|
|
|
test = (
|
|
|
|
("https://www.imagevenue.com/ME13LS07", {
|
|
|
|
"pattern": r"https://cdn-images\.imagevenue\.com"
|
|
|
|
r"/10/ac/05/ME13LS07_o\.png",
|
|
|
|
"keyword": "ae15d6e3b2095f019eee84cd896700cd34b09c36",
|
|
|
|
"content": "cfaa8def53ed1a575e0c665c9d6d8cf2aac7a0ee",
|
|
|
|
}),
|
|
|
|
(("https://www.imagevenue.com/view/o?i=92518_13732377"
|
|
|
|
"annakarina424200712535AM_122_486lo.jpg&h=img150&l=loc486"), {
|
|
|
|
"url": "8bf0254e29250d8f5026c0105bbdda3ee3d84980",
|
|
|
|
}),
|
|
|
|
(("http://img28116.imagevenue.com/img.php"
|
|
|
|
"?image=th_52709_test_122_64lo.jpg"), {
|
|
|
|
"url": "f98e3091df7f48a05fb60fbd86f789fc5ec56331",
|
|
|
|
}),
|
|
|
|
)
|
2016-11-28 22:30:00 +01:00
|
|
|
|
|
|
|
def get_info(self, page):
|
2021-07-09 20:13:18 +02:00
|
|
|
pos = page.index('class="card-body')
|
|
|
|
url, pos = text.extract(page, '<img src="', '"', pos)
|
|
|
|
filename, pos = text.extract(page, 'alt="', '"', pos)
|
|
|
|
return url, text.unescape(filename)
|
2016-11-28 22:30:00 +01:00
|
|
|
|
|
|
|
|
2016-11-04 09:33:38 +01:00
|
|
|
class ImagetwistImageExtractor(ImagehostImageExtractor):
|
|
|
|
"""Extractor for single images from imagetwist.com"""
|
|
|
|
category = "imagetwist"
|
2023-02-06 14:51:57 +01:00
|
|
|
pattern = (r"(?:https?://)?((?:www\.|phun\.)?"
|
|
|
|
r"image(?:twist|haha)\.com/([a-z0-9]{12}))")
|
|
|
|
test = (
|
|
|
|
("https://imagetwist.com/f1i2s4vhvbrq/test.png", {
|
|
|
|
"url": "8d5e168c0bee30211f821c6f3b2116e419d42671",
|
|
|
|
"keyword": "d1060a4c2e3b73b83044e20681712c0ffdd6cfef",
|
|
|
|
"content": "0c8768055e4e20e7c7259608b67799171b691140",
|
|
|
|
}),
|
|
|
|
("https://www.imagetwist.com/f1i2s4vhvbrq/test.png"),
|
|
|
|
("https://phun.imagetwist.com/f1i2s4vhvbrq/test.png"),
|
|
|
|
("https://imagehaha.com/f1i2s4vhvbrq/test.png"),
|
|
|
|
("https://www.imagehaha.com/f1i2s4vhvbrq/test.png"),
|
|
|
|
)
|
2016-11-03 15:46:04 +01:00
|
|
|
|
2017-02-08 22:59:00 +01:00
|
|
|
@property
|
2019-03-14 22:21:49 +01:00
|
|
|
@memcache(maxage=3*3600)
|
2023-07-28 14:18:47 +02:00
|
|
|
def _cookies(self):
|
2019-02-12 10:20:21 +01:00
|
|
|
return self.request(self.page_url).cookies
|
2017-02-08 22:59:00 +01:00
|
|
|
|
2016-11-03 15:46:04 +01:00
|
|
|
def get_info(self, page):
|
2022-12-05 22:15:59 +01:00
|
|
|
url , pos = text.extract(page, '<img src="', '"')
|
2016-11-04 09:33:38 +01:00
|
|
|
filename, pos = text.extract(page, ' alt="', '"', pos)
|
2016-11-03 15:46:04 +01:00
|
|
|
return url, filename
|
|
|
|
|
2016-11-04 09:33:38 +01:00
|
|
|
|
|
|
|
class ImgspiceImageExtractor(ImagehostImageExtractor):
|
|
|
|
"""Extractor for single images from imgspice.com"""
|
|
|
|
category = "imgspice"
|
2020-10-22 23:12:59 +02:00
|
|
|
pattern = r"(?:https?://)?((?:www\.)?imgspice\.com/([^/?#]+))"
|
2019-03-09 20:29:23 +01:00
|
|
|
test = ("https://imgspice.com/nwfwtpyog50y/test.png.html", {
|
|
|
|
"url": "b8c30a8f51ee1012959a4cfd46197fabf14de984",
|
|
|
|
"keyword": "100e310a19a2fa22d87e1bbc427ecb9f6501e0c0",
|
|
|
|
"content": "0c8768055e4e20e7c7259608b67799171b691140",
|
2019-02-06 17:37:56 +01:00
|
|
|
})
|
2016-11-04 09:33:38 +01:00
|
|
|
|
|
|
|
def get_info(self, page):
|
2019-03-09 20:29:23 +01:00
|
|
|
pos = page.find('id="imgpreview"')
|
|
|
|
if pos < 0:
|
|
|
|
raise exception.NotFoundError("image")
|
|
|
|
url , pos = text.extract(page, 'src="', '"', pos)
|
|
|
|
name, pos = text.extract(page, 'alt="', '"', pos)
|
|
|
|
return url, text.unescape(name)
|
2017-03-21 15:47:51 +01:00
|
|
|
|
|
|
|
|
2016-11-09 12:03:14 +01:00
|
|
|
class PixhostImageExtractor(ImagehostImageExtractor):
|
2018-05-23 18:32:34 +02:00
|
|
|
"""Extractor for single images from pixhost.to"""
|
2016-11-09 12:03:14 +01:00
|
|
|
category = "pixhost"
|
2019-02-08 13:45:40 +01:00
|
|
|
pattern = (r"(?:https?://)?((?:www\.)?pixhost\.(?:to|org)"
|
2020-10-22 23:12:59 +02:00
|
|
|
r"/show/\d+/(\d+)_[^/?#]+)")
|
2023-08-24 15:01:26 +02:00
|
|
|
test = ("https://pixhost.to/show/190/130327671_test-.png", {
|
2019-12-18 22:07:09 +01:00
|
|
|
"url": "4e5470dcf6513944773044d40d883221bbc46cff",
|
|
|
|
"keyword": "3bad6d59db42a5ebbd7842c2307e1c3ebd35e6b0",
|
2019-02-06 17:37:56 +01:00
|
|
|
"content": "0c8768055e4e20e7c7259608b67799171b691140",
|
|
|
|
})
|
2023-07-28 14:18:47 +02:00
|
|
|
_cookies = {"pixhostads": "1", "pixhosttest": "1"}
|
2016-11-09 12:03:14 +01:00
|
|
|
|
|
|
|
def get_info(self, page):
|
2017-04-21 13:54:10 +02:00
|
|
|
url , pos = text.extract(page, "class=\"image-img\" src=\"", "\"")
|
|
|
|
filename, pos = text.extract(page, "alt=\"", "\"", pos)
|
2016-12-06 10:03:33 +01:00
|
|
|
return url, filename
|
2016-11-09 12:03:14 +01:00
|
|
|
|
|
|
|
|
2022-12-04 16:19:14 +01:00
|
|
|
class PixhostGalleryExtractor(ImagehostImageExtractor):
|
|
|
|
"""Extractor for image galleries from pixhost.to"""
|
|
|
|
category = "pixhost"
|
|
|
|
subcategory = "gallery"
|
|
|
|
pattern = (r"(?:https?://)?((?:www\.)?pixhost\.(?:to|org)"
|
|
|
|
r"/gallery/([^/?#]+))")
|
|
|
|
test = ("https://pixhost.to/gallery/jSMFq", {
|
|
|
|
"pattern": PixhostImageExtractor.pattern,
|
|
|
|
"count": 3,
|
|
|
|
})
|
|
|
|
|
|
|
|
def items(self):
|
|
|
|
page = text.extr(self.request(
|
|
|
|
self.page_url).text, 'class="images"', "</div>")
|
|
|
|
data = {"_extractor": PixhostImageExtractor}
|
|
|
|
for url in text.extract_iter(page, '<a href="', '"'):
|
|
|
|
yield Message.Queue, url, data
|
|
|
|
|
|
|
|
|
2016-12-06 12:46:41 +01:00
|
|
|
class PostimgImageExtractor(ImagehostImageExtractor):
|
2019-01-30 16:18:22 +01:00
|
|
|
"""Extractor for single images from postimages.org"""
|
2016-12-06 12:46:41 +01:00
|
|
|
category = "postimg"
|
2023-08-24 15:01:26 +02:00
|
|
|
pattern = (r"(?:https?://)?((?:www\.)?(?:postim(?:ages|g)|pixxxels)"
|
|
|
|
r"\.(?:cc|org)/(?!gallery/)(?:image/)?([^/?#]+)/?)")
|
|
|
|
test = (
|
|
|
|
("https://postimages.org/Wtn2b3hC"),
|
|
|
|
("https://www.postimages.org/Wtn2b3hC"),
|
|
|
|
("https://pixxxels.cc/Wtn2b3hC"),
|
|
|
|
("https://postimg.cc/Wtn2b3hC", {
|
|
|
|
"url": "72f3c8b1d6c6601a20ad58f35635494b4891a99e",
|
|
|
|
"keyword": "2d05808d04e4e83e33200db83521af06e3147a84",
|
|
|
|
"content": "cfaa8def53ed1a575e0c665c9d6d8cf2aac7a0ee",
|
|
|
|
}),
|
|
|
|
)
|
2016-12-06 12:46:41 +01:00
|
|
|
|
|
|
|
def get_info(self, page):
|
2023-06-03 06:23:34 +02:00
|
|
|
pos = page.index(' id="download"')
|
|
|
|
url , pos = text.rextract(page, ' href="', '"', pos)
|
2019-02-06 17:37:56 +01:00
|
|
|
filename, pos = text.extract(page, 'class="imagename">', '<', pos)
|
|
|
|
return url, text.unescape(filename)
|
2016-12-06 12:46:41 +01:00
|
|
|
|
|
|
|
|
2023-06-03 06:23:34 +02:00
|
|
|
class PostimgGalleryExtractor(ImagehostImageExtractor):
|
|
|
|
"""Extractor for images galleries from postimages.org"""
|
|
|
|
category = "postimg"
|
|
|
|
subcategory = "gallery"
|
|
|
|
pattern = (r"(?:https?://)?((?:www\.)?(?:postimg|pixxxels)\.(?:cc|org)"
|
|
|
|
r"/(?:gallery/)([^/?#]+)/?)")
|
|
|
|
test = ("https://postimg.cc/gallery/wxpDLgX", {
|
|
|
|
"pattern": PostimgImageExtractor.pattern,
|
|
|
|
"count": 22,
|
|
|
|
})
|
|
|
|
|
|
|
|
def items(self):
|
|
|
|
page = self.request(self.page_url).text
|
|
|
|
data = {"_extractor": PostimgImageExtractor}
|
|
|
|
for url in text.extract_iter(page, ' class="thumb"><a href="', '"'):
|
|
|
|
yield Message.Queue, url, data
|
|
|
|
|
|
|
|
|
2016-11-04 09:33:38 +01:00
|
|
|
class TurboimagehostImageExtractor(ImagehostImageExtractor):
|
2019-02-08 20:08:16 +01:00
|
|
|
"""Extractor for single images from www.turboimagehost.com"""
|
2016-11-04 09:33:38 +01:00
|
|
|
category = "turboimagehost"
|
2019-02-08 13:45:40 +01:00
|
|
|
pattern = (r"(?:https?://)?((?:www\.)?turboimagehost\.com"
|
2020-10-22 23:12:59 +02:00
|
|
|
r"/p/(\d+)/[^/?#]+\.html)")
|
2019-02-06 17:37:56 +01:00
|
|
|
test = ("https://www.turboimagehost.com/p/39078423/test--.png.html", {
|
2018-08-02 14:51:51 +02:00
|
|
|
"url": "b94de43612318771ced924cb5085976f13b3b90e",
|
2019-02-14 16:07:17 +01:00
|
|
|
"keyword": "704757ca8825f51cec516ec44c1e627c1f2058ca",
|
2023-07-28 14:18:47 +02:00
|
|
|
"content": "f38b54b17cd7462e687b58d83f00fca88b1b105a",
|
2019-02-06 17:37:56 +01:00
|
|
|
})
|
2016-11-04 09:33:38 +01:00
|
|
|
|
|
|
|
def get_info(self, page):
|
2018-10-23 21:01:51 +02:00
|
|
|
url = text.extract(page, 'src="', '"', page.index("<img "))[0]
|
2016-11-04 09:33:38 +01:00
|
|
|
return url, url
|
2021-01-20 21:38:43 +01:00
|
|
|
|
|
|
|
|
|
|
|
class ViprImageExtractor(ImagehostImageExtractor):
|
|
|
|
"""Extractor for single images from vipr.im"""
|
|
|
|
category = "vipr"
|
2021-01-20 21:40:04 +01:00
|
|
|
pattern = r"(?:https?://)?(vipr\.im/(\w+))"
|
|
|
|
test = ("https://vipr.im/kcd5jcuhgs3v.html", {
|
|
|
|
"url": "88f6a3ecbf3356a11ae0868b518c60800e070202",
|
|
|
|
"keyword": "c432e8a1836b0d97045195b745731c2b1bb0e771",
|
|
|
|
})
|
2021-01-20 21:38:43 +01:00
|
|
|
|
|
|
|
def get_info(self, page):
|
2022-11-04 23:39:38 +01:00
|
|
|
url = text.extr(page, '<img src="', '"')
|
2021-01-20 21:38:43 +01:00
|
|
|
return url, url
|
2021-02-10 17:22:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
class ImgclickImageExtractor(ImagehostImageExtractor):
|
|
|
|
"""Extractor for single images from imgclick.net"""
|
|
|
|
category = "imgclick"
|
|
|
|
pattern = r"(?:https?://)?((?:www\.)?imgclick\.net/([^/?#]+))"
|
|
|
|
test = ("http://imgclick.net/4tbrre1oxew9/test-_-_.png.html", {
|
2021-03-18 23:28:07 +01:00
|
|
|
"url": "140dcb250a325f2d26b2d918c18b8ac6a2a0f6ab",
|
2021-02-10 17:22:12 +01:00
|
|
|
"keyword": "6895256143eab955622fc149aa367777a8815ba3",
|
|
|
|
"content": "0c8768055e4e20e7c7259608b67799171b691140",
|
|
|
|
})
|
2023-07-28 14:18:47 +02:00
|
|
|
_https = False
|
|
|
|
_params = "complex"
|
2021-02-10 17:22:12 +01:00
|
|
|
|
|
|
|
def get_info(self, page):
|
|
|
|
url , pos = text.extract(page, '<br><img src="', '"')
|
|
|
|
filename, pos = text.extract(page, 'alt="', '"', pos)
|
|
|
|
return url, filename
|
2021-09-28 23:35:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
class FappicImageExtractor(ImagehostImageExtractor):
|
|
|
|
"""Extractor for single images from fappic.com"""
|
|
|
|
category = "fappic"
|
|
|
|
pattern = r"(?:https?://)?((?:www\.)?fappic\.com/(\w+)/[^/?#]+)"
|
2023-08-24 15:01:26 +02:00
|
|
|
test = (
|
|
|
|
("https://fappic.com/98wxqcklyh8k/test.png"),
|
|
|
|
("https://www.fappic.com/98wxqcklyh8k/test.png", {
|
|
|
|
"pattern": r"https://img\d+\.fappic\.com/img/\w+/test\.png",
|
|
|
|
"keyword": "433b1d310b0ff12ad8a71ac7b9d8ba3f8cd1e898",
|
|
|
|
"content": "0c8768055e4e20e7c7259608b67799171b691140",
|
|
|
|
}),
|
|
|
|
)
|
2021-09-28 23:35:29 +02:00
|
|
|
|
|
|
|
def get_info(self, page):
|
2022-10-01 12:19:33 +02:00
|
|
|
url , pos = text.extract(page, '<a href="#"><img src="', '"')
|
2021-09-28 23:35:29 +02:00
|
|
|
filename, pos = text.extract(page, 'alt="', '"', pos)
|
|
|
|
|
|
|
|
if filename.startswith("Porn-Picture-"):
|
|
|
|
filename = filename[13:]
|
|
|
|
|
|
|
|
return url, filename
|