projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
898c23c
)
[videomega] Fix extraction (Closes #4763)
author
Naglis Jonaitis
<njonaitis@gmail.com>
Thu, 22 Jan 2015 16:35:53 +0000
(18:35 +0200)
committer
Naglis Jonaitis
<njonaitis@gmail.com>
Thu, 22 Jan 2015 16:36:49 +0000
(18:36 +0200)
youtube_dl/extractor/videomega.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/videomega.py
b/youtube_dl/extractor/videomega.py
index 9fc64d172e63ecb15469efc2a2085d8bccc06e53..fc6e05fe0a2d60f42b1f5eef6d2d2e90994f86b7 100644
(file)
--- a/
youtube_dl/extractor/videomega.py
+++ b/
youtube_dl/extractor/videomega.py
@@
-1,12
+1,15
@@
# coding: utf-8
from __future__ import unicode_literals
# coding: utf-8
from __future__ import unicode_literals
+import re
+
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urllib_request,
)
from ..utils import (
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urllib_request,
)
from ..utils import (
+ ExtractorError,
remove_start,
)
remove_start,
)
@@
-35,8
+38,11
@@
class VideoMegaIE(InfoExtractor):
req.add_header('Referer', url)
webpage = self._download_webpage(req, video_id)
req.add_header('Referer', url)
webpage = self._download_webpage(req, video_id)
- escaped_data = self._search_regex(
- r'unescape\("([^"]+)"\)', webpage, 'escaped data')
+ try:
+ escaped_data = re.findall(r'unescape\("([^"]+)"\)', webpage)[-1]
+ except IndexError:
+ raise ExtractorError('Unable to extract escaped data')
+
playlist = compat_urllib_parse.unquote(escaped_data)
thumbnail = self._search_regex(
playlist = compat_urllib_parse.unquote(escaped_data)
thumbnail = self._search_regex(