<s> from __future__ import unicode_literals <EOL> import re <EOL> from . common import InfoExtractor <EOL> from . . utils import ( <EOL> float_or_none , <EOL> str_to_int , <EOL> parse_duration , <EOL> ) <EOL> class SnotrIE ( InfoExtractor ) : <EOL> _VALID_URL = r'<STR_LIT>' <EOL> _TESTS = [ { <EOL> '<STR_LIT:url>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT:id>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT:title>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : <NUM_LIT> , <EOL> '<STR_LIT>' : <NUM_LIT> , <EOL> '<STR_LIT:description>' : '<STR_LIT>' , <EOL> } <EOL> } , { <EOL> '<STR_LIT:url>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT:id>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT:title>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : <NUM_LIT> , <EOL> '<STR_LIT>' : <NUM_LIT> , <EOL> '<STR_LIT:description>' : '<STR_LIT>' , <EOL> } <EOL> } ] <EOL> def _real_extract ( self , url ) : <EOL> mobj = re . match ( self . _VALID_URL , url ) <EOL> video_id = mobj . group ( '<STR_LIT:id>' ) <EOL> webpage = self . _download_webpage ( url , video_id ) <EOL> title = self . _og_search_title ( webpage ) <EOL> description = self . _og_search_description ( webpage ) <EOL> video_url = "<STR_LIT>" % video_id <EOL> view_count = str_to_int ( self . _html_search_regex ( <EOL> r'<STR_LIT>' , <EOL> webpage , '<STR_LIT>' , fatal = False ) ) <EOL> duration = parse_duration ( self . _html_search_regex ( <EOL> r'<STR_LIT>' , <EOL> webpage , '<STR_LIT>' , fatal = False ) ) <EOL> filesize_approx = float_or_none ( self . _html_search_regex ( <EOL> r'<STR_LIT>' , <EOL> webpage , '<STR_LIT>' , fatal = False ) , invscale = <NUM_LIT> * <NUM_LIT> ) <EOL> return { <EOL> '<STR_LIT:id>' : video_id , <EOL> '<STR_LIT:description>' : description , <EOL> '<STR_LIT:title>' : title , <EOL> '<STR_LIT:url>' : video_url , <EOL> '<STR_LIT>' : view_count , <EOL> '<STR_LIT>' : duration , <EOL> '<STR_LIT>' : filesize_approx , <EOL> } </s>
