aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-10-08 20:21:07 +0600
committerSergey M․ <dstftw@gmail.com>2015-10-08 21:05:27 +0600
commit96c48553317cf28ea92d7feaa5701e3ebd93ea25 (patch)
treedd379ee5627a959c18b3bd960f854d9c71f8533c
parentb90b0c4ffa6f84a2ea5556d4df99de5f8ef2c7dd (diff)
[4tube] Style and make more robust
-rw-r--r--youtube_dl/extractor/fourtube.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/youtube_dl/extractor/fourtube.py b/youtube_dl/extractor/fourtube.py
index 226ee67f0..406387e57 100644
--- a/youtube_dl/extractor/fourtube.py
+++ b/youtube_dl/extractor/fourtube.py
@@ -66,8 +66,11 @@ class FourTubeIE(InfoExtractor):
webpage, 'like count', fatal=False))
duration = parse_duration(self._html_search_meta('duration', webpage))
- player_url = self._search_regex(r'<script id="playerembed" src="([^"]+)">',webpage,'player javascript')
- player_js = self._download_webpage(player_url,video_id,'Downloading player Javascript')
+ player_js = self._download_webpage(
+ self._search_regex(
+ r'<script[^>]id=(["\'])playerembed\1[^>]+src=(["\'])(?P<url>.+?)\2',
+ webpage, 'player JS', group='url'),
+ video_id, 'Downloading player JS')
params_js = self._search_regex(
r'\$\.ajax\(url,\ opts\);\s*\}\s*\}\)\(([0-9,\[\] ]+)\)',