#NEWLINE# def _real_extract( self , url ) : #NEWLINE# #INDENT# m = re . match ( self . _VALID_URL , url ) #NEWLINE# video_id = m . group ( 'id' ) #NEWLINE# webpage = self . _download_webpage ( url , video_id ) #NEWLINE# data_json = self . _search_regex ( "new FM\\.Player\\('[^']+',\\s*(\\{.*?)\\).player;" , webpage , 'json' ) #NEWLINE# data = json . loads ( data_json ) #NEWLINE# uploader = data [ 'info_overlay' ] . get ( 'username' ) #NEWLINE# duration = ( data [ 'video' ] [ 'duration' ] // 1000 ) #NEWLINE# thumbnail = data [ 'video' ] [ 'encodings' ] [ 'sd' ] [ 'poster' ] #NEWLINE# title = data [ 'info_overlay' ] [ 'title' ] #NEWLINE# formats = [ ] #NEWLINE# for ( encoding_id , edata ) in data [ 'video' ] [ 'encodings' ] . items ( ) : #NEWLINE# #INDENT# for src in m [ 'sources' ] : #NEWLINE# #INDENT# width_str = self . _search_regex ( '_([0-9]+)\\.[a-zA-Z0-9]+$' , src [ 'src' ] , False , default = None ) #NEWLINE# vcodec = src [ 'type' ] . partition ( '/' ) [ 2 ] #NEWLINE# formats . append ( { #NEWLINE# #INDENT# 'format_id' : ( ( encoding_id + '-' ) + vcodec ) , #NEWLINE# 'url' : src [ 'src' ] , #NEWLINE# 'vcodec' : vcodec , #NEWLINE# 'width' : int_or_none ( width_str ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# #UNINDENT# self . _sort_formats ( formats ) #NEWLINE# return { #NEWLINE# #INDENT# 'id' : video_id , #NEWLINE# 'title' : title , #NEWLINE# 'formats' : formats , #NEWLINE# 'uploader' : uploader , #NEWLINE# 'duration' : duration , #NEWLINE# 'thumbnail' : thumbnail , #NEWLINE# #UNINDENT# }