#NEWLINE# def _real_extract( self , url ) : #NEWLINE# #INDENT# video_id = self . _match_id ( url ) #NEWLINE# page = self . _download_webpage ( url , video_id , 'Downloading page' ) #NEWLINE# if ( re . search ( '>Video Not Found or Deleted<' , page ) is not None ) : #NEWLINE# #INDENT# raise ExtractorError ( ( 'Video %s does not exist' % video_id ) , expected = True ) #NEWLINE# #UNINDENT# hash_key = self . _html_search_regex ( '<input type="hidden" name="hash" value="([^"]+)">' , page , 'hash' ) #NEWLINE# title = self . _html_search_regex ( '(?m)<div class="blockTitle">\\s*<h2>Watch ([^<]+)</h2>' , page , 'title' ) #NEWLINE# download_form = { #NEWLINE# #INDENT# 'op' : 'download1' , #NEWLINE# 'id' : video_id , #NEWLINE# 'hash' : hash_key , #NEWLINE# #UNINDENT# } #NEWLINE# request = compat_urllib_request . Request ( ( 'http://mooshare.biz/%s' % video_id ) , compat_urllib_parse . urlencode ( download_form ) ) #NEWLINE# request . add_header ( 'Content-Type' , 'application/x-www-form-urlencoded' ) #NEWLINE# self . _sleep ( 5 , video_id ) #NEWLINE# video_page = self . _download_webpage ( request , video_id , 'Downloading video page' ) #NEWLINE# thumbnail = self . _html_search_regex ( 'image:\\s*"([^"]+)",' , video_page , 'thumbnail' , fatal = False ) #NEWLINE# duration_str = self . _html_search_regex ( 'duration:\\s*"(\\d+)",' , video_page , 'duration' , fatal = False ) #NEWLINE# duration = ( int ( duration_str ) if ( duration_str is not None ) else None ) #NEWLINE# formats = [ ] #NEWLINE# mobj = re . search ( '(?m)file:\\s*"(?P<url>[^"]+)",\\s*provider:' , video_page ) #NEWLINE# if ( mobj is not None ) : #NEWLINE# #INDENT# formats . append ( { #NEWLINE# #INDENT# 'url' : mobj . group ( 'url' ) , #NEWLINE# 'format_id' : 'sd' , #NEWLINE# 'format' : 'SD' , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# mobj = re . search ( "\\'hd-2\\': { file: \\'(?P<url>[^\\']+)\\' }," , video_page ) #NEWLINE# if ( mobj is not None ) : #NEWLINE# #INDENT# formats . append ( { #NEWLINE# #INDENT# 'url' : mobj . group ( 'url' ) , #NEWLINE# 'format_id' : 'hd' , #NEWLINE# 'format' : 'HD' , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# mobj = re . search ( '(?m)file: "(?P<playpath>[^"]+)",\\s*streamer: "(?P<rtmpurl>rtmp://[^"]+)",' , video_page ) #NEWLINE# if ( mobj is not None ) : #NEWLINE# #INDENT# formats . append ( { #NEWLINE# #INDENT# 'url' : mobj . group ( 'rtmpurl' ) , #NEWLINE# 'play_path' : mobj . group ( 'playpath' ) , #NEWLINE# 'rtmp_live' : False , #NEWLINE# 'ext' : 'mp4' , #NEWLINE# 'format_id' : 'rtmp' , #NEWLINE# 'format' : 'HD' , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# return { #NEWLINE# #INDENT# 'id' : video_id , #NEWLINE# 'title' : title , #NEWLINE# 'thumbnail' : thumbnail , #NEWLINE# 'duration' : duration , #NEWLINE# 'formats' : formats , #NEWLINE# #UNINDENT# }