1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-23 03:02:50 +01:00

[readcomiconline] detect 'AreYouHuman' redirects (#279)

This commit is contained in:
Mike Fährmann 2019-05-26 15:53:24 +02:00
parent 1cde38110d
commit 48233f00c0
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
3 changed files with 16 additions and 8 deletions

View File

@ -24,10 +24,10 @@ class KissmangaBase():
def request(self, url): def request(self, url):
response = super().request(url) response = super().request(url)
if response.history and "/Message/AreYouHuman?" in response.url: if response.history and "/AreYouHuman" in response.url:
self.log.error("Requesting too many pages caused a redirect to %s." self.log.error("Redirect to \n%s\n"
" Try visiting this URL in your browser and solve" "Visit this URL in your browser and solve "
" the CAPTCHA to continue.", response.url) "the CAPTCHA to continue.", response.url)
raise exception.StopExtraction() raise exception.StopExtraction()
return response return response

View File

@ -9,7 +9,7 @@
"""Extract comic-issues and entire comics from https://readcomiconline.to/""" """Extract comic-issues and entire comics from https://readcomiconline.to/"""
from .common import ChapterExtractor, MangaExtractor from .common import ChapterExtractor, MangaExtractor
from .. import text from .. import text, exception
import re import re
@ -21,6 +21,15 @@ class ReadcomiconlineBase():
archive_fmt = "{issue_id}_{page}" archive_fmt = "{issue_id}_{page}"
root = "https://readcomiconline.to" root = "https://readcomiconline.to"
def request(self, url):
response = super().request(url)
if response.history and "/AreYouHuman" in response.url:
self.log.error("Redirect to \n%s\n"
"Visit this URL in your browser and solve "
"the CAPTCHA to continue.", response.url)
raise exception.StopExtraction()
return response
class ReadcomiconlineIssueExtractor(ReadcomiconlineBase, ChapterExtractor): class ReadcomiconlineIssueExtractor(ReadcomiconlineBase, ChapterExtractor):
"""Extractor for comic-issues from readcomiconline.to""" """Extractor for comic-issues from readcomiconline.to"""
@ -49,7 +58,6 @@ class ReadcomiconlineIssueExtractor(ReadcomiconlineBase, ChapterExtractor):
} }
def images(self, page): def images(self, page):
self.session.headers["Referer"] = None
return [ return [
(url, None) (url, None)
for url in text.extract_iter( for url in text.extract_iter(

View File

@ -111,13 +111,13 @@ class SmugmugImageExtractor(SmugmugExtractor):
test = ( test = (
("https://acapella.smugmug.com/Micro-Macro/Drops/i-g2Dmf9z", { ("https://acapella.smugmug.com/Micro-Macro/Drops/i-g2Dmf9z", {
"url": "78f0bf3516b6d670b7319216bdeccb35942ca4cf", "url": "78f0bf3516b6d670b7319216bdeccb35942ca4cf",
"keyword": "008a29d6e90729ef7639617db6c049ecb1d0ab54", "keyword": "b298ef7ed2b1918263b6a7dc6f56e54401584381",
"content": "64a8f69a1d824921eebbdf2420087937adfa45cd", "content": "64a8f69a1d824921eebbdf2420087937adfa45cd",
}), }),
# video # video
("https://tstravels.smugmug.com/Dailies/Daily-Dose-2015/i-39JFNzB", { ("https://tstravels.smugmug.com/Dailies/Daily-Dose-2015/i-39JFNzB", {
"url": "04d0ab1ff829ca7d78f5acb5548953df08e9a5ee", "url": "04d0ab1ff829ca7d78f5acb5548953df08e9a5ee",
"keyword": "cafec30861ac7569b12a2a6b671b4b5ce273b370", "keyword": "c708c4b9527a2fb29396c19f7628f9cf4b0b3a39",
}), }),
) )