[imagevenue] add extractor
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
from .common import Extractor, Message
|
from .common import Extractor, Message
|
||||||
from .. import text
|
from .. import text
|
||||||
from os.path import splitext
|
from os.path import splitext
|
||||||
|
from urllib.parse import urljoin
|
||||||
|
|
||||||
class ImagehostImageExtractor(Extractor):
|
class ImagehostImageExtractor(Extractor):
|
||||||
"""Base class for single-image extractors for various imagehosts"""
|
"""Base class for single-image extractors for various imagehosts"""
|
||||||
@@ -181,6 +182,19 @@ class ImgtrialImageExtractor(ImgspotImageExtractor):
|
|||||||
pattern = [r"(?:https?://)?((?:www\.)?imgtrial\.com/img-([a-z0-9]+)\.html)"]
|
pattern = [r"(?:https?://)?((?:www\.)?imgtrial\.com/img-([a-z0-9]+)\.html)"]
|
||||||
|
|
||||||
|
|
||||||
|
class ImagevenueImageExtractor(ImagehostImageExtractor):
|
||||||
|
"""Extractor for single images from imagevenue.com"""
|
||||||
|
category = "imagevenue"
|
||||||
|
pattern = [(r"(?:https?://)?(img\d+\.imagevenue\.com/"
|
||||||
|
r"img\.php\?image=(\d+)_.+)")]
|
||||||
|
params = None
|
||||||
|
|
||||||
|
def get_info(self, page):
|
||||||
|
url = text.extract(page, 'SRC="', '"')[0]
|
||||||
|
url = urljoin(self.url, url)
|
||||||
|
return url, url
|
||||||
|
|
||||||
|
|
||||||
class ImagetwistImageExtractor(ImagehostImageExtractor):
|
class ImagetwistImageExtractor(ImagehostImageExtractor):
|
||||||
"""Extractor for single images from imagetwist.com"""
|
"""Extractor for single images from imagetwist.com"""
|
||||||
category = "imagetwist"
|
category = "imagetwist"
|
||||||
|
|||||||
Reference in New Issue
Block a user