projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[collegehumor] Add support for embedded youtube videos (fixes #2277)
[youtube-dl]
/
youtube_dl
/
extractor
/
toutv.py
diff --git
a/youtube_dl/extractor/toutv.py
b/youtube_dl/extractor/toutv.py
index 7320836177646ee41e6b07acc7b7f4fd726d4491..1e9598ef6d4d7268309fc53d5929088d71cc9cc8 100644
(file)
--- a/
youtube_dl/extractor/toutv.py
+++ b/
youtube_dl/extractor/toutv.py
@@
-1,6
+1,5
@@
# coding: utf-8
import re
# coding: utf-8
import re
-import xml.etree.ElementTree
from .common import InfoExtractor
from ..utils import (
from .common import InfoExtractor
from ..utils import (
@@
-39,13
+38,10
@@
class TouTvIE(InfoExtractor):
mediaId = self._search_regex(
r'"idMedia":\s*"([^"]+)"', webpage, u'media ID')
mediaId = self._search_regex(
r'"idMedia":\s*"([^"]+)"', webpage, u'media ID')
- # TODO test from de
streams_url = u'http://release.theplatform.com/content.select?pid=' + mediaId
streams_url = u'http://release.theplatform.com/content.select?pid=' + mediaId
- streams_
webpage = self._download_webpage
(
+ streams_
doc = self._download_xml
(
streams_url, video_id, note=u'Downloading stream list')
streams_url, video_id, note=u'Downloading stream list')
- streams_doc = xml.etree.ElementTree.fromstring(
- streams_webpage.encode('utf-8'))
video_url = next(n.text
for n in streams_doc.findall('.//choice/url')
if u'//ad.doubleclick' not in n.text)
video_url = next(n.text
for n in streams_doc.findall('.//choice/url')
if u'//ad.doubleclick' not in n.text)