<s> from . . common import * <EOL> from . . extractor import VideoExtractor <EOL> import ssl <EOL> class Videomega ( VideoExtractor ) : <EOL> name = "<STR_LIT>" <EOL> stream_types = [ <EOL> { '<STR_LIT:id>' : '<STR_LIT>' } <EOL> ] <EOL> def prepare ( self , ** kwargs ) : <EOL> ssl_context = request . HTTPSHandler ( <EOL> context = ssl . SSLContext ( ssl . PROTOCOL_TLSv1 ) ) <EOL> cookie_handler = request . HTTPCookieProcessor ( ) <EOL> opener = request . build_opener ( ssl_context , cookie_handler ) <EOL> opener . addheaders = [ ( '<STR_LIT>' , self . url ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) ] <EOL> request . install_opener ( opener ) <EOL> ref = match1 ( self . url , r'<STR_LIT>' ) <EOL> php_url = '<STR_LIT>' + ref <EOL> content = get_content ( php_url ) <EOL> self . title = match1 ( content , r'<STR_LIT>' ) <EOL> js = match1 ( content , r'<STR_LIT>' ) <EOL> t = match1 ( js , r'<STR_LIT>' ) <EOL> t = re . sub ( r'<STR_LIT>' , r'<STR_LIT>' , t ) <EOL> t = t . translate ( { <NUM_LIT> + i : str ( i ) for i in range ( <NUM_LIT:10> , <NUM_LIT> ) } ) <EOL> s = match1 ( js , r"<STR_LIT>" ) . split ( '<STR_LIT:|>' ) <EOL> self . streams [ '<STR_LIT>' ] = { <EOL> '<STR_LIT:url>' : t . format ( * s ) <EOL> } <EOL> def extract ( self , ** kwargs ) : <EOL> for i in self . streams : <EOL> s = self . streams [ i ] <EOL> _ , s [ '<STR_LIT>' ] , s [ '<STR_LIT:size>' ] = url_info ( s [ '<STR_LIT:url>' ] ) <EOL> s [ '<STR_LIT:src>' ] = [ s [ '<STR_LIT:url>' ] ] <EOL> site = Videomega ( ) <EOL> download = site . download_by_url <EOL> download_playlist = site . download_by_url </s>
