diff options
author | Yen Chi Hsuan <yan12125@gmail.com> | 2015-03-03 23:17:19 +0800 |
---|---|---|
committer | Yen Chi Hsuan <yan12125@gmail.com> | 2015-03-03 23:20:55 +0800 |
commit | 63fc80005782430180ed0d13ac6ab5ca497d333a (patch) | |
tree | c9af7b135ef641cfa54953b783136695978fd10d /youtube_dl | |
parent | 7fde87c77da41f24faf34b37f5d05c029ac23d4f (diff) | |
download | youtube-dl-63fc80005782430180ed0d13ac6ab5ca497d333a.tar.xz |
[Letv] Fix test_Letv and test_Letv_1 failures in python 3
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/extractor/letv.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/youtube_dl/extractor/letv.py b/youtube_dl/extractor/letv.py index 85eee141b..9ed81a199 100644 --- a/youtube_dl/extractor/letv.py +++ b/youtube_dl/extractor/letv.py @@ -88,9 +88,10 @@ class LetvIE(InfoExtractor): play_json_req = compat_urllib_request.Request( 'http://api.letv.com/mms/out/video/playJson?' + compat_urllib_parse.urlencode(params) ) - play_json_req.add_header( - 'Ytdl-request-proxy', - self._downloader.params.get('cn_verification_proxy')) + cn_verification_proxy = self._downloader.params.get('cn_verification_proxy') + if cn_verification_proxy: + play_json_req.add_header('Ytdl-request-proxy', cn_verification_proxy) + play_json = self._download_json( play_json_req, media_id, 'playJson data') |