<s> from __future__ import absolute_import <EOL> import re <EOL> import copy <EOL> import xml . etree . ElementTree as ET <EOL> from svtplay_dl . utils . urllib import urlparse <EOL> from svtplay_dl . service import Service <EOL> from svtplay_dl . utils import is_py2_old <EOL> from svtplay_dl . log import log <EOL> from svtplay_dl . fetcher . rtmp import RTMP <EOL> from svtplay_dl . error import ServiceError <EOL> class Hbo ( Service ) : <EOL> supported_domains = [ '<STR_LIT>' ] <EOL> def get ( self ) : <EOL> parse = urlparse ( self . url ) <EOL> try : <EOL> other = parse . fragment <EOL> except KeyError : <EOL> log . error ( "<STR_LIT>" ) <EOL> return <EOL> if self . exclude ( self . options ) : <EOL> yield ServiceError ( "<STR_LIT>" ) <EOL> return <EOL> match = re . search ( "<STR_LIT>" , other ) <EOL> if not match : <EOL> log . error ( "<STR_LIT>" ) <EOL> return <EOL> url = "<STR_LIT>" % match . group ( <NUM_LIT:1> ) <EOL> data = self . http . request ( "<STR_LIT>" , url ) . content <EOL> xml = ET . XML ( data ) <EOL> videoid = xml . find ( "<STR_LIT:content>" ) [ <NUM_LIT:1> ] . find ( "<STR_LIT>" ) . text <EOL> url = "<STR_LIT>" % videoid <EOL> data = self . http . request ( "<STR_LIT>" , url ) . content <EOL> xml = ET . XML ( data ) <EOL> ss = xml . find ( "<STR_LIT>" ) <EOL> if is_py2_old : <EOL> sa = list ( ss . getiterator ( "<STR_LIT:size>" ) ) <EOL> else : <EOL> sa = list ( ss . iter ( "<STR_LIT:size>" ) ) <EOL> for i in sa : <EOL> videourl = i . find ( "<STR_LIT>" ) . find ( "<STR_LIT:path>" ) . text <EOL> match = re . search ( "<STR_LIT>" , videourl ) <EOL> self . options . other = "<STR_LIT>" % videourl [ videourl . index ( match . group ( <NUM_LIT:1> ) ) : ] <EOL> yield RTMP ( copy . copy ( self . options ) , videourl [ : videourl . index ( match . group ( <NUM_LIT:1> ) ) ] , i . attrib [ "<STR_LIT:width>" ] ) </s>
