<s> import re <EOL> from livestreamer . plugin import Plugin <EOL> from livestreamer . stream import RTMPStream <EOL> from livestreamer . plugin . api import http <EOL> _rtmp_re = re . compile ( '<STR_LIT>' ) <EOL> _url_re = re . compile ( "<STR_LIT>" ) <EOL> class LivecodingTV ( Plugin ) : <EOL> @ classmethod <EOL> def can_handle_url ( cls , url ) : <EOL> return _url_re . match ( url ) <EOL> def _get_streams ( self ) : <EOL> res = http . get ( self . url ) <EOL> match = _rtmp_re . search ( res . text ) <EOL> rtmp_url = match . group ( <NUM_LIT:0> ) <EOL> if not match : <EOL> return <EOL> stream = RTMPStream ( self . session , { <EOL> "<STR_LIT>" : rtmp_url , <EOL> "<STR_LIT>" : self . url , <EOL> "<STR_LIT>" : True , <EOL> } ) <EOL> return dict ( live = stream ) <EOL> __plugin__ = LivecodingTV </s>
