rephrased my code a little.

This commit is contained in:
M.Yasoob Khalid 2013-06-06 12:28:18 +05:00
parent fd133bfffa
commit c56102dd16

View File

@ -4494,19 +4494,14 @@ class HypemIE(InfoExtractor):
data = {'ax':1 , data = {'ax':1 ,
'ts': time.time() 'ts': time.time()
} }
id = mobj.group(1)
data_encoded = compat_urllib_parse.urlencode(data) data_encoded = compat_urllib_parse.urlencode(data)
complete_url = url + "?"+data_encoded complete_url = url + "?"+data_encoded
request = compat_urllib_request.Request(complete_url) request = compat_urllib_request.Request(complete_url)
response = compat_urllib_request.urlopen(request) response,urlh = self._download_webpage_handle(request, id, u'Downloading webpage with the url')
#save our cookie cookie = urlh.headers.get('Set-Cookie', '')
cookie = response.headers.get('Set-Cookie')
encoding = response.headers.get('Content-Type')
encoding = (encoding.split(';')[1]).split('=')[1]
#grab the HTML
html = response.read().decode(encoding)
response.close()
track_list = [] track_list = []
list_data = re.search(r'<script type="application/json" id="displayList-data">\n (.*) </script>',html) list_data = re.search(r'<script type="application/json" id="displayList-data">\n (.*) </script>',response)
html_tracks = list_data.group(1) html_tracks = list_data.group(1)
if html_tracks is None: if html_tracks is None:
tracks = track_list tracks = track_list