diff options
author | sprhawk <465558+sprhawk@users.noreply.github.com> | 2017-12-26 16:46:01 +0800 |
---|---|---|
committer | sprhawk <465558+sprhawk@users.noreply.github.com> | 2017-12-26 16:46:01 +0800 |
commit | 25936512245fc571ab716d59e2d73c50d8cad6ce (patch) | |
tree | 7997a0d1e9d40b9b58ae1b7ad4347e1a5b26f07b /youtube_dl/extractor/weibo.py | |
parent | 951043724f91b3cfce60cf62cc3228a91a04ae81 (diff) |
fix compat_urllib_request for python2.7
Diffstat (limited to 'youtube_dl/extractor/weibo.py')
-rw-r--r-- | youtube_dl/extractor/weibo.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/youtube_dl/extractor/weibo.py b/youtube_dl/extractor/weibo.py index b4ac7b9fa..f8a5ee71c 100644 --- a/youtube_dl/extractor/weibo.py +++ b/youtube_dl/extractor/weibo.py @@ -9,7 +9,7 @@ import re from ..compat import ( compat_urllib_parse_urlencode as urlencode, - compat_urllib_request as Request, + compat_urllib_request as request, compat_urlparse as parse, ) from ..utils import ( @@ -52,11 +52,10 @@ class WeiboIE(InfoExtractor): 'Referer': visitor_url, } - r_genvisitor = Request( + r_genvisitor = request.Request( 'https://passport.weibo.com/visitor/genvisitor', data=data, headers=headers, - method='POST' ) webpage, urlh = self._download_webpage_handle(r_genvisitor, video_id, note="gen visitor") @@ -85,7 +84,7 @@ class WeiboIE(InfoExtractor): # TODO more code goes here, for example ... title = self._html_search_regex(r'<title>(.+?)</title>', webpage, 'title') - video_sources_text = self._search_regex("video-sources=\\\\\"(.+?)\"", webpage, 'video_sources') + video_sources_text = self._search_regex(r'video-sources=\\\"(.+?)\"', webpage, 'video_sources') video_formats = parse.parse_qs(video_sources_text) |