projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[compat] compat_etree_fromstring: only decode bytes objects
[youtube-dl]
/
youtube_dl
/
extractor
/
srf.py
diff --git
a/youtube_dl/extractor/srf.py
b/youtube_dl/extractor/srf.py
index e303516027cf9f941a2510d84cd7620cd9bf4231..77eec0bc737885e22c77fd8fd3f97bb57ff31ec8 100644
(file)
--- a/
youtube_dl/extractor/srf.py
+++ b/
youtube_dl/extractor/srf.py
@@
-11,7
+11,7
@@
from ..utils import (
class SrfIE(InfoExtractor):
class SrfIE(InfoExtractor):
- _VALID_URL = r'http
://www\.srf\.ch/play(?:er)?/tv/[^/]+/video/(?P<display_id>[^?]+)\?id=
(?P<id>[0-9a-f\-]{36})'
+ _VALID_URL = r'http
s?://(?:www\.srf\.ch/play(?:er)?/tv/[^/]+/video/(?P<display_id>[^?]+)\?id=|tp\.srgssr\.ch/p/flash\?urn=urn:srf:ais:video:)
(?P<id>[0-9a-f\-]{36})'
_TESTS = [{
'url': 'http://www.srf.ch/play/tv/10vor10/video/snowden-beantragt-asyl-in-russland?id=28e1a57d-5b76-4399-8ab3-9097f071e6c5',
'md5': '4cd93523723beff51bb4bee974ee238d',
_TESTS = [{
'url': 'http://www.srf.ch/play/tv/10vor10/video/snowden-beantragt-asyl-in-russland?id=28e1a57d-5b76-4399-8ab3-9097f071e6c5',
'md5': '4cd93523723beff51bb4bee974ee238d',
@@
-38,16
+38,19
@@
class SrfIE(InfoExtractor):
}, {
'url': 'http://www.srf.ch/player/tv/10vor10/video/snowden-beantragt-asyl-in-russland?id=28e1a57d-5b76-4399-8ab3-9097f071e6c5',
'only_matching': True,
}, {
'url': 'http://www.srf.ch/player/tv/10vor10/video/snowden-beantragt-asyl-in-russland?id=28e1a57d-5b76-4399-8ab3-9097f071e6c5',
'only_matching': True,
+ }, {
+ 'url': 'https://tp.srgssr.ch/p/flash?urn=urn:srf:ais:video:28e1a57d-5b76-4399-8ab3-9097f071e6c5',
+ 'only_matching': True,
}]
def _real_extract(self, url):
video_id = self._match_id(url)
}]
def _real_extract(self, url):
video_id = self._match_id(url)
+ display_id = re.match(self._VALID_URL, url).group('display_id') or video_id
video_data = self._download_xml(
'http://il.srgssr.ch/integrationlayer/1.0/ue/srf/video/play/%s.xml' % video_id,
video_data = self._download_xml(
'http://il.srgssr.ch/integrationlayer/1.0/ue/srf/video/play/%s.xml' % video_id,
-
video
_id)
+
display
_id)
- display_id = re.match(self._VALID_URL, url).group('display_id')
title = xpath_text(
video_data, './AssetMetadatas/AssetMetadata/title', fatal=True)
thumbnails = [{
title = xpath_text(
video_data, './AssetMetadatas/AssetMetadata/title', fatal=True)
thumbnails = [{
@@
-65,10
+68,10
@@
class SrfIE(InfoExtractor):
format_id = '%s-%s' % (quality, item.attrib['protocol'])
if original_ext == 'f4m':
formats.extend(self._extract_f4m_formats(
format_id = '%s-%s' % (quality, item.attrib['protocol'])
if original_ext == 'f4m':
formats.extend(self._extract_f4m_formats(
- full_url + '?hdcore=3.4.0',
video
_id, f4m_id=format_id))
+ full_url + '?hdcore=3.4.0',
display
_id, f4m_id=format_id))
elif original_ext == 'm3u8':
formats.extend(self._extract_m3u8_formats(
elif original_ext == 'm3u8':
formats.extend(self._extract_m3u8_formats(
- full_url,
video
_id, 'mp4', m3u8_id=format_id))
+ full_url,
display
_id, 'mp4', m3u8_id=format_id))
else:
formats.append({
'url': full_url,
else:
formats.append({
'url': full_url,