[kissmanga] workaround for CAPTCHAs (fixes #818)
Requesting the same page again when being redirected to a CAPTCHA lets us access that page without solving it.
This commit is contained in:
@@ -9,9 +9,10 @@
|
|||||||
"""Extract manga-chapters and entire manga from https://kissmanga.com/"""
|
"""Extract manga-chapters and entire manga from https://kissmanga.com/"""
|
||||||
|
|
||||||
from .common import ChapterExtractor, MangaExtractor, Extractor
|
from .common import ChapterExtractor, MangaExtractor, Extractor
|
||||||
from .. import text, aes, exception
|
from .. import text, aes
|
||||||
from ..cache import cache
|
from ..cache import cache
|
||||||
import hashlib
|
import hashlib
|
||||||
|
import time
|
||||||
import ast
|
import ast
|
||||||
import re
|
import re
|
||||||
|
|
||||||
@@ -24,18 +25,7 @@ class RedirectMixin():
|
|||||||
response = Extractor.request(self, url, **kwargs)
|
response = Extractor.request(self, url, **kwargs)
|
||||||
if not response.history or "/AreYouHuman" not in response.url:
|
if not response.history or "/AreYouHuman" not in response.url:
|
||||||
return response
|
return response
|
||||||
if self.config("captcha", "stop") == "wait":
|
time.sleep(2)
|
||||||
self.log.warning(
|
|
||||||
"Redirect to \n%s\nVisit this URL in your browser, solve "
|
|
||||||
"the CAPTCHA, and press ENTER to continue", response.url)
|
|
||||||
try:
|
|
||||||
input()
|
|
||||||
except (EOFError, OSError):
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
raise exception.StopExtraction(
|
|
||||||
"Redirect to \n%s\nVisit this URL in your browser and "
|
|
||||||
"solve the CAPTCHA to continue", response.url)
|
|
||||||
|
|
||||||
|
|
||||||
class KissmangaBase(RedirectMixin):
|
class KissmangaBase(RedirectMixin):
|
||||||
|
|||||||
Reference in New Issue
Block a user