From 97c12e3f11fc74ccc5ea7f5c8ed0e9547004dd03 Mon Sep 17 00:00:00 2001 From: marco Date: Wed, 25 Mar 2020 19:50:30 +0100 Subject: [PATCH] aggiornati cloudscraper e i link dei canali, fixato guardaserie --- channels.json | 16 +++--- core/support.py | 2 +- lib/cloudscraper/__init__.py | 34 +++++++------ lib/cloudscraper/exceptions/__init__.py | 0 .../exceptions/cloudflare_exceptions.py | 31 ------------ .../exceptions/reCaptcha_exceptions.py | 49 ------------------- lib/cloudscraper/reCaptcha/2captcha.py | 35 +++++++------ lib/cloudscraper/reCaptcha/9kw.py | 29 ++++++----- lib/cloudscraper/reCaptcha/__init__.py | 4 +- lib/cloudscraper/reCaptcha/anticaptcha.py | 19 +++---- lib/cloudscraper/reCaptcha/deathbycaptcha.py | 36 ++++++++------ lib/cloudscraper/user_agent/__init__.py | 4 +- lib/cloudscraper/user_agent/browsers.json | 2 - lib/unshortenit.py | 13 ++--- 14 files changed, 108 insertions(+), 166 deletions(-) delete mode 100644 lib/cloudscraper/exceptions/__init__.py delete mode 100644 lib/cloudscraper/exceptions/cloudflare_exceptions.py delete mode 100644 lib/cloudscraper/exceptions/reCaptcha_exceptions.py diff --git a/channels.json b/channels.json index bff44cba..0db9d177 100644 --- a/channels.json +++ b/channels.json @@ -17,22 +17,22 @@ "dreamsub": "https://dreamsub.stream", "dsda": "https://www.dsda.press/", "fastsubita": "https://fastsubita.online", - "filmgratis": "https://www.filmaltadefinizione.org", + "filmgratis": "https://www.filmaltadefinizione.tv", "filmigratis": "https://filmigratis.org", - "filmsenzalimiticc": "https://www.filmsenzalimiti.tech", + "filmsenzalimiticc": "https://www.filmsenzalimiti.website", "filmstreaming01": "https://filmstreaming01.com", "guardaserie_stream": "https://guardaserie.store", - "guardaserieclick": "https://www.guardaserie.media", - "ilgeniodellostreaming": "https://ilgeniodellostreaming.ch", + "guardaserieclick": "https://www.guardaserie.productions", + "ilgeniodellostreaming": "https://ilgeniodellostreaming.pl", "italiaserie": "https://italiaserie.org", "mondoserietv": "https://mondoserietv.com", "netfreex": "https://www.netfreex.pro", - "piratestreaming": "https://www.piratestreaming.digital", - "polpotv": "https://polpo.tv", + "piratestreaming": "https://www.piratestreaming.group", + "polpotv": "https://polpotv.club", "pufimovies": "https://pufimovies.com", "raiplay": "https://www.raiplay.it", - "seriehd": "https://www.seriehd.live", - "serietvonline": "https://serietvonline.kim", + "seriehd": "https://seriehd.life", + "serietvonline": "https://serietvonline.casa", "serietvsubita": "http://serietvsubita.xyz", "serietvu": "https://www.serietvu.link", "streamtime": "https://t.me/s/StreamTime", diff --git a/core/support.py b/core/support.py index 602232da..d64fd48c 100755 --- a/core/support.py +++ b/core/support.py @@ -61,7 +61,7 @@ def hdpass_get_servers(item): url = url.replace("&download=1", "") if 'hdpass' not in url and 'hdplayer' not in url: return itemlist - if 'http' not in url: + if not url.startswith('http'): url = 'https:' + url data = httptools.downloadpage(url).data diff --git a/lib/cloudscraper/__init__.py b/lib/cloudscraper/__init__.py index 1b57f325..a899b145 100644 --- a/lib/cloudscraper/__init__.py +++ b/lib/cloudscraper/__init__.py @@ -1,6 +1,4 @@ -# https://github.com/VeNoMouS/cloudscraper/tree/master import logging -import os import re import sys import ssl @@ -26,6 +24,14 @@ from collections import OrderedDict from requests.sessions import Session from requests.adapters import HTTPAdapter +from .exceptions import ( + CloudflareLoopProtection, + CloudflareCode1020, + CloudflareIUAMError, + CloudflareReCaptchaError, + CloudflareReCaptchaProvider +) + from .interpreters import JavaScriptInterpreter from .reCaptcha import reCaptcha from .user_agent import User_Agent @@ -45,13 +51,10 @@ try: except ImportError: from urllib.parse import urlparse, urljoin -# Add exceptions path -sys.path.append(os.path.join(os.path.dirname(__file__), 'exceptions')) -import cloudflare_exceptions # noqa: E402 # ------------------------------------------------------------------------------- # -__version__ = '1.2.24' +__version__ = '1.2.30' # ------------------------------------------------------------------------------- # @@ -215,10 +218,10 @@ class CloudScraper(Session): # ------------------------------------------------------------------------------- # if self._solveDepthCnt >= self.solveDepth: - sys.tracebacklimit = 0 _ = self._solveDepthCnt self._solveDepthCnt = 0 - raise cloudflare_exceptions.Cloudflare_Loop_Protection( + sys.tracebacklimit = 0 + raise CloudflareLoopProtection( "!!Loop Protection!! We have tried to solve {} time(s) in a row.".format(_) ) @@ -301,7 +304,7 @@ class CloudScraper(Session): def is_Challenge_Request(self, resp): if self.is_Firewall_Blocked(resp): sys.tracebacklimit = 0 - raise cloudflare_exceptions.Cloudflare_Block('Cloudflare has blocked this request (Code 1020 Detected).') + raise CloudflareCode1020('Cloudflare has blocked this request (Code 1020 Detected).') if self.is_reCaptcha_Challenge(resp) or self.is_IUAM_Challenge(resp): return True @@ -323,7 +326,7 @@ class CloudScraper(Session): except AttributeError: sys.tracebacklimit = 0 - raise cloudflare_exceptions.Cloudflare_Error_IUAM( + raise CloudflareIUAMError( "Cloudflare IUAM detected, unfortunately we can't extract the parameters correctly." ) @@ -334,7 +337,8 @@ class CloudScraper(Session): interpreter ).solveChallenge(body, hostParsed.netloc) except Exception as e: - raise cloudflare_exceptions.Cloudflare_Error_IUAM( + sys.tracebacklimit = 0 + raise CloudflareIUAMError( 'Unable to parse Cloudflare anti-bots page: {}'.format( getattr(e, 'message', e) ) @@ -362,7 +366,7 @@ class CloudScraper(Session): ).groupdict() except (AttributeError): sys.tracebacklimit = 0 - raise cloudflare_exceptions.Cloudflare_Error_reCaptcha( + raise CloudflareReCaptchaError( "Cloudflare reCaptcha detected, unfortunately we can't extract the parameters correctly." ) @@ -409,7 +413,7 @@ class CloudScraper(Session): if not self.recaptcha or not isinstance(self.recaptcha, dict) or not self.recaptcha.get('provider'): sys.tracebacklimit = 0 - raise cloudflare_exceptions.Cloudflare_reCaptcha_Provider( + raise CloudflareReCaptchaProvider( "Cloudflare reCaptcha detected, unfortunately you haven't loaded an anti reCaptcha provider " "correctly via the 'recaptcha' parameter." ) @@ -445,7 +449,7 @@ class CloudScraper(Session): self.delay = delay except (AttributeError, ValueError): sys.tracebacklimit = 0 - raise cloudflare_exceptions.Cloudflare_Error_IUAM("Cloudflare IUAM possibility malformed, issue extracing delay value.") + raise CloudflareIUAMError("Cloudflare IUAM possibility malformed, issue extracing delay value.") sleep(self.delay) @@ -584,7 +588,7 @@ class CloudScraper(Session): break else: sys.tracebacklimit = 0 - raise cloudflare_exceptions.Cloudflare_Error_IUAM( + raise CloudflareIUAMError( "Unable to find Cloudflare cookies. Does the site actually " "have Cloudflare IUAM (I'm Under Attack Mode) enabled?" ) diff --git a/lib/cloudscraper/exceptions/__init__.py b/lib/cloudscraper/exceptions/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/cloudscraper/exceptions/cloudflare_exceptions.py b/lib/cloudscraper/exceptions/cloudflare_exceptions.py deleted file mode 100644 index e7a25e16..00000000 --- a/lib/cloudscraper/exceptions/cloudflare_exceptions.py +++ /dev/null @@ -1,31 +0,0 @@ -# ------------------------------------------------------------------------------- # - - -class Cloudflare_Loop_Protection(Exception): - """ - Raise error for recursive depth protection - """ - - -class Cloudflare_Block(Exception): - """ - Raise error for Cloudflare 1020 block - """ - - -class Cloudflare_Error_IUAM(Exception): - """ - Raise error for problem extracting IUAM paramters from Cloudflare payload - """ - - -class Cloudflare_Error_reCaptcha(Exception): - """ - Raise error for problem extracting reCaptcha paramters from Cloudflare payload - """ - - -class Cloudflare_reCaptcha_Provider(Exception): - """ - Raise error for reCaptcha from Cloudflare, no provider loaded. - """ diff --git a/lib/cloudscraper/exceptions/reCaptcha_exceptions.py b/lib/cloudscraper/exceptions/reCaptcha_exceptions.py deleted file mode 100644 index 4a263d1d..00000000 --- a/lib/cloudscraper/exceptions/reCaptcha_exceptions.py +++ /dev/null @@ -1,49 +0,0 @@ -# ------------------------------------------------------------------------------- # - - -class reCaptcha_Service_Unavailable(Exception): - """ - Raise error for external services that cannot be reached - """ - - -class reCaptcha_Error_From_API(Exception): - """ - Raise error for error from API response. - """ - - -class reCaptcha_Account_Error(Exception): - """ - Raise error for reCaptcha provider account problem. - """ - - -class reCaptcha_Timeout(Exception): - """ - Raise error for reCaptcha provider taking too long. - """ - - -class reCaptcha_Bad_Parameter(NotImplementedError): - """ - Raise error for bad or missing Parameter. - """ - - -class reCaptcha_Bad_Job_ID(Exception): - """ - Raise error for invalid job id. - """ - - -class reCaptcha_Report_Error(Exception): - """ - Raise error for reCaptcha provider unable to report bad solve. - """ - - -class reCaptcha_Import_Error(Exception): - """ - Raise error for reCaptcha, cannot import a module. - """ diff --git a/lib/cloudscraper/reCaptcha/2captcha.py b/lib/cloudscraper/reCaptcha/2captcha.py index 8a787d0e..b3a71fb9 100644 --- a/lib/cloudscraper/reCaptcha/2captcha.py +++ b/lib/cloudscraper/reCaptcha/2captcha.py @@ -1,14 +1,21 @@ from __future__ import absolute_import import requests -import reCaptcha_exceptions + + +from ..exceptions import ( + reCaptchaServiceUnavailable, + reCaptchaAPIError, + reCaptchaTimeout, + reCaptchaParameter, + reCaptchaBadJobID, + reCaptchaReportError +) try: import polling except ImportError: - import sys - sys.tracebacklimit = 0 - raise reCaptcha_exceptions.reCaptcha_Import_Error( + raise ImportError( "Please install the python module 'polling' via pip or download it from " "https://github.com/justiniso/polling/" ) @@ -28,7 +35,7 @@ class captchaSolver(reCaptcha): @staticmethod def checkErrorStatus(response, request_type): if response.status_code in [500, 502]: - raise reCaptcha_exceptions.reCaptcha_Service_Unavailable('2Captcha: Server Side Error {}'.format(response.status_code)) + raise reCaptchaServiceUnavailable('2Captcha: Server Side Error {}'.format(response.status_code)) errors = { 'in.php': { @@ -75,7 +82,7 @@ class captchaSolver(reCaptcha): } if response.json().get('status') is False and response.json().get('request') in errors.get(request_type): - raise reCaptcha_exceptions.reCaptcha_Error_From_API( + raise reCaptchaAPIError( '{} {}'.format( response.json().get('request'), errors.get(request_type).get(response.json().get('request')) @@ -86,7 +93,7 @@ class captchaSolver(reCaptcha): def reportJob(self, jobID): if not jobID: - raise reCaptcha_exceptions.reCaptcha_Bad_Job_ID( + raise reCaptchaBadJobID( "2Captcha: Error bad job id to request reCaptcha." ) @@ -116,7 +123,7 @@ class captchaSolver(reCaptcha): if response: return True else: - raise reCaptcha_exceptions.reCaptcha_Report_Error( + raise reCaptchaReportError( "2Captcha: Error - Failed to report bad reCaptcha solve." ) @@ -124,7 +131,7 @@ class captchaSolver(reCaptcha): def requestJob(self, jobID): if not jobID: - raise RuntimeError("2Captcha: Error bad job id to request reCaptcha.") + raise reCaptchaBadJobID("2Captcha: Error bad job id to request reCaptcha.") def _checkRequest(response): if response.ok and response.json().get('status') == 1: @@ -152,7 +159,7 @@ class captchaSolver(reCaptcha): if response: return response.json().get('request') else: - raise reCaptcha_exceptions.reCaptcha_Timeout( + raise reCaptchaTimeout( "2Captcha: Error failed to solve reCaptcha." ) @@ -188,7 +195,7 @@ class captchaSolver(reCaptcha): if response: return response.json().get('request') else: - raise reCaptcha_exceptions.reCaptcha_Bad_Job_ID( + raise reCaptchaBadJobID( '2Captcha: Error no job id was returned.' ) @@ -198,7 +205,7 @@ class captchaSolver(reCaptcha): jobID = None if not reCaptchaParams.get('api_key'): - raise reCaptcha_exceptions.reCaptcha_Bad_Parameter( + raise reCaptchaParameter( "2Captcha: Missing api_key parameter." ) @@ -215,11 +222,11 @@ class captchaSolver(reCaptcha): if jobID: self.reportJob(jobID) except polling.TimeoutException: - raise reCaptcha_exceptions.reCaptcha_Timeout( + raise reCaptchaTimeout( "2Captcha: reCaptcha solve took to long and also failed reporting the job the job id {}.".format(jobID) ) - raise reCaptcha_exceptions.reCaptcha_Timeout( + raise reCaptchaTimeout( "2Captcha: reCaptcha solve took to long to execute job id {}, aborting.".format(jobID) ) diff --git a/lib/cloudscraper/reCaptcha/9kw.py b/lib/cloudscraper/reCaptcha/9kw.py index d887cf80..212b44d8 100644 --- a/lib/cloudscraper/reCaptcha/9kw.py +++ b/lib/cloudscraper/reCaptcha/9kw.py @@ -2,18 +2,23 @@ from __future__ import absolute_import import re import requests -import reCaptcha_exceptions try: import polling except ImportError: - import sys - sys.tracebacklimit = 0 - raise reCaptcha_exceptions.reCaptcha_Import_Error( + raise ImportError( "Please install the python module 'polling' via pip or download it from " "https://github.com/justiniso/polling/" ) +from ..exceptions import ( + reCaptchaServiceUnavailable, + reCaptchaAPIError, + reCaptchaTimeout, + reCaptchaParameter, + reCaptchaBadJobID +) + from . import reCaptcha @@ -30,7 +35,7 @@ class captchaSolver(reCaptcha): @staticmethod def checkErrorStatus(response): if response.status_code in [500, 502]: - raise reCaptcha_exceptions.reCaptcha_Service_Unavailable( + raise reCaptchaServiceUnavailable( '9kw: Server Side Error {}'.format(response.status_code) ) @@ -93,17 +98,17 @@ class captchaSolver(reCaptcha): if response.text.startswith('{'): if response.json().get('error'): - raise reCaptcha_exceptions.reCaptcha_Error_From_API(error_codes.get(int(response.json().get('error')))) + raise reCaptchaAPIError(error_codes.get(int(response.json().get('error')))) else: error_code = int(re.search(r'^00(?P\d+)', response.text).groupdict().get('error_code', 0)) if error_code: - raise reCaptcha_exceptions.reCaptcha_Error_From_API(error_codes.get(error_code)) + raise reCaptchaAPIError(error_codes.get(error_code)) # ------------------------------------------------------------------------------- # def requestJob(self, jobID): if not jobID: - raise reCaptcha_exceptions.reCaptcha_Bad_Job_ID( + raise reCaptchaBadJobID( "9kw: Error bad job id to request reCaptcha against." ) @@ -134,7 +139,7 @@ class captchaSolver(reCaptcha): if response: return response.json().get('answer') else: - raise reCaptcha_exceptions.reCaptcha_Timeout("9kw: Error failed to solve reCaptcha.") + raise reCaptchaTimeout("9kw: Error failed to solve reCaptcha.") # ------------------------------------------------------------------------------- # @@ -170,7 +175,7 @@ class captchaSolver(reCaptcha): if response: return response.json().get('captchaid') else: - raise reCaptcha_exceptions.reCaptcha_Bad_Job_ID('9kw: Error no valid job id was returned.') + raise reCaptchaBadJobID('9kw: Error no valid job id was returned.') # ------------------------------------------------------------------------------- # @@ -178,7 +183,7 @@ class captchaSolver(reCaptcha): jobID = None if not reCaptchaParams.get('api_key'): - raise reCaptcha_exceptions.reCaptcha_Bad_Parameter("9kw: Missing api_key parameter.") + raise reCaptchaParameter("9kw: Missing api_key parameter.") self.api_key = reCaptchaParams.get('api_key') @@ -192,7 +197,7 @@ class captchaSolver(reCaptcha): jobID = self.requestSolve(site_url, site_key) return self.requestJob(jobID) except polling.TimeoutException: - raise reCaptcha_exceptions.reCaptcha_Timeout( + raise reCaptchaTimeout( "9kw: reCaptcha solve took to long to execute 'captchaid' {}, aborting.".format(jobID) ) diff --git a/lib/cloudscraper/reCaptcha/__init__.py b/lib/cloudscraper/reCaptcha/__init__.py index b9e236b8..dee27fcf 100644 --- a/lib/cloudscraper/reCaptcha/__init__.py +++ b/lib/cloudscraper/reCaptcha/__init__.py @@ -1,6 +1,6 @@ -import sys -import logging import abc +import logging +import sys if sys.version_info >= (3, 4): ABC = abc.ABC # noqa diff --git a/lib/cloudscraper/reCaptcha/anticaptcha.py b/lib/cloudscraper/reCaptcha/anticaptcha.py index 15993f86..c6cae275 100644 --- a/lib/cloudscraper/reCaptcha/anticaptcha.py +++ b/lib/cloudscraper/reCaptcha/anticaptcha.py @@ -1,13 +1,14 @@ from __future__ import absolute_import -import sys -import reCaptcha_exceptions +from ..exceptions import reCaptchaParameter try: - from python_anticaptcha import AnticaptchaClient, NoCaptchaTaskProxylessTask + from python_anticaptcha import ( + AnticaptchaClient, + NoCaptchaTaskProxylessTask + ) except ImportError: - sys.tracebacklimit = 0 - raise reCaptcha_exceptions.reCaptcha_Import_Error( + raise ImportError( "Please install the python module 'python_anticaptcha' via pip or download it from " "https://github.com/ad-m/python-anticaptcha" ) @@ -24,7 +25,7 @@ class captchaSolver(reCaptcha): def getCaptchaAnswer(self, site_url, site_key, reCaptchaParams): if not reCaptchaParams.get('api_key'): - raise reCaptcha_exceptions.reCaptcha_Bad_Parameter("anticaptcha: Missing api_key parameter.") + raise reCaptchaParameter("anticaptcha: Missing api_key parameter.") client = AnticaptchaClient(reCaptchaParams.get('api_key')) @@ -34,9 +35,9 @@ class captchaSolver(reCaptcha): task = NoCaptchaTaskProxylessTask(site_url, site_key) if not hasattr(client, 'createTaskSmee'): - sys.tracebacklimit = 0 - raise reCaptcha_exceptions.reCaptcha_Import_Error( - "Please upgrade 'python_anticaptcha' via pip or download it from https://github.com/ad-m/python-anticaptcha" + raise NotImplementedError( + "Please upgrade 'python_anticaptcha' via pip or download it from " + "https://github.com/ad-m/python-anticaptcha" ) job = client.createTaskSmee(task) diff --git a/lib/cloudscraper/reCaptcha/deathbycaptcha.py b/lib/cloudscraper/reCaptcha/deathbycaptcha.py index dc0e4997..7aeda916 100644 --- a/lib/cloudscraper/reCaptcha/deathbycaptcha.py +++ b/lib/cloudscraper/reCaptcha/deathbycaptcha.py @@ -2,18 +2,24 @@ from __future__ import absolute_import import json import requests -import reCaptcha_exceptions try: import polling except ImportError: - import sys - sys.tracebacklimit = 0 - raise reCaptcha_exceptions.reCaptcha_Import_Error( + raise ImportError( "Please install the python module 'polling' via pip or download it from " "https://github.com/justiniso/polling/" ) +from ..exceptions import ( + reCaptchaServiceUnavailable, + reCaptchaAccountError, + reCaptchaTimeout, + reCaptchaParameter, + reCaptchaBadJobID, + reCaptchaReportError +) + from . import reCaptcha @@ -38,7 +44,7 @@ class captchaSolver(reCaptcha): ) if response.status_code in errors: - raise reCaptcha_exceptions.reCaptcha_Service_Unavailable(errors.get(response.status_code)) + raise reCaptchaServiceUnavailable(errors.get(response.status_code)) # ------------------------------------------------------------------------------- # @@ -49,10 +55,10 @@ class captchaSolver(reCaptcha): def _checkRequest(response): if response.ok: if response.json().get('is_banned'): - raise reCaptcha_exceptions.reCaptcha_Account_Error('DeathByCaptcha: Your account is banned.') + raise reCaptchaAccountError('DeathByCaptcha: Your account is banned.') if response.json().get('balanace') == 0: - raise reCaptcha_exceptions.reCaptcha_Account_Error('DeathByCaptcha: insufficient credits.') + raise reCaptchaAccountError('DeathByCaptcha: insufficient credits.') return response @@ -80,7 +86,7 @@ class captchaSolver(reCaptcha): def reportJob(self, jobID): if not jobID: - raise reCaptcha_exceptions.reCaptcha_Bad_Job_ID( + raise reCaptchaBadJobID( "DeathByCaptcha: Error bad job id to report failed reCaptcha." ) @@ -109,7 +115,7 @@ class captchaSolver(reCaptcha): if response: return True else: - raise reCaptcha_exceptions.reCaptcha_Report_Error( + raise reCaptchaReportError( "DeathByCaptcha: Error report failed reCaptcha." ) @@ -117,7 +123,7 @@ class captchaSolver(reCaptcha): def requestJob(self, jobID): if not jobID: - raise reCaptcha_exceptions.reCaptcha_Bad_Job_ID( + raise reCaptchaBadJobID( "DeathByCaptcha: Error bad job id to request reCaptcha." ) @@ -142,7 +148,7 @@ class captchaSolver(reCaptcha): if response: return response.json().get('text') else: - raise reCaptcha_exceptions.reCaptcha_Timeout( + raise reCaptchaTimeout( "DeathByCaptcha: Error failed to solve reCaptcha." ) @@ -180,7 +186,7 @@ class captchaSolver(reCaptcha): if response: return response.json().get('captcha') else: - raise reCaptcha_exceptions.reCaptcha_Bad_Job_ID( + raise reCaptchaBadJobID( 'DeathByCaptcha: Error no job id was returned.' ) @@ -191,7 +197,7 @@ class captchaSolver(reCaptcha): for param in ['username', 'password']: if not reCaptchaParams.get(param): - raise reCaptcha_exceptions.reCaptcha_Bad_Parameter( + raise reCaptchaParameter( "DeathByCaptcha: Missing '{}' parameter.".format(param) ) setattr(self, param, reCaptchaParams.get(param)) @@ -207,11 +213,11 @@ class captchaSolver(reCaptcha): if jobID: self.reportJob(jobID) except polling.TimeoutException: - raise reCaptcha_exceptions.reCaptcha_Timeout( + raise reCaptchaTimeout( "DeathByCaptcha: reCaptcha solve took to long and also failed reporting the job id {}.".format(jobID) ) - raise reCaptcha_exceptions.reCaptcha_Timeout( + raise reCaptchaTimeout( "DeathByCaptcha: reCaptcha solve took to long to execute job id {}, aborting.".format(jobID) ) diff --git a/lib/cloudscraper/user_agent/__init__.py b/lib/cloudscraper/user_agent/__init__.py index df47ca26..c7ad4fc0 100644 --- a/lib/cloudscraper/user_agent/__init__.py +++ b/lib/cloudscraper/user_agent/__init__.py @@ -84,8 +84,8 @@ class User_Agent(): if not self.tryMatchCustom(user_agents): self.cipherSuite = [ ssl._DEFAULT_CIPHERS, - '!ECDHE+SHA', - '!AES128-SHA' + '!AES128-SHA', + '!ECDHE-RSA-AES256-SHA', ] self.headers = OrderedDict([ ('User-Agent', self.custom), diff --git a/lib/cloudscraper/user_agent/browsers.json b/lib/cloudscraper/user_agent/browsers.json index ef6d8591..a808788d 100644 --- a/lib/cloudscraper/user_agent/browsers.json +++ b/lib/cloudscraper/user_agent/browsers.json @@ -17,7 +17,6 @@ "ECDHE-RSA-AES256-GCM-SHA384", "ECDHE-ECDSA-CHACHA20-POLY1305", "ECDHE-RSA-CHACHA20-POLY1305", - "ECDHE-RSA-AES256-SHA", "AES128-GCM-SHA256", "AES256-GCM-SHA384", "AES128-SHA", @@ -12824,7 +12823,6 @@ "ECDHE-RSA-AES256-GCM-SHA384", "ECDHE-ECDSA-AES256-SHA", "ECDHE-ECDSA-AES128-SHA", - "ECDHE-RSA-AES256-SHA", "DHE-RSA-AES128-SHA", "DHE-RSA-AES256-SHA", "AES128-SHA", diff --git a/lib/unshortenit.py b/lib/unshortenit.py index 5c9074bd..9b272f6e 100644 --- a/lib/unshortenit.py +++ b/lib/unshortenit.py @@ -35,13 +35,14 @@ class UnshortenIt(object): _anonymz_regex = r'anonymz\.com' _shrink_service_regex = r'shrink-service\.it' _rapidcrypt_regex = r'rapidcrypt\.net' - _cryptmango_regex = r'cryptmango|xshield\.net' _vcrypt_regex = r'vcrypt\.net|vcrypt\.pw' _linkup_regex = r'linkup\.pro|buckler.link' _linkhub_regex = r'linkhub\.icu' + # for services that only include real link inside iframe + _simple_iframe_regex = r'cryptmango|xshield\.net|vcrypt\.club' listRegex = [_adfly_regex, _linkbucks_regex, _adfocus_regex, _lnxlu_regex, _shst_regex, _hrefli_regex, _anonymz_regex, - _shrink_service_regex, _rapidcrypt_regex, _cryptmango_regex, _vcrypt_regex, _linkup_regex, _linkhub_regex] + _shrink_service_regex, _rapidcrypt_regex, _simple_iframe_regex, _vcrypt_regex, _linkup_regex, _linkhub_regex] _maxretries = 5 @@ -79,8 +80,8 @@ class UnshortenIt(object): uri, code = self._unshorten_anonymz(uri) if re.search(self._rapidcrypt_regex, domain, re.IGNORECASE): uri, code = self._unshorten_rapidcrypt(uri) - if re.search(self._cryptmango_regex, uri, re.IGNORECASE): - uri, code = self._unshorten_cryptmango(uri) + if re.search(self._simple_iframe_regex, uri, re.IGNORECASE): + uri, code = self._unshorten_simple_iframe(uri) if re.search(self._vcrypt_regex, uri, re.IGNORECASE): uri, code = self._unshorten_vcrypt(uri) if re.search(self._linkup_regex, uri, re.IGNORECASE): @@ -467,12 +468,12 @@ class UnshortenIt(object): except Exception as e: return uri, 0 - def _unshorten_cryptmango(self, uri): + def _unshorten_simple_iframe(self, uri): try: r = httptools.downloadpage(uri, timeout=self._timeout, cookies=False) html = r.data - uri = re.findall(r'