KoD 0.5.1

-override DNS di default
-nuovi canali: streamtime e netfreex
-fixato cloudflare
-aggiunta opzione apri nel browser
This commit is contained in:
marco
2019-11-30 20:27:09 +01:00
parent 4332859f47
commit daad0d3ddb
176 changed files with 31086 additions and 13812 deletions

22
lib/cloudscraper/reCaptcha/__init__.py Normal file → Executable file
View File

@@ -1,4 +1,3 @@
import re
import sys
import logging
import abc
@@ -8,20 +7,20 @@ if sys.version_info >= (3, 4):
else:
ABC = abc.ABCMeta('ABC', (), {})
##########################################################################################################################################################
BUG_REPORT = 'Cloudflare may have changed their technique, or there may be a bug in the script.'
##########################################################################################################################################################
# ------------------------------------------------------------------------------- #
captchaSolvers = {}
# ------------------------------------------------------------------------------- #
class reCaptcha(ABC):
@abc.abstractmethod
def __init__(self, name):
captchaSolvers[name] = self
# ------------------------------------------------------------------------------- #
@classmethod
def dynamicImport(cls, name):
if name not in captchaSolvers:
@@ -35,14 +34,13 @@ class reCaptcha(ABC):
return captchaSolvers[name]
# ------------------------------------------------------------------------------- #
@abc.abstractmethod
def getCaptchaAnswer(self, site_url, site_key, reCaptchaParams):
pass
def solveCaptcha(self, ret, reCaptchaParams):
try:
site_key = re.search('data-sitekey="(.+?)"', ret.text).group(1)
except Exception as e:
raise ValueError("Unable to parse Cloudflare\'s reCaptcha variable 'data-sitekey': {} {}".format(e.message, BUG_REPORT))
# ------------------------------------------------------------------------------- #
return self.getCaptchaAnswer(ret.url, site_key, reCaptchaParams)
def solveCaptcha(self, site_url, site_key, reCaptchaParams):
return self.getCaptchaAnswer(site_url, site_key, reCaptchaParams)