parent
927b7b6406
commit
c99afe59c2
@ -0,0 +1,311 @@
|
|||||||
|
import logging
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
import ssl
|
||||||
|
|
||||||
|
from copy import deepcopy
|
||||||
|
from time import sleep
|
||||||
|
from collections import OrderedDict
|
||||||
|
|
||||||
|
from requests.sessions import Session
|
||||||
|
from requests.adapters import HTTPAdapter
|
||||||
|
from requests.packages.urllib3.util.ssl_ import create_urllib3_context
|
||||||
|
|
||||||
|
from .interpreters import JavaScriptInterpreter
|
||||||
|
from .user_agent import User_Agent
|
||||||
|
|
||||||
|
try:
|
||||||
|
from requests_toolbelt.utils import dump
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
|
import brotli
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
|
from urlparse import urlparse
|
||||||
|
from urlparse import urlunparse
|
||||||
|
except ImportError:
|
||||||
|
from urllib.parse import urlparse
|
||||||
|
from urllib.parse import urlunparse
|
||||||
|
|
||||||
|
##########################################################################################################################################################
|
||||||
|
|
||||||
|
__version__ = '1.1.9'
|
||||||
|
|
||||||
|
BUG_REPORT = 'Cloudflare may have changed their technique, or there may be a bug in the script.'
|
||||||
|
|
||||||
|
##########################################################################################################################################################
|
||||||
|
|
||||||
|
|
||||||
|
class CipherSuiteAdapter(HTTPAdapter):
|
||||||
|
|
||||||
|
def __init__(self, cipherSuite=None, **kwargs):
|
||||||
|
self.cipherSuite = cipherSuite
|
||||||
|
|
||||||
|
if hasattr(ssl, 'PROTOCOL_TLS'):
|
||||||
|
self.ssl_context = create_urllib3_context(
|
||||||
|
ssl_version=getattr(ssl, 'PROTOCOL_TLSv1_3', ssl.PROTOCOL_TLSv1_2),
|
||||||
|
ciphers=self.cipherSuite
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
self.ssl_context = create_urllib3_context(ssl_version=ssl.PROTOCOL_TLSv1)
|
||||||
|
|
||||||
|
super(CipherSuiteAdapter, self).__init__(**kwargs)
|
||||||
|
|
||||||
|
##########################################################################################################################################################
|
||||||
|
|
||||||
|
def init_poolmanager(self, *args, **kwargs):
|
||||||
|
kwargs['ssl_context'] = self.ssl_context
|
||||||
|
return super(CipherSuiteAdapter, self).init_poolmanager(*args, **kwargs)
|
||||||
|
|
||||||
|
##########################################################################################################################################################
|
||||||
|
|
||||||
|
def proxy_manager_for(self, *args, **kwargs):
|
||||||
|
kwargs['ssl_context'] = self.ssl_context
|
||||||
|
return super(CipherSuiteAdapter, self).proxy_manager_for(*args, **kwargs)
|
||||||
|
|
||||||
|
##########################################################################################################################################################
|
||||||
|
|
||||||
|
|
||||||
|
class CloudScraper(Session):
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
self.debug = kwargs.pop('debug', False)
|
||||||
|
self.delay = kwargs.pop('delay', None)
|
||||||
|
self.interpreter = kwargs.pop('interpreter', 'js2py')
|
||||||
|
self.allow_brotli = kwargs.pop('allow_brotli', True if 'brotli' in sys.modules.keys() else False)
|
||||||
|
self.cipherSuite = None
|
||||||
|
|
||||||
|
super(CloudScraper, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
|
if 'requests' in self.headers['User-Agent']:
|
||||||
|
# Set a random User-Agent if no custom User-Agent has been set
|
||||||
|
self.headers = User_Agent(allow_brotli=self.allow_brotli).headers
|
||||||
|
|
||||||
|
self.mount('https://', CipherSuiteAdapter(self.loadCipherSuite()))
|
||||||
|
|
||||||
|
##########################################################################################################################################################
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def debugRequest(req):
|
||||||
|
try:
|
||||||
|
print(dump.dump_all(req).decode('utf-8'))
|
||||||
|
except: # noqa
|
||||||
|
pass
|
||||||
|
|
||||||
|
##########################################################################################################################################################
|
||||||
|
|
||||||
|
def loadCipherSuite(self):
|
||||||
|
if self.cipherSuite:
|
||||||
|
return self.cipherSuite
|
||||||
|
|
||||||
|
self.cipherSuite = ''
|
||||||
|
|
||||||
|
if hasattr(ssl, 'PROTOCOL_TLS'):
|
||||||
|
ciphers = [
|
||||||
|
'ECDHE-ECDSA-AES128-GCM-SHA256', 'ECDHE-RSA-AES128-GCM-SHA256', 'ECDHE-ECDSA-AES256-GCM-SHA384',
|
||||||
|
'ECDHE-RSA-AES256-GCM-SHA384', 'ECDHE-ECDSA-CHACHA20-POLY1305-SHA256', 'ECDHE-RSA-CHACHA20-POLY1305-SHA256',
|
||||||
|
'ECDHE-RSA-AES128-CBC-SHA', 'ECDHE-RSA-AES256-CBC-SHA', 'RSA-AES128-GCM-SHA256', 'RSA-AES256-GCM-SHA384',
|
||||||
|
'ECDHE-RSA-AES128-GCM-SHA256', 'RSA-AES256-SHA', '3DES-EDE-CBC'
|
||||||
|
]
|
||||||
|
|
||||||
|
if hasattr(ssl, 'PROTOCOL_TLSv1_3'):
|
||||||
|
ciphers.insert(0, ['GREASE_3A', 'GREASE_6A', 'AES128-GCM-SHA256', 'AES256-GCM-SHA256', 'AES256-GCM-SHA384', 'CHACHA20-POLY1305-SHA256'])
|
||||||
|
|
||||||
|
ctx = ssl.SSLContext(getattr(ssl, 'PROTOCOL_TLSv1_3', ssl.PROTOCOL_TLSv1_2))
|
||||||
|
|
||||||
|
for cipher in ciphers:
|
||||||
|
try:
|
||||||
|
ctx.set_ciphers(cipher)
|
||||||
|
self.cipherSuite = '{}:{}'.format(self.cipherSuite, cipher).rstrip(':')
|
||||||
|
except ssl.SSLError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
return self.cipherSuite
|
||||||
|
|
||||||
|
##########################################################################################################################################################
|
||||||
|
|
||||||
|
def request(self, method, url, *args, **kwargs):
|
||||||
|
ourSuper = super(CloudScraper, self)
|
||||||
|
resp = ourSuper.request(method, url, *args, **kwargs)
|
||||||
|
|
||||||
|
if resp.headers.get('Content-Encoding') == 'br':
|
||||||
|
if self.allow_brotli and resp._content:
|
||||||
|
resp._content = brotli.decompress(resp.content)
|
||||||
|
else:
|
||||||
|
logging.warning('Brotli content detected, But option is disabled, we will not continue.')
|
||||||
|
return resp
|
||||||
|
|
||||||
|
# Debug request
|
||||||
|
if self.debug:
|
||||||
|
self.debugRequest(resp)
|
||||||
|
|
||||||
|
# Check if Cloudflare anti-bot is on
|
||||||
|
if self.isChallengeRequest(resp):
|
||||||
|
if resp.request.method != 'GET':
|
||||||
|
# Work around if the initial request is not a GET,
|
||||||
|
# Supersede with a GET then re-request the original METHOD.
|
||||||
|
self.request('GET', resp.url)
|
||||||
|
resp = ourSuper.request(method, url, *args, **kwargs)
|
||||||
|
else:
|
||||||
|
# Solve Challenge
|
||||||
|
resp = self.sendChallengeResponse(resp, **kwargs)
|
||||||
|
|
||||||
|
return resp
|
||||||
|
|
||||||
|
##########################################################################################################################################################
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def isChallengeRequest(resp):
|
||||||
|
if resp.headers.get('Server', '').startswith('cloudflare'):
|
||||||
|
if b'why_captcha' in resp.content or b'/cdn-cgi/l/chk_captcha' in resp.content:
|
||||||
|
raise ValueError('Captcha')
|
||||||
|
|
||||||
|
return (
|
||||||
|
resp.status_code in [429, 503]
|
||||||
|
and all(s in resp.content for s in [b'jschl_vc', b'jschl_answer'])
|
||||||
|
)
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
|
##########################################################################################################################################################
|
||||||
|
|
||||||
|
def sendChallengeResponse(self, resp, **original_kwargs):
|
||||||
|
body = resp.text
|
||||||
|
|
||||||
|
# Cloudflare requires a delay before solving the challenge
|
||||||
|
if not self.delay:
|
||||||
|
try:
|
||||||
|
delay = float(re.search(r'submit\(\);\r?\n\s*},\s*([0-9]+)', body).group(1)) / float(1000)
|
||||||
|
if isinstance(delay, (int, float)):
|
||||||
|
self.delay = delay
|
||||||
|
except: # noqa
|
||||||
|
pass
|
||||||
|
|
||||||
|
sleep(self.delay)
|
||||||
|
|
||||||
|
parsed_url = urlparse(resp.url)
|
||||||
|
domain = parsed_url.netloc
|
||||||
|
submit_url = '{}://{}/cdn-cgi/l/chk_jschl'.format(parsed_url.scheme, domain)
|
||||||
|
|
||||||
|
cloudflare_kwargs = deepcopy(original_kwargs)
|
||||||
|
|
||||||
|
try:
|
||||||
|
params = OrderedDict()
|
||||||
|
|
||||||
|
s = re.search(r'name="s"\svalue="(?P<s_value>[^"]+)', body)
|
||||||
|
if s:
|
||||||
|
params['s'] = s.group('s_value')
|
||||||
|
|
||||||
|
params.update(
|
||||||
|
[
|
||||||
|
('jschl_vc', re.search(r'name="jschl_vc" value="(\w+)"', body).group(1)),
|
||||||
|
('pass', re.search(r'name="pass" value="(.+?)"', body).group(1))
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
params = cloudflare_kwargs.setdefault('params', params)
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
raise ValueError('Unable to parse Cloudflare anti-bots page: {} {}'.format(e.message, BUG_REPORT))
|
||||||
|
|
||||||
|
# Solve the Javascript challenge
|
||||||
|
params['jschl_answer'] = JavaScriptInterpreter.dynamicImport(self.interpreter).solveChallenge(body, domain)
|
||||||
|
|
||||||
|
# Requests transforms any request into a GET after a redirect,
|
||||||
|
# so the redirect has to be handled manually here to allow for
|
||||||
|
# performing other types of requests even as the first request.
|
||||||
|
|
||||||
|
cloudflare_kwargs['allow_redirects'] = False
|
||||||
|
|
||||||
|
redirect = self.request(resp.request.method, submit_url, **cloudflare_kwargs)
|
||||||
|
redirect_location = urlparse(redirect.headers['Location'])
|
||||||
|
if not redirect_location.netloc:
|
||||||
|
redirect_url = urlunparse(
|
||||||
|
(
|
||||||
|
parsed_url.scheme,
|
||||||
|
domain,
|
||||||
|
redirect_location.path,
|
||||||
|
redirect_location.params,
|
||||||
|
redirect_location.query,
|
||||||
|
redirect_location.fragment
|
||||||
|
)
|
||||||
|
)
|
||||||
|
return self.request(resp.request.method, redirect_url, **original_kwargs)
|
||||||
|
|
||||||
|
return self.request(resp.request.method, redirect.headers['Location'], **original_kwargs)
|
||||||
|
|
||||||
|
##########################################################################################################################################################
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def create_scraper(cls, sess=None, **kwargs):
|
||||||
|
"""
|
||||||
|
Convenience function for creating a ready-to-go CloudScraper object.
|
||||||
|
"""
|
||||||
|
scraper = cls(**kwargs)
|
||||||
|
|
||||||
|
if sess:
|
||||||
|
attrs = ['auth', 'cert', 'cookies', 'headers', 'hooks', 'params', 'proxies', 'data']
|
||||||
|
for attr in attrs:
|
||||||
|
val = getattr(sess, attr, None)
|
||||||
|
if val:
|
||||||
|
setattr(scraper, attr, val)
|
||||||
|
|
||||||
|
return scraper
|
||||||
|
|
||||||
|
##########################################################################################################################################################
|
||||||
|
|
||||||
|
# Functions for integrating cloudscraper with other applications and scripts
|
||||||
|
@classmethod
|
||||||
|
def get_tokens(cls, url, **kwargs):
|
||||||
|
scraper = cls.create_scraper(
|
||||||
|
debug=kwargs.pop('debug', False),
|
||||||
|
delay=kwargs.pop('delay', None),
|
||||||
|
interpreter=kwargs.pop('interpreter', 'js2py'),
|
||||||
|
allow_brotli=kwargs.pop('allow_brotli', True),
|
||||||
|
)
|
||||||
|
|
||||||
|
try:
|
||||||
|
resp = scraper.get(url, **kwargs)
|
||||||
|
resp.raise_for_status()
|
||||||
|
except Exception:
|
||||||
|
logging.error('"{}" returned an error. Could not collect tokens.'.format(url))
|
||||||
|
raise
|
||||||
|
|
||||||
|
domain = urlparse(resp.url).netloc
|
||||||
|
# noinspection PyUnusedLocal
|
||||||
|
cookie_domain = None
|
||||||
|
|
||||||
|
for d in scraper.cookies.list_domains():
|
||||||
|
if d.startswith('.') and d in ('.{}'.format(domain)):
|
||||||
|
cookie_domain = d
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
raise ValueError('Unable to find Cloudflare cookies. Does the site actually have Cloudflare IUAM ("I\'m Under Attack Mode") enabled?')
|
||||||
|
|
||||||
|
return (
|
||||||
|
{
|
||||||
|
'__cfduid': scraper.cookies.get('__cfduid', '', domain=cookie_domain),
|
||||||
|
'cf_clearance': scraper.cookies.get('cf_clearance', '', domain=cookie_domain)
|
||||||
|
},
|
||||||
|
scraper.headers['User-Agent']
|
||||||
|
)
|
||||||
|
|
||||||
|
##########################################################################################################################################################
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def get_cookie_string(cls, url, **kwargs):
|
||||||
|
"""
|
||||||
|
Convenience function for building a Cookie HTTP header value.
|
||||||
|
"""
|
||||||
|
tokens, user_agent = cls.get_tokens(url, **kwargs)
|
||||||
|
return '; '.join('='.join(pair) for pair in tokens.items()), user_agent
|
||||||
|
|
||||||
|
|
||||||
|
##########################################################################################################################################################
|
||||||
|
|
||||||
|
create_scraper = CloudScraper.create_scraper
|
||||||
|
get_tokens = CloudScraper.get_tokens
|
||||||
|
get_cookie_string = CloudScraper.get_cookie_string
|
@ -0,0 +1,89 @@
|
|||||||
|
import re
|
||||||
|
import sys
|
||||||
|
import logging
|
||||||
|
import abc
|
||||||
|
|
||||||
|
if sys.version_info >= (3, 4):
|
||||||
|
ABC = abc.ABC # noqa
|
||||||
|
else:
|
||||||
|
ABC = abc.ABCMeta('ABC', (), {})
|
||||||
|
|
||||||
|
##########################################################################################################################################################
|
||||||
|
|
||||||
|
BUG_REPORT = 'Cloudflare may have changed their technique, or there may be a bug in the script.'
|
||||||
|
|
||||||
|
##########################################################################################################################################################
|
||||||
|
|
||||||
|
interpreters = {}
|
||||||
|
|
||||||
|
|
||||||
|
class JavaScriptInterpreter(ABC):
|
||||||
|
@abc.abstractmethod
|
||||||
|
def __init__(self, name):
|
||||||
|
interpreters[name] = self
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def dynamicImport(cls, name):
|
||||||
|
if name not in interpreters:
|
||||||
|
try:
|
||||||
|
__import__('{}.{}'.format(cls.__module__, name))
|
||||||
|
if not isinstance(interpreters.get(name), JavaScriptInterpreter):
|
||||||
|
raise ImportError('The interpreter was not initialized.')
|
||||||
|
except ImportError:
|
||||||
|
logging.error('Unable to load {} interpreter'.format(name))
|
||||||
|
raise
|
||||||
|
|
||||||
|
return interpreters[name]
|
||||||
|
|
||||||
|
@abc.abstractmethod
|
||||||
|
def eval(self, jsEnv, js):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def solveChallenge(self, body, domain):
|
||||||
|
try:
|
||||||
|
js = re.search(
|
||||||
|
r'setTimeout\(function\(\){\s+(var s,t,o,p,b,r,e,a,k,i,n,g,f.+?\r?\n[\s\S]+?a\.value =.+?)\r?\n',
|
||||||
|
body
|
||||||
|
).group(1)
|
||||||
|
except Exception:
|
||||||
|
raise ValueError('Unable to identify Cloudflare IUAM Javascript on website. {}'.format(BUG_REPORT))
|
||||||
|
|
||||||
|
js = re.sub(r'\s{2,}', ' ', js, flags=re.MULTILINE | re.DOTALL).replace('\'; 121\'', '')
|
||||||
|
js += '\na.value;'
|
||||||
|
|
||||||
|
jsEnv = '''
|
||||||
|
String.prototype.italics=function(str) {{return "<i>" + this + "</i>";}};
|
||||||
|
var document = {{
|
||||||
|
createElement: function () {{
|
||||||
|
return {{ firstChild: {{ href: "https://{domain}/" }} }}
|
||||||
|
}},
|
||||||
|
getElementById: function () {{
|
||||||
|
return {{"innerHTML": "{innerHTML}"}};
|
||||||
|
}}
|
||||||
|
}};
|
||||||
|
'''
|
||||||
|
|
||||||
|
try:
|
||||||
|
innerHTML = re.search(
|
||||||
|
r'<div(?: [^<>]*)? id="([^<>]*?)">([^<>]*?)</div>',
|
||||||
|
body,
|
||||||
|
re.MULTILINE | re.DOTALL
|
||||||
|
)
|
||||||
|
innerHTML = innerHTML.group(2) if innerHTML else ''
|
||||||
|
|
||||||
|
except: # noqa
|
||||||
|
logging.error('Error extracting Cloudflare IUAM Javascript. {}'.format(BUG_REPORT))
|
||||||
|
raise
|
||||||
|
|
||||||
|
try:
|
||||||
|
result = self.eval(
|
||||||
|
re.sub(r'\s{2,}', ' ', jsEnv.format(domain=domain, innerHTML=innerHTML), flags=re.MULTILINE | re.DOTALL),
|
||||||
|
js
|
||||||
|
)
|
||||||
|
|
||||||
|
float(result)
|
||||||
|
except Exception:
|
||||||
|
logging.error('Error executing Cloudflare IUAM Javascript. {}'.format(BUG_REPORT))
|
||||||
|
raise
|
||||||
|
|
||||||
|
return result
|
@ -0,0 +1,32 @@
|
|||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import js2py
|
||||||
|
import logging
|
||||||
|
import base64
|
||||||
|
|
||||||
|
from . import JavaScriptInterpreter
|
||||||
|
|
||||||
|
from .jsunfuck import jsunfuck
|
||||||
|
|
||||||
|
|
||||||
|
class ChallengeInterpreter(JavaScriptInterpreter):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
super(ChallengeInterpreter, self).__init__('js2py')
|
||||||
|
|
||||||
|
def eval(self, jsEnv, js):
|
||||||
|
if js2py.eval_js('(+(+!+[]+[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+[!+[]+!+[]]+[+[]])+[])[+!+[]]') == '1':
|
||||||
|
logging.warning('WARNING - Please upgrade your js2py https://github.com/PiotrDabkowski/Js2Py, applying work around for the meantime.')
|
||||||
|
js = jsunfuck(js)
|
||||||
|
|
||||||
|
def atob(s):
|
||||||
|
return base64.b64decode('{}'.format(s)).decode('utf-8')
|
||||||
|
|
||||||
|
js2py.disable_pyimport()
|
||||||
|
context = js2py.EvalJs({'atob': atob})
|
||||||
|
result = context.eval('{}{}'.format(jsEnv, js))
|
||||||
|
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
ChallengeInterpreter()
|
@ -0,0 +1,97 @@
|
|||||||
|
MAPPING = {
|
||||||
|
'a': '(false+"")[1]',
|
||||||
|
'b': '([]["entries"]()+"")[2]',
|
||||||
|
'c': '([]["fill"]+"")[3]',
|
||||||
|
'd': '(undefined+"")[2]',
|
||||||
|
'e': '(true+"")[3]',
|
||||||
|
'f': '(false+"")[0]',
|
||||||
|
'g': '(false+[0]+String)[20]',
|
||||||
|
'h': '(+(101))["to"+String["name"]](21)[1]',
|
||||||
|
'i': '([false]+undefined)[10]',
|
||||||
|
'j': '([]["entries"]()+"")[3]',
|
||||||
|
'k': '(+(20))["to"+String["name"]](21)',
|
||||||
|
'l': '(false+"")[2]',
|
||||||
|
'm': '(Number+"")[11]',
|
||||||
|
'n': '(undefined+"")[1]',
|
||||||
|
'o': '(true+[]["fill"])[10]',
|
||||||
|
'p': '(+(211))["to"+String["name"]](31)[1]',
|
||||||
|
'q': '(+(212))["to"+String["name"]](31)[1]',
|
||||||
|
'r': '(true+"")[1]',
|
||||||
|
's': '(false+"")[3]',
|
||||||
|
't': '(true+"")[0]',
|
||||||
|
'u': '(undefined+"")[0]',
|
||||||
|
'v': '(+(31))["to"+String["name"]](32)',
|
||||||
|
'w': '(+(32))["to"+String["name"]](33)',
|
||||||
|
'x': '(+(101))["to"+String["name"]](34)[1]',
|
||||||
|
'y': '(NaN+[Infinity])[10]',
|
||||||
|
'z': '(+(35))["to"+String["name"]](36)',
|
||||||
|
'A': '(+[]+Array)[10]',
|
||||||
|
'B': '(+[]+Boolean)[10]',
|
||||||
|
'C': 'Function("return escape")()(("")["italics"]())[2]',
|
||||||
|
'D': 'Function("return escape")()([]["fill"])["slice"]("-1")',
|
||||||
|
'E': '(RegExp+"")[12]',
|
||||||
|
'F': '(+[]+Function)[10]',
|
||||||
|
'G': '(false+Function("return Date")()())[30]',
|
||||||
|
'I': '(Infinity+"")[0]',
|
||||||
|
'M': '(true+Function("return Date")()())[30]',
|
||||||
|
'N': '(NaN+"")[0]',
|
||||||
|
'O': '(NaN+Function("return{}")())[11]',
|
||||||
|
'R': '(+[]+RegExp)[10]',
|
||||||
|
'S': '(+[]+String)[10]',
|
||||||
|
'T': '(NaN+Function("return Date")()())[30]',
|
||||||
|
'U': '(NaN+Function("return{}")()["to"+String["name"]]["call"]())[11]',
|
||||||
|
' ': '(NaN+[]["fill"])[11]',
|
||||||
|
'"': '("")["fontcolor"]()[12]',
|
||||||
|
'%': 'Function("return escape")()([]["fill"])[21]',
|
||||||
|
'&': '("")["link"](0+")[10]',
|
||||||
|
'(': '(undefined+[]["fill"])[22]',
|
||||||
|
')': '([0]+false+[]["fill"])[20]',
|
||||||
|
'+': '(+(+!+[]+(!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]])+[])[2]',
|
||||||
|
',': '([]["slice"]["call"](false+"")+"")[1]',
|
||||||
|
'-': '(+(.+[0000000001])+"")[2]',
|
||||||
|
'.': '(+(+!+[]+[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+[!+[]+!+[]]+[+[]])+[])[+!+[]]',
|
||||||
|
'/': '(false+[0])["italics"]()[10]',
|
||||||
|
':': '(RegExp()+"")[3]',
|
||||||
|
';': '("")["link"](")[14]',
|
||||||
|
'<': '("")["italics"]()[0]',
|
||||||
|
'=': '("")["fontcolor"]()[11]',
|
||||||
|
'>': '("")["italics"]()[2]',
|
||||||
|
'?': '(RegExp()+"")[2]',
|
||||||
|
'[': '([]["entries"]()+"")[0]',
|
||||||
|
']': '([]["entries"]()+"")[22]',
|
||||||
|
'{': '(true+[]["fill"])[20]',
|
||||||
|
'}': '([]["fill"]+"")["slice"]("-1")'
|
||||||
|
}
|
||||||
|
|
||||||
|
SIMPLE = {
|
||||||
|
'false': '![]',
|
||||||
|
'true': '!![]',
|
||||||
|
'undefined': '[][[]]',
|
||||||
|
'NaN': '+[![]]',
|
||||||
|
'Infinity': '+(+!+[]+(!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]]+[+[]])' # +"1e1000"
|
||||||
|
}
|
||||||
|
|
||||||
|
CONSTRUCTORS = {
|
||||||
|
'Array': '[]',
|
||||||
|
'Number': '(+[])',
|
||||||
|
'String': '([]+[])',
|
||||||
|
'Boolean': '(![])',
|
||||||
|
'Function': '[]["fill"]',
|
||||||
|
'RegExp': 'Function("return/"+false+"/")()'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def jsunfuck(jsfuckString):
|
||||||
|
for key in sorted(MAPPING, key=lambda k: len(MAPPING[k]), reverse=True):
|
||||||
|
if MAPPING.get(key) in jsfuckString:
|
||||||
|
jsfuckString = jsfuckString.replace(MAPPING.get(key), '"{}"'.format(key))
|
||||||
|
|
||||||
|
for key in sorted(SIMPLE, key=lambda k: len(SIMPLE[k]), reverse=True):
|
||||||
|
if SIMPLE.get(key) in jsfuckString:
|
||||||
|
jsfuckString = jsfuckString.replace(SIMPLE.get(key), '{}'.format(key))
|
||||||
|
|
||||||
|
# for key in sorted(CONSTRUCTORS, key=lambda k: len(CONSTRUCTORS[k]), reverse=True):
|
||||||
|
# if CONSTRUCTORS.get(key) in jsfuckString:
|
||||||
|
# jsfuckString = jsfuckString.replace(CONSTRUCTORS.get(key), '{}'.format(key))
|
||||||
|
|
||||||
|
return jsfuckString
|
@ -0,0 +1,46 @@
|
|||||||
|
import base64
|
||||||
|
import logging
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
from . import JavaScriptInterpreter
|
||||||
|
|
||||||
|
##########################################################################################################################################################
|
||||||
|
|
||||||
|
BUG_REPORT = 'Cloudflare may have changed their technique, or there may be a bug in the script.'
|
||||||
|
|
||||||
|
##########################################################################################################################################################
|
||||||
|
|
||||||
|
|
||||||
|
class ChallengeInterpreter(JavaScriptInterpreter):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
super(ChallengeInterpreter, self).__init__('nodejs')
|
||||||
|
|
||||||
|
def eval(self, jsEnv, js):
|
||||||
|
try:
|
||||||
|
js = 'var atob = function(str) {return Buffer.from(str, "base64").toString("binary");};' \
|
||||||
|
'var challenge = atob("%s");' \
|
||||||
|
'var context = {atob: atob};' \
|
||||||
|
'var options = {filename: "iuam-challenge.js", timeout: 4000};' \
|
||||||
|
'var answer = require("vm").runInNewContext(challenge, context, options);' \
|
||||||
|
'process.stdout.write(String(answer));' \
|
||||||
|
% base64.b64encode('{}{}'.format(jsEnv, js).encode('UTF-8')).decode('ascii')
|
||||||
|
|
||||||
|
return subprocess.check_output(['node', '-e', js])
|
||||||
|
|
||||||
|
except OSError as e:
|
||||||
|
if e.errno == 2:
|
||||||
|
raise EnvironmentError(
|
||||||
|
'Missing Node.js runtime. Node is required and must be in the PATH (check with `node -v`). Your Node binary may be called `nodejs` rather than `node`, '
|
||||||
|
'in which case you may need to run `apt-get install nodejs-legacy` on some Debian-based systems. (Please read the cloudscraper'
|
||||||
|
' README\'s Dependencies section: https://github.com/VeNoMouS/cloudscraper#dependencies.'
|
||||||
|
)
|
||||||
|
raise
|
||||||
|
except Exception:
|
||||||
|
logging.error('Error executing Cloudflare IUAM Javascript. %s' % BUG_REPORT)
|
||||||
|
raise
|
||||||
|
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
ChallengeInterpreter()
|
@ -0,0 +1,40 @@
|
|||||||
|
import os
|
||||||
|
import json
|
||||||
|
import random
|
||||||
|
import logging
|
||||||
|
|
||||||
|
from collections import OrderedDict
|
||||||
|
|
||||||
|
##########################################################################################################################################################
|
||||||
|
|
||||||
|
|
||||||
|
class User_Agent():
|
||||||
|
|
||||||
|
##########################################################################################################################################################
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
self.headers = None
|
||||||
|
self.loadUserAgent(*args, **kwargs)
|
||||||
|
|
||||||
|
##########################################################################################################################################################
|
||||||
|
|
||||||
|
def loadUserAgent(self, *args, **kwargs):
|
||||||
|
browser = kwargs.pop('browser', 'chrome')
|
||||||
|
|
||||||
|
user_agents = json.load(
|
||||||
|
open(os.path.join(os.path.dirname(__file__), 'browsers.json'), 'r'),
|
||||||
|
object_pairs_hook=OrderedDict
|
||||||
|
)
|
||||||
|
|
||||||
|
if not user_agents.get(browser):
|
||||||
|
logging.error('Sorry "{}" browser User-Agent was not found.'.format(browser))
|
||||||
|
raise
|
||||||
|
|
||||||
|
user_agent = random.choice(user_agents.get(browser))
|
||||||
|
|
||||||
|
self.headers = user_agent.get('headers')
|
||||||
|
self.headers['User-Agent'] = random.choice(user_agent.get('User-Agent'))
|
||||||
|
|
||||||
|
if not kwargs.get('allow_brotli', False):
|
||||||
|
if 'br' in self.headers['Accept-Encoding']:
|
||||||
|
self.headers['Accept-Encoding'] = ','.join([encoding for encoding in self.headers['Accept-Encoding'].split(',') if encoding.strip() != 'br']).strip()
|
@ -0,0 +1,336 @@
|
|||||||
|
{
|
||||||
|
"chrome": [
|
||||||
|
{
|
||||||
|
"User-Agent": [
|
||||||
|
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.101 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.101 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.101 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.59 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.59 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.59 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.59 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.59 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.59 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.59 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.59 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.59 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.59 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.113 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.89 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.89 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.89 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.89 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.89 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.89 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.76 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.76 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.76 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.76 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.76 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.76 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36"
|
||||||
|
],
|
||||||
|
"headers": {
|
||||||
|
"Connection": "keep-alive",
|
||||||
|
"Upgrade-Insecure-Requests": "1",
|
||||||
|
"User-Agent": null,
|
||||||
|
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
|
||||||
|
"Accept-Language": "en-US,en;q=0.8",
|
||||||
|
"Accept-Encoding": "gzip, deflate, , br"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"User-Agent": [
|
||||||
|
"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.86 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.86 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.86 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.86 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.86 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.86 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.86 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.86 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.86 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.86 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.79 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.79 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.79 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.79 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.79 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.79 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.79 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.79 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.79 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.79 Safari/537.36"
|
||||||
|
],
|
||||||
|
"headers": {
|
||||||
|
"Connection": "keep-alive",
|
||||||
|
"Upgrade-Insecure-Requests": "1",
|
||||||
|
"User-Agent": null,
|
||||||
|
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
|
||||||
|
"Accept-Language": "en-US,en;q=0.8",
|
||||||
|
"Accept-Encoding": "gzip, deflate, br"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"User-Agent": [
|
||||||
|
"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.62 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.62 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.62 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.62 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.62 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.62 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.62 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.62 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.62 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.75 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.75 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.75 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.75 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.75 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.75 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.75 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.75 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.92 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.92 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.170 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.81 Safari/537.36"
|
||||||
|
],
|
||||||
|
"headers": {
|
||||||
|
"Connection": "keep-alive",
|
||||||
|
"Upgrade-Insecure-Requests": "1",
|
||||||
|
"User-Agent": null,
|
||||||
|
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
|
||||||
|
"Accept-Language": "en-US,en;q=0.9",
|
||||||
|
"Accept-Encoding": "gzip, deflate, br"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"User-Agent": [
|
||||||
|
"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36"
|
||||||
|
],
|
||||||
|
"headers": {
|
||||||
|
"Connection": "keep-alive",
|
||||||
|
"User-Agent": null,
|
||||||
|
"Upgrade-Insecure-Requests": "1",
|
||||||
|
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
|
||||||
|
"Accept-Language": "en-US,en;q=0.9",
|
||||||
|
"Accept-Encoding": "gzip, deflate, br"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"User-Agent": [
|
||||||
|
"Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.40 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.40 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.28 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.28 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.28 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.28 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.28 Safari/537.36"
|
||||||
|
],
|
||||||
|
"headers": {
|
||||||
|
"Connection": "keep-alive",
|
||||||
|
"Upgrade-Insecure-Requests": "1",
|
||||||
|
"User-Agent": null,
|
||||||
|
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3",
|
||||||
|
"Accept-Language": "en-US,en;q=0.9",
|
||||||
|
"Accept-Encoding": "gzip, deflate, br"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"User-Agent": [
|
||||||
|
"Mozilla/5.0 (Linux; Android 8.1.0; SM-N960F Build/M1AJQ) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.85 Mobile Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Linux; Android 8.0.0; SM-G965F Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.85 Mobile Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Linux; Android 8.0.0; Pixel 2 Build/OPD1.170816.010) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.85 Mobile Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Linux; Android 8.0.0; Pixel Build/OPR6.170623.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.85 Mobile Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Linux; Android 7.1.1; SM-A530F Build/NMF26X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.85 Mobile Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Linux; Android 7.1; Pixel Build/NDE63H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.85 Mobile Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Linux; Android 7.0; SM-G955F Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.85 Mobile Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Linux; Android 7.0; SM-G950F Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.85 Mobile Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Linux; Android 7.0; SM-T825 Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.85 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Linux; Android 6.0.1; SM-G930F Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.85 Mobile Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Linux; Android 6.0; Nexus 6 Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.85 Mobile Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Linux; Android 6.0; XT1092 Build/MPE24.49-18) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.85 Mobile Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Linux; Android 6.0.1; SM-N910C Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.85 Mobile Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Linux; Android 5.0.2; SM-G920F Build/LRX22G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.85 Mobile Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Linux; Android 5.0; Nexus 6 Build/LRX21O) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.85 Mobile Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Linux; Android 9; Pixel 3 XL Build/PD1A.180720.030) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.85 Mobile Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Linux; Android 9; Pixel 3 Build/PD1A.180720.030) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.85 Mobile Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Linux; Android 9; Pixel 2 Build/PPR1.180610.009) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.85 Mobile Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Linux; Android 4.4; Nexus 5 Build/KRT16M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.85 Mobile Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Linux; Android 4.4.2; SM-T530 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.85 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Linux; Android 4.4.4; SM-N910C Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.85 Mobile Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Linux; Android 5.1.1; Nexus 9 Build/LMY47X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.85 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Linux; Android 7.1.1; SM-N950F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.90 Mobile Safari/537.36"
|
||||||
|
],
|
||||||
|
"headers": {
|
||||||
|
"Connection": "keep-alive",
|
||||||
|
"Upgrade-Insecure-Requests": "1",
|
||||||
|
"User-Agent": null,
|
||||||
|
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
|
||||||
|
"Accept-Encoding": "gzip, deflate, br",
|
||||||
|
"Accept-Language": "en-US,en;q=0.9"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"User-Agent": [
|
||||||
|
"Mozilla/5.0 (Linux; Android 8.1.0; SM-T835 Build/M1AJQ) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.85 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Linux; Android 8.0.0; SM-G960F Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.85 Mobile Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Linux; Android 5.0; XT1092 Build/LXE22.46-19) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.85 Mobile Safari/537.36"
|
||||||
|
],
|
||||||
|
"headers": {
|
||||||
|
"Connection": "keep-alive",
|
||||||
|
"Upgrade-Insecure-Requests": "1",
|
||||||
|
"User-Agent": null,
|
||||||
|
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
|
||||||
|
"Accept-Encoding": "gzip, deflate, br",
|
||||||
|
"Accept-Language": "en-GB,en-US;q=0.9,en;q=0.8"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,49 @@
|
|||||||
|
# coding=utf-8
|
||||||
|
|
||||||
|
from __future__ import print_function, division, unicode_literals
|
||||||
|
import re
|
||||||
|
|
||||||
|
from .time import times_to_ms
|
||||||
|
from .formatbase import FormatBase
|
||||||
|
from .ssaevent import SSAEvent
|
||||||
|
|
||||||
|
|
||||||
|
# thanks to http://otsaloma.io/gaupol/doc/api/aeidon.files.mpl2_source.html
|
||||||
|
MPL2_FORMAT = re.compile(r"^(?um)\[(-?\d+)\]\[(-?\d+)\](.*)")
|
||||||
|
|
||||||
|
|
||||||
|
class MPL2Format(FormatBase):
|
||||||
|
@classmethod
|
||||||
|
def guess_format(cls, text):
|
||||||
|
if MPL2_FORMAT.search(text):
|
||||||
|
return "mpl2"
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_file(cls, subs, fp, format_, **kwargs):
|
||||||
|
def prepare_text(lines):
|
||||||
|
out = []
|
||||||
|
for s in lines.split("|"):
|
||||||
|
s = s.strip()
|
||||||
|
|
||||||
|
if s.startswith("/"):
|
||||||
|
# line beginning with '/' is in italics
|
||||||
|
s = r"{\i1}%s{\i0}" % s[1:].strip()
|
||||||
|
|
||||||
|
out.append(s)
|
||||||
|
return "\\N".join(out)
|
||||||
|
|
||||||
|
subs.events = [SSAEvent(start=times_to_ms(s=float(start) / 10), end=times_to_ms(s=float(end) / 10),
|
||||||
|
text=prepare_text(text)) for start, end, text in MPL2_FORMAT.findall(fp.getvalue())]
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def to_file(cls, subs, fp, format_, **kwargs):
|
||||||
|
|
||||||
|
# TODO handle italics
|
||||||
|
for line in subs:
|
||||||
|
if line.is_comment:
|
||||||
|
continue
|
||||||
|
|
||||||
|
print("[{start}][{end}] {text}".format(start=int(line.start // 100),
|
||||||
|
end=int(line.end // 100),
|
||||||
|
text=line.plaintext.replace("\n", "|")),
|
||||||
|
file=fp)
|
Loading…
Reference in new issue