Skip to content

Commit

Permalink
[kissmanga] workaround for CAPTCHAs (fixes #818)
Browse files Browse the repository at this point in the history
Requesting the same page again when being redirected to a CAPTCHA
lets us access that page without solving it.
  • Loading branch information
mikf committed Jun 11, 2020
1 parent 7daef6e commit 4cf3d54
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions gallery_dl/extractor/kissmanga.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
"""Extract manga-chapters and entire manga from https://kissmanga.com/"""

from .common import ChapterExtractor, MangaExtractor, Extractor
from .. import text, aes, exception
from .. import text, aes
from ..cache import cache
import hashlib
import time
import ast
import re

Expand All @@ -24,18 +25,7 @@ def request(self, url, **kwargs):
response = Extractor.request(self, url, **kwargs)
if not response.history or "/AreYouHuman" not in response.url:
return response
if self.config("captcha", "stop") == "wait":
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)
time.sleep(2)


class KissmangaBase(RedirectMixin):
Expand Down

0 comments on commit 4cf3d54

Please sign in to comment.