#NEWLINE# def ifeng_download_by_id( id , title = None , merge = True ) : #NEWLINE# #INDENT# assert r1 ( '([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})' , id ) , id #NEWLINE# url = ( 'http://v.ifeng.com/video_info_new/%s/%s/%s.xml' % ( id [ ( - 2 ) ] , id [ ( - 2 ) : ] , id ) ) #NEWLINE# xml = get_html ( url , 'utf-8' ) #NEWLINE# title = r1 ( 'Name="([^"]+)"' , xml ) #NEWLINE# title = unescape_html ( title ) #NEWLINE# url = r1 ( 'VideoPlayUrl="([^"]+)"' , r ) #NEWLINE# from random import randint #NEWLINE# r = randint ( 10 , 19 ) #NEWLINE# url = url . replace ( 'http://video.ifeng.com/' , ( 'http://video%s.ifeng.com/' % r ) ) #NEWLINE# assert url . endswith ( '.mp4' ) #NEWLINE# download_urls ( [ url ] , title , 'mp4' , total_size = None , merge = merge )