#NEWLINE# def _real_extract( self , url ) : #NEWLINE# #INDENT# mobj = re . match ( self . _VALID_URL , url ) #NEWLINE# video_id = mobj . group ( 'id' ) #NEWLINE# webpage = self . _download_webpage ( url , video_id ) #NEWLINE# base64_video_info = self . _html_search_regex ( 'var cozVidData = "(.+?)";' , webpage , 'video data' ) #NEWLINE# decoded_video_info = base64 . b64decode ( base64_video_info ) . decode ( 'utf-8' ) #NEWLINE# video_info_dict = json . loads ( decoded_video_info ) #NEWLINE# video_url = video_info_dict [ 'mediaUrl' ] #NEWLINE# description = clean_html ( video_info_dict . get ( 'description' ) ) #NEWLINE# title = video_info_dict [ 'title' ] #NEWLINE# native_platform = video_info_dict [ 'nativePlatform' ] #NEWLINE# native_video_id = video_info_dict [ 'nativeVideoId' ] #NEWLINE# source_priority = video_info_dict [ 'sourcePriority' ] #NEWLINE# if ( native_platform is None ) : #NEWLINE# #INDENT# youtube_url = self . _html_search_regex ( '<iframe.* src="((?:https?:)?//(?:[^.]+\\.)?youtube\\.com/.+?)"' , webpage , 'fallback video URL' , default = None ) #NEWLINE# if ( youtube_url is not None ) : #NEWLINE# #INDENT# return self . url_result ( youtube_url , ie = 'Youtube' ) #NEWLINE# #UNINDENT# #UNINDENT# if ( source_priority == 'native' ) : #NEWLINE# #INDENT# if ( native_platform == 'youtube' ) : #NEWLINE# #INDENT# return self . url_result ( native_video_id , ie = 'Youtube' ) #NEWLINE# #UNINDENT# if ( native_platform == 'vimeo' ) : #NEWLINE# #INDENT# return self . url_result ( ( 'http://vimeo.com/' + native_video_id ) , ie = 'Vimeo' ) #NEWLINE# #UNINDENT# #UNINDENT# if ( not video_url ) : #NEWLINE# #INDENT# raise ExtractorError ( 'No video found' ) #NEWLINE# #UNINDENT# return { #NEWLINE# #INDENT# 'id' : video_id , #NEWLINE# 'url' : video_url , #NEWLINE# 'ext' : 'mp4' , #NEWLINE# 'title' : title , #NEWLINE# 'description' : description , #NEWLINE# #UNINDENT# }