mirror of
https://github.com/ytdl-org/youtube-dl
synced 2025-03-17 13:32:21 +09:00
added the decoding of the response (for python 3)
This commit is contained in:
parent
a89c45ef53
commit
b8e189f1de
@ -4500,11 +4500,13 @@ class HypemIE(InfoExtractor):
|
|||||||
response = compat_urllib_request.urlopen(request)
|
response = compat_urllib_request.urlopen(request)
|
||||||
#save our cookie
|
#save our cookie
|
||||||
cookie = response.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
|
#grab the HTML
|
||||||
html = response.read()
|
html = response.read().decode(encoding)
|
||||||
response.close()
|
response.close()
|
||||||
track_list = []
|
track_list = []
|
||||||
list_data = re.search(b'<script type="application/json" id="displayList-data">\n (.*) </script>',html)
|
list_data = re.search(r'<script type="application/json" id="displayList-data">\n (.*) </script>',html)
|
||||||
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
|
||||||
|
Loading…
Reference in New Issue
Block a user