<s> import re , urllib , urlparse , time <EOL> from resources . lib . libraries import cache <EOL> from resources . lib . libraries import client <EOL> from resources . lib . libraries import control <EOL> def request ( url , post = None , headers = None , mobile = False , safe = False , timeout = '<STR_LIT>' ) : <EOL> try : <EOL> control . log ( '<STR_LIT>' % url ) <EOL> try : headers . update ( headers ) <EOL> except : headers = { } <EOL> agent = cache . get ( cloudflareAgent , <NUM_LIT> ) <EOL> if not '<STR_LIT>' in headers : headers [ '<STR_LIT>' ] = agent <EOL> u = '<STR_LIT>' % ( urlparse . urlparse ( url ) . scheme , urlparse . urlparse ( url ) . netloc ) <EOL> cookie = cache . get ( cloudflareCookie , <NUM_LIT> , u , post , headers , mobile , safe , timeout ) <EOL> result = client . request ( url , cookie = cookie , post = post , headers = headers , mobile = mobile , safe = safe , timeout = timeout , output = '<STR_LIT>' , error = True ) <EOL> if result [ <NUM_LIT:0> ] == '<STR_LIT>' : <EOL> agent = cache . get ( cloudflareAgent , <NUM_LIT:0> ) ; headers [ '<STR_LIT>' ] = agent <EOL> cookie = cache . get ( cloudflareCookie , <NUM_LIT:0> , u , post , headers , mobile , safe , timeout ) <EOL> result = client . request ( url , cookie = cookie , post = post , headers = headers , mobile = mobile , safe = safe , timeout = timeout ) <EOL> else : <EOL> result = result [ <NUM_LIT:1> ] <EOL> return result <EOL> except : <EOL> return <EOL> def source ( url , post = None , headers = None , mobile = False , safe = False , timeout = '<STR_LIT>' ) : <EOL> return request ( url , post , headers , mobile , safe , timeout ) <EOL> def cloudflareAgent ( ) : <EOL> return client . randomagent ( ) <EOL> def cloudflareCookie ( url , post , headers , mobile , safe , timeout ) : <EOL> try : <EOL> result = client . request ( url , post = post , headers = headers , mobile = mobile , safe = safe , timeout = timeout , error = True ) <EOL> jschl = re . compile ( '<STR_LIT>' ) . findall ( result ) [ <NUM_LIT:0> ] <EOL> init = re . compile ( '<STR_LIT>' ) . findall ( result ) [ <NUM_LIT:0> ] <EOL> builder = re . compile ( r"<STR_LIT>" ) . findall ( result ) [ <NUM_LIT:0> ] <EOL> decryptVal = parseJSString ( init ) <EOL> lines = builder . split ( '<STR_LIT:;>' ) <EOL> for line in lines : <EOL> if len ( line ) > <NUM_LIT:0> and '<STR_LIT:=>' in line : <EOL> sections = line . split ( '<STR_LIT:=>' ) <EOL> line_val = parseJSString ( sections [ <NUM_LIT:1> ] ) <EOL> decryptVal = int ( eval ( str ( decryptVal ) + sections [ <NUM_LIT:0> ] [ - <NUM_LIT:1> ] + str ( line_val ) ) ) <EOL> answer = decryptVal + len ( urlparse . urlparse ( url ) . netloc ) <EOL> query = '<STR_LIT>' % ( url , jschl , answer ) <EOL> if '<STR_LIT>' in result : <EOL> passval = re . compile ( '<STR_LIT>' ) . findall ( result ) [ <NUM_LIT:0> ] <EOL> query = '<STR_LIT>' % ( url , urllib . quote_plus ( passval ) , jschl , answer ) <EOL> time . sleep ( <NUM_LIT:5> ) <EOL> cookie = client . request ( query , post = post , headers = headers , mobile = mobile , safe = safe , timeout = timeout , output = '<STR_LIT>' , error = True ) <EOL> return cookie <EOL> except : <EOL> pass <EOL> def parseJSString ( s ) : <EOL> try : <EOL> offset = <NUM_LIT:1> if s [ <NUM_LIT:0> ] == '<STR_LIT:+>' else <NUM_LIT:0> <EOL> val = int ( eval ( s . replace ( '<STR_LIT>' , '<STR_LIT:1>' ) . replace ( '<STR_LIT>' , '<STR_LIT:1>' ) . replace ( '<STR_LIT>' , '<STR_LIT:0>' ) . replace ( '<STR_LIT:(>' , '<STR_LIT>' ) [ offset : ] ) ) <EOL> return val <EOL> except : <EOL> pass </s>
