projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[liveleak] Support multiple formats (Fixes #2262)
[youtube-dl]
/
youtube_dl
/
extractor
/
jeuxvideo.py
diff --git
a/youtube_dl/extractor/jeuxvideo.py
b/youtube_dl/extractor/jeuxvideo.py
index 0020c47cfd53a05eb4c719a2d8c203783e97d4e2..caf9d8c85f447cf1a8bee6b53b8e3b72ee2ad6b7 100644
(file)
--- a/
youtube_dl/extractor/jeuxvideo.py
+++ b/
youtube_dl/extractor/jeuxvideo.py
@@
-2,7
+2,6
@@
import json
import re
import json
import re
-import xml.etree.ElementTree
from .common import InfoExtractor
from .common import InfoExtractor
@@
-32,12
+31,9
@@
class JeuxVideoIE(InfoExtractor):
r'http://www\.jeuxvideo\.com/config/\w+/\d+/(.*?)/\d+_player\.xml',
xml_link, u'video ID')
r'http://www\.jeuxvideo\.com/config/\w+/\d+/(.*?)/\d+_player\.xml',
xml_link, u'video ID')
-
xml_config = self._download_webpage
(
+
config = self._download_xml
(
xml_link, title, u'Downloading XML config')
xml_link, title, u'Downloading XML config')
- config = xml.etree.ElementTree.fromstring(xml_config.encode('utf-8'))
- info_json = self._search_regex(
- r'(?sm)<format\.json>(.*?)</format\.json>',
- xml_config, u'JSON information')
+ info_json = config.find('format.json').text
info = json.loads(info_json)['versions'][0]
video_url = 'http://video720.jeuxvideo.com/' + info['file']
info = json.loads(info_json)['versions'][0]
video_url = 'http://video720.jeuxvideo.com/' + info['file']