Skip to content

Commit

Permalink
[imgclick] add 'image' extractor (closes #1307)
Browse files Browse the repository at this point in the history
basically reverts b0e8daf
  • Loading branch information
mikf committed Feb 10, 2021
1 parent fc78210 commit 95a66bd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/supportedsites.rst
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ Yandere https://yande.re/ Pools, Popular Images,
Acidimg https://acidimg.cc/ individual Images
Imagetwist https://imagetwist.com/ individual Images
Imagevenue http://imagevenue.com/ individual Images
Imgclick https://imgclick.net/ individual Images
Imgspice https://imgspice.com/ individual Images
Imxto https://imx.to/ individual Images
Pixhost https://pixhost.to/ individual Images
Expand Down
20 changes: 19 additions & 1 deletion gallery_dl/extractor/imagehosts.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

# Copyright 2016-2020 Mike Fährmann
# Copyright 2016-2021 Mike Fährmann
#
# 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
Expand Down Expand Up @@ -265,3 +265,21 @@ class ViprImageExtractor(ImagehostImageExtractor):
def get_info(self, page):
url = text.extract(page, '<img src="', '"')[0]
return url, url


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", {
"url": "b967f2d372ffb9f5d3a927c6dd560e120b10a808",
"keyword": "6895256143eab955622fc149aa367777a8815ba3",
"content": "0c8768055e4e20e7c7259608b67799171b691140",
})
https = True
params = "complex"

def get_info(self, page):
url , pos = text.extract(page, '<br><img src="', '"')
filename, pos = text.extract(page, 'alt="', '"', pos)
return url, filename

0 comments on commit 95a66bd

Please sign in to comment.