aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/iqiyi.py
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2015-06-07 00:56:08 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2015-06-07 00:56:08 +0800
commit29e7e0781b1b8e276c28a079bc5b18e1b0db2d5e (patch)
tree7b4ca07b14dd2185ef99cdd9b1e61e07fc019223 /youtube_dl/extractor/iqiyi.py
parent7012620e2b9355d25ddfc855fc5990af938f04d8 (diff)
[iqiyi] Simplify and improve regex patterns
See the comments in #5849
Diffstat (limited to 'youtube_dl/extractor/iqiyi.py')
-rw-r--r--youtube_dl/extractor/iqiyi.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/youtube_dl/extractor/iqiyi.py b/youtube_dl/extractor/iqiyi.py
index 5645fb6ee..18a7587a2 100644
--- a/youtube_dl/extractor/iqiyi.py
+++ b/youtube_dl/extractor/iqiyi.py
@@ -161,12 +161,11 @@ class IqiyiIE(InfoExtractor):
webpage = self._download_webpage(
url, 'temp_id', note='download video page')
tvid = self._search_regex(
- r'tvId ?= ?(\'|\")(?P<tvid>\d+)', webpage, 'tvid', flags=re.I, group='tvid')
+ r'data-player-tvid\s*=\s*[\'"](\d+)', webpage, 'tvid')
video_id = self._search_regex(
- r'videoId ?= ?(\'|\")(?P<video_id>[a-z\d]+)',
- webpage, 'video_id', flags=re.I, group='video_id')
+ r'data-player-videoid\s*=\s*[\'"]([a-f\d]+)', webpage, 'video_id')
swf_url = self._search_regex(
- r'(?P<swf>http://.+?MainPlayer.+?\.swf)', webpage, 'swf')
+ r'(http://.+?MainPlayer.+?\.swf)', webpage, 'swf player URL')
_uuid = uuid.uuid4().hex
enc_key = self.get_enc_key(swf_url, video_id)