<s> '''<STR_LIT>''' <EOL> import re , urllib <EOL> from resources . lib . libraries import client <EOL> from resources . lib . libraries import jsunpack <EOL> def resolve ( url ) : <EOL> try : <EOL> url = url . replace ( '<STR_LIT>' , '<STR_LIT:/>' ) <EOL> url = re . compile ( '<STR_LIT>' ) . findall ( url ) [ <NUM_LIT:0> ] <EOL> url = '<STR_LIT>' % url <EOL> result = client . request ( url , close = False ) <EOL> post = { } <EOL> f = client . parseDOM ( result , '<STR_LIT>' , attrs = { '<STR_LIT>' : '<STR_LIT:POST>' } ) [ <NUM_LIT:0> ] <EOL> k = client . parseDOM ( f , '<STR_LIT:input>' , ret = '<STR_LIT:name>' , attrs = { '<STR_LIT:type>' : '<STR_LIT>' } ) <EOL> for i in k : post . update ( { i : client . parseDOM ( f , '<STR_LIT:input>' , ret = '<STR_LIT:value>' , attrs = { '<STR_LIT:name>' : i } ) [ <NUM_LIT:0> ] } ) <EOL> post = post <EOL> result = client . request ( url , post = post ) <EOL> result = re . compile ( '<STR_LIT>' ) . findall ( result ) [ - <NUM_LIT:1> ] <EOL> result = jsunpack . unpack ( result ) <EOL> url = client . parseDOM ( result , '<STR_LIT>' , ret = '<STR_LIT:src>' ) <EOL> url += re . compile ( "<STR_LIT>" ) . findall ( result ) <EOL> url = [ i for i in url if not i . endswith ( '<STR_LIT>' ) ] <EOL> url = '<STR_LIT>' + url [ <NUM_LIT:0> ] . split ( '<STR_LIT>' , <NUM_LIT:1> ) [ - <NUM_LIT:1> ] <EOL> return url <EOL> except : <EOL> return </s>
