Compare commits
8 Commits
2015.02.09
...
2015.02.09
Author | SHA1 | Date | |
---|---|---|---|
f18e3a2fc0 | |||
c4c5dc27cb | |||
2caf182f37 | |||
43f244b6d5 | |||
1309b396d0 | |||
ba61796458 | |||
3255fe7141 | |||
e98b8e79ea |
@ -392,6 +392,7 @@
|
||||
- **StreamCZ**
|
||||
- **StreetVoice**
|
||||
- **SunPorno**
|
||||
- **SVTPlay**
|
||||
- **SWRMediathek**
|
||||
- **Syfy**
|
||||
- **SztvHu**
|
||||
|
@ -1546,7 +1546,6 @@ class YoutubeDL(object):
|
||||
line(f, idlen) for f in formats
|
||||
if f.get('preference') is None or f['preference'] >= -1000]
|
||||
if len(formats) > 1:
|
||||
formats_s[0] += (' ' if self._format_note(formats[0]) else '') + '(worst)'
|
||||
formats_s[-1] += (' ' if self._format_note(formats[-1]) else '') + '(best)'
|
||||
|
||||
header_line = line({
|
||||
|
@ -428,6 +428,7 @@ from .streamcloud import StreamcloudIE
|
||||
from .streamcz import StreamCZIE
|
||||
from .streetvoice import StreetVoiceIE
|
||||
from .sunporno import SunPornoIE
|
||||
from .svtplay import SVTPlayIE
|
||||
from .swrmediathek import SWRMediathekIE
|
||||
from .syfy import SyfyIE
|
||||
from .sztvhu import SztvHuIE
|
||||
|
@ -1047,7 +1047,12 @@ class GenericIE(InfoExtractor):
|
||||
|
||||
# Look for embedded sbs.com.au player
|
||||
mobj = re.search(
|
||||
r'<iframe[^>]+?src=(["\'])(?P<url>https?://(?:www\.)sbs\.com\.au/ondemand/video/single/.+?)\1',
|
||||
r'''(?x)
|
||||
(?:
|
||||
<meta\s+property="og:video"\s+content=|
|
||||
<iframe[^>]+?src=
|
||||
)
|
||||
(["\'])(?P<url>https?://(?:www\.)?sbs\.com\.au/ondemand/video/.+?)\1''',
|
||||
webpage)
|
||||
if mobj is not None:
|
||||
return self.url_result(mobj.group('url'), 'SBS')
|
||||
|
55
youtube_dl/extractor/svtplay.py
Normal file
55
youtube_dl/extractor/svtplay.py
Normal file
@ -0,0 +1,55 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from .common import InfoExtractor
|
||||
from ..utils import (
|
||||
determine_ext,
|
||||
)
|
||||
|
||||
|
||||
class SVTPlayIE(InfoExtractor):
|
||||
_VALID_URL = r'https?://(?:www\.)?svtplay\.se/video/(?P<id>[0-9]+)'
|
||||
_TEST = {
|
||||
'url': 'http://www.svtplay.se/video/2609989/sm-veckan/sm-veckan-rally-final-sasong-1-sm-veckan-rally-final',
|
||||
'md5': '2521cd644e862936cf2e698206e47385',
|
||||
'info_dict': {
|
||||
'id': '3966754',
|
||||
'ext': 'mp4',
|
||||
'title': 'FIFA 14 - E3 2013 Trailer',
|
||||
'duration': 4500,
|
||||
'thumbnail': 're:^https?://.*\.jpg$',
|
||||
},
|
||||
}
|
||||
|
||||
def _real_extract(self, url):
|
||||
video_id = self._match_id(url)
|
||||
info = self._download_json(
|
||||
'http://www.svtplay.se/video/%s?output=json' % video_id, video_id)
|
||||
|
||||
title = info['context']['title']
|
||||
thumbnail = info['context'].get('thumbnailImage')
|
||||
|
||||
video_info = info['video']
|
||||
formats = []
|
||||
for vr in video_info['videoReferences']:
|
||||
vurl = vr['url']
|
||||
if determine_ext(vurl) == 'm3u8':
|
||||
formats.extend(self._extract_m3u8_formats(
|
||||
vurl, video_id,
|
||||
ext='mp4', entry_protocol='m3u8_native',
|
||||
m3u8_id=vr.get('playerType')))
|
||||
else:
|
||||
formats.append({
|
||||
'format_id': vr.get('playerType'),
|
||||
'url': vurl,
|
||||
})
|
||||
self._sort_formats(formats)
|
||||
|
||||
duration = video_info.get('materialLength')
|
||||
|
||||
return {
|
||||
'id': video_id,
|
||||
'title': title,
|
||||
'formats': formats,
|
||||
'thumbnail': thumbnail,
|
||||
'duration': duration,
|
||||
}
|
@ -1,40 +1,55 @@
|
||||
# coding: utf-8
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import json
|
||||
import re
|
||||
|
||||
from .common import InfoExtractor
|
||||
from ..utils import ExtractorError
|
||||
|
||||
|
||||
class TriluliluIE(InfoExtractor):
|
||||
_VALID_URL = r'https?://(?:www\.)?trilulilu\.ro/video-[^/]+/(?P<id>[^/]+)'
|
||||
_VALID_URL = r'https?://(?:www\.)?trilulilu\.ro/(?:video-[^/]+/)?(?P<id>[^/#\?]+)'
|
||||
_TEST = {
|
||||
'url': 'http://www.trilulilu.ro/video-animatie/big-buck-bunny-1',
|
||||
'md5': 'c1450a00da251e2769b74b9005601cac',
|
||||
'info_dict': {
|
||||
'id': 'big-buck-bunny-1',
|
||||
'id': 'ae2899e124140b',
|
||||
'ext': 'mp4',
|
||||
'title': 'Big Buck Bunny',
|
||||
'description': ':) pentru copilul din noi',
|
||||
},
|
||||
# Server ignores Range headers (--test)
|
||||
'params': {
|
||||
'skip_download': True
|
||||
}
|
||||
}
|
||||
|
||||
def _real_extract(self, url):
|
||||
video_id = self._match_id(url)
|
||||
webpage = self._download_webpage(url, video_id)
|
||||
display_id = self._match_id(url)
|
||||
webpage = self._download_webpage(url, display_id)
|
||||
|
||||
if re.search(r'Fişierul nu este disponibil pentru vizionare în ţara dumneavoastră', webpage):
|
||||
raise ExtractorError(
|
||||
'This video is not available in your country.', expected=True)
|
||||
elif re.search('Fişierul poate fi accesat doar de către prietenii lui', webpage):
|
||||
raise ExtractorError('This video is private.', expected=True)
|
||||
|
||||
flashvars_str = self._search_regex(
|
||||
r'block_flash_vars\s*=\s*(\{[^\}]+\})', webpage, 'flashvars', fatal=False, default=None)
|
||||
|
||||
if flashvars_str:
|
||||
flashvars = self._parse_json(flashvars_str, display_id)
|
||||
else:
|
||||
raise ExtractorError(
|
||||
'This page does not contain videos', expected=True)
|
||||
|
||||
if flashvars['isMP3'] == 'true':
|
||||
raise ExtractorError(
|
||||
'Audio downloads are currently not supported', expected=True)
|
||||
|
||||
video_id = flashvars['hash']
|
||||
title = self._og_search_title(webpage)
|
||||
thumbnail = self._og_search_thumbnail(webpage)
|
||||
description = self._og_search_description(webpage)
|
||||
|
||||
log_str = self._search_regex(
|
||||
r'block_flash_vars[ ]=[ ]({[^}]+})', webpage, 'log info')
|
||||
log = json.loads(log_str)
|
||||
description = self._og_search_description(webpage, default=None)
|
||||
|
||||
format_url = ('http://fs%(server)s.trilulilu.ro/%(hash)s/'
|
||||
'video-formats2' % log)
|
||||
'video-formats2' % flashvars)
|
||||
format_doc = self._download_xml(
|
||||
format_url, video_id,
|
||||
note='Downloading formats',
|
||||
@ -44,10 +59,10 @@ class TriluliluIE(InfoExtractor):
|
||||
'http://fs%(server)s.trilulilu.ro/stream.php?type=video'
|
||||
'&source=site&hash=%(hash)s&username=%(userid)s&'
|
||||
'key=ministhebest&format=%%s&sig=&exp=' %
|
||||
log)
|
||||
flashvars)
|
||||
formats = [
|
||||
{
|
||||
'format': fnode.text,
|
||||
'format_id': fnode.text.partition('-')[2],
|
||||
'url': video_url_template % fnode.text,
|
||||
'ext': fnode.text.partition('-')[0]
|
||||
}
|
||||
@ -56,8 +71,8 @@ class TriluliluIE(InfoExtractor):
|
||||
]
|
||||
|
||||
return {
|
||||
'_type': 'video',
|
||||
'id': video_id,
|
||||
'display_id': display_id,
|
||||
'formats': formats,
|
||||
'title': title,
|
||||
'description': description,
|
||||
|
@ -780,8 +780,9 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
|
||||
fo for fo in formats
|
||||
if fo['format_id'] == format_id)
|
||||
except StopIteration:
|
||||
f.update(self._formats.get(format_id, {}).items())
|
||||
formats.append(f)
|
||||
full_info = self._formats.get(format_id, {}).copy()
|
||||
full_info.update(f)
|
||||
formats.append(full_info)
|
||||
else:
|
||||
existing_format.update(f)
|
||||
return formats
|
||||
|
@ -1,3 +1,3 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
__version__ = '2015.02.09.1'
|
||||
__version__ = '2015.02.09.3'
|
||||
|
Reference in New Issue
Block a user