<s> __all__ = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> import re <EOL> import urllib <EOL> from common import * <EOL> import hashlib <EOL> def pptv_download_by_id ( id , merge = True ) : <EOL> xml = get_html ( '<STR_LIT>' % id ) <EOL> xml = xml . decode ( '<STR_LIT:utf-8>' ) <EOL> host = r1 ( r'<STR_LIT>' , xml ) <EOL> port = <NUM_LIT> <EOL> st = r1 ( r'<STR_LIT>' , xml ) <EOL> key = hashlib . md5 ( st ) . hexdigest ( ) <EOL> rids = re . findall ( r'<STR_LIT>' , xml ) <EOL> rid = r1 ( r'<STR_LIT>' , xml ) <EOL> title = r1 ( r'<STR_LIT>' , xml ) <EOL> pieces = re . findall ( '<STR_LIT>' , xml ) <EOL> numbers , fs = zip ( * pieces ) <EOL> urls = [ '<STR_LIT>' % ( host , port , i , rid , key ) for i in numbers ] <EOL> urls = [ '<STR_LIT>' % ( i , rid , key ) for i in numbers ] <EOL> total_size = sum ( map ( int , fs ) ) <EOL> assert rid . endswith ( '<STR_LIT>' ) <EOL> download_urls ( urls , title , '<STR_LIT>' , total_size = total_size , merge = merge ) <EOL> def pptv_download ( url , merge = True ) : <EOL> assert re . match ( r'<STR_LIT>' , url ) <EOL> html = get_html ( url ) <EOL> id = r1 ( r'<STR_LIT>' , html ) <EOL> assert id <EOL> pptv_download_by_id ( id , merge = merge ) <EOL> download = pptv_download <EOL> download_playlist = playlist_not_supported ( '<STR_LIT>' ) <EOL> def main ( ) : <EOL> script_main ( '<STR_LIT>' , pptv_download ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) </s>
