#NEWLINE# def flickr_download( url , output_dir = '.' , merge = True , info_only = False , **kwargs ) : #NEWLINE# #INDENT# page = get_html ( url ) #NEWLINE# title = match1 ( page , '<meta property="og:title" content="([^"]*)"' ) #NEWLINE# photo_id = match1 ( page , '"id":"([0-9]+)"' ) #NEWLINE# try : #NEWLINE# #INDENT# html = get_html ( ( 'https://secure.flickr.com/apps/video/video_mtl_xml.gne?photo_id=%s' % photo_id ) ) #NEWLINE# node_id = match1 ( html , '<Item id="id">(.+)</Item>' ) #NEWLINE# secret = match1 ( html , '<Item id="photo_secret">(.+)</Item>' ) #NEWLINE# html = get_html ( ( 'https://secure.flickr.com/video_playlist.gne?node_id=%s&secret=%s' % ( node_id , secret ) ) ) #NEWLINE# app = match1 ( html , 'APP="([^"]+)"' ) #NEWLINE# fullpath = unescape_html ( match1 ( html , 'FULLPATH="([^"]+)"' ) ) #NEWLINE# url = ( app + fullpath ) #NEWLINE# ( mime , ext , size ) = url_info ( url ) #NEWLINE# print_info ( site_info , title , mime , size ) #NEWLINE# if ( not info_only ) : #NEWLINE# #INDENT# download_urls ( [ url ] , title , node_id , size , output_dir , merge = merge , faker = True ) #NEWLINE# #UNINDENT# #UNINDENT# except : #NEWLINE# #INDENT# image = match1 ( page , '<meta property="og:image" content="([^"]*)' ) #NEWLINE# ext = 'jpg' #NEWLINE# ( _ , _ , size ) = url_info ( image ) #NEWLINE# print_info ( site_info , title , ext , size ) #NEWLINE# if ( not info_only ) : #NEWLINE# #INDENT# download_urls ( [ image ] , title , ext , size , output_dir , merge = merge )