<s> import re <EOL> from livestreamer . plugin import Plugin <EOL> from livestreamer . plugin . api import http , validate <EOL> from livestreamer . stream import HLSStream <EOL> _url_re = re . compile ( "<STR_LIT>" ) <EOL> _playlist_url_re = re . compile ( "<STR_LIT>" ) <EOL> _schema = validate . Schema ( <EOL> validate . transform ( _playlist_url_re . search ) , <EOL> validate . any ( <EOL> None , <EOL> validate . all ( <EOL> validate . get ( "<STR_LIT:url>" ) , <EOL> validate . url ( <EOL> scheme = "<STR_LIT:http>" , <EOL> path = validate . endswith ( "<STR_LIT>" ) <EOL> ) <EOL> ) <EOL> ) <EOL> ) <EOL> class Chaturbate ( Plugin ) : <EOL> @ classmethod <EOL> def can_handle_url ( self , url ) : <EOL> return _url_re . match ( url ) <EOL> def _get_streams ( self ) : <EOL> playlist_url = http . get ( self . url , schema = _schema ) <EOL> if not playlist_url : <EOL> return <EOL> return HLSStream . parse_variant_playlist ( self . session , playlist_url ) <EOL> __plugin__ = Chaturbate </s>
