projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e93f4f7
)
[vimple] Simplify and PEP8
author
Philipp Hagemeister
<phihag@phihag.de>
Fri, 11 Jul 2014 09:11:09 +0000
(11:11 +0200)
committer
Philipp Hagemeister
<phihag@phihag.de>
Fri, 11 Jul 2014 09:11:09 +0000
(11:11 +0200)
youtube_dl/extractor/vimple.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/vimple.py
b/youtube_dl/extractor/vimple.py
index 86344849a4fd5518375014af7dad6eb925729cc0..33d370e1ceb1f0d6db418c8575830ac60d4294a4 100644
(file)
--- a/
youtube_dl/extractor/vimple.py
+++ b/
youtube_dl/extractor/vimple.py
@@
-1,10
+1,10
@@
# coding: utf-8
from __future__ import unicode_literals
# coding: utf-8
from __future__ import unicode_literals
-import re
-import zlib
import base64
import base64
+import re
import xml.etree.ElementTree
import xml.etree.ElementTree
+import zlib
from .common import InfoExtractor
from ..utils import int_or_none
from .common import InfoExtractor
from ..utils import int_or_none
@@
-38,21
+38,21
@@
class VimpleIE(InfoExtractor):
},
]
},
]
- # http://jsunpack-n.googlecode.com/svn-history/r63/trunk/swf.py
-
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('id')
iframe_url = 'http://player.vimple.ru/iframe/%s' % video_id
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('id')
iframe_url = 'http://player.vimple.ru/iframe/%s' % video_id
- iframe = self._download_webpage(iframe_url, video_id, note='Downloading iframe', errnote='unable to fetch iframe')
- player_url = self._html_search_regex(r'"(http://player.vimple.ru/flash/.+?)"', iframe, 'player url')
+ iframe = self._download_webpage(
+ iframe_url, video_id,
+ note='Downloading iframe', errnote='unable to fetch iframe')
+ player_url = self._html_search_regex(
+ r'"(http://player.vimple.ru/flash/.+?)"', iframe, 'player url')
- player = self._request_webpage(player_url, video_id, note='Downloading swf player').read()
+ player = self._request_webpage(
+ player_url, video_id, note='Downloading swf player').read()
- # http://stackoverflow.com/a/6804758
- # http://stackoverflow.com/a/12073686
player = zlib.decompress(player[8:])
xml_pieces = re.findall(b'([a-zA-Z0-9 =+/]{500})', player)
player = zlib.decompress(player[8:])
xml_pieces = re.findall(b'([a-zA-Z0-9 =+/]{500})', player)