1
0
Fork 0
mirror of https://gitlab.com/dstftw/youtube-dl.git synced 2020-11-16 09:42:26 +00:00

[hypem] Correctly handle cookies (Closes #7762)

This commit is contained in:
Sergey M․ 2015-12-05 20:42:21 +06:00
parent 38d05d17e5
commit ea14422ff1

View file

@ -33,7 +33,6 @@ class HypemIE(InfoExtractor):
request = sanitized_Request(complete_url) request = sanitized_Request(complete_url)
response, urlh = self._download_webpage_handle( response, urlh = self._download_webpage_handle(
request, track_id, 'Downloading webpage with the url') request, track_id, 'Downloading webpage with the url')
cookie = urlh.headers.get('Set-Cookie', '')
html_tracks = self._html_search_regex( html_tracks = self._html_search_regex(
r'(?ms)<script type="application/json" id="displayList-data">\s*(.*?)\s*</script>', r'(?ms)<script type="application/json" id="displayList-data">\s*(.*?)\s*</script>',
@ -52,7 +51,6 @@ class HypemIE(InfoExtractor):
serve_url = "http://hypem.com/serve/source/%s/%s" % (track_id, key) serve_url = "http://hypem.com/serve/source/%s/%s" % (track_id, key)
request = sanitized_Request( request = sanitized_Request(
serve_url, '', {'Content-Type': 'application/json'}) serve_url, '', {'Content-Type': 'application/json'})
request.add_header('cookie', cookie)
song_data = self._download_json(request, track_id, 'Downloading metadata') song_data = self._download_json(request, track_id, 'Downloading metadata')
final_url = song_data["url"] final_url = song_data["url"]