Merge remote-tracking branch 'upstream/master' into pornflip
This commit is contained in:
commit
21def918c8
@ -82,6 +82,10 @@ class LiveLeakIE(InfoExtractor):
|
|||||||
}, {
|
}, {
|
||||||
'url': 'https://www.liveleak.com/view?t=HvHi_1523016227',
|
'url': 'https://www.liveleak.com/view?t=HvHi_1523016227',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
|
}, {
|
||||||
|
# No original video
|
||||||
|
'url': 'https://www.liveleak.com/view?t=C26ZZ_1558612804',
|
||||||
|
'only_matching': True,
|
||||||
}]
|
}]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -134,11 +138,13 @@ class LiveLeakIE(InfoExtractor):
|
|||||||
orig_url = re.sub(r'\.mp4\.[^.]+', '', a_format['url'])
|
orig_url = re.sub(r'\.mp4\.[^.]+', '', a_format['url'])
|
||||||
if a_format['url'] != orig_url:
|
if a_format['url'] != orig_url:
|
||||||
format_id = a_format.get('format_id')
|
format_id = a_format.get('format_id')
|
||||||
formats.append({
|
format_id = 'original' + ('-' + format_id if format_id else '')
|
||||||
'format_id': 'original' + ('-' + format_id if format_id else ''),
|
if self._is_valid_url(orig_url, video_id, format_id):
|
||||||
'url': orig_url,
|
formats.append({
|
||||||
'preference': 1,
|
'format_id': format_id,
|
||||||
})
|
'url': orig_url,
|
||||||
|
'preference': 1,
|
||||||
|
})
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
info_dict['formats'] = formats
|
info_dict['formats'] = formats
|
||||||
|
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import re
|
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
|
from ..utils import (
|
||||||
|
determine_ext,
|
||||||
|
js_to_json,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class RTPIE(InfoExtractor):
|
class RTPIE(InfoExtractor):
|
||||||
@ -18,10 +20,6 @@ class RTPIE(InfoExtractor):
|
|||||||
'description': 'As paixões musicais de António Cartaxo e António Macedo',
|
'description': 'As paixões musicais de António Cartaxo e António Macedo',
|
||||||
'thumbnail': r're:^https?://.*\.jpg',
|
'thumbnail': r're:^https?://.*\.jpg',
|
||||||
},
|
},
|
||||||
'params': {
|
|
||||||
# rtmp download
|
|
||||||
'skip_download': True,
|
|
||||||
},
|
|
||||||
}, {
|
}, {
|
||||||
'url': 'http://www.rtp.pt/play/p831/a-quimica-das-coisas',
|
'url': 'http://www.rtp.pt/play/p831/a-quimica-das-coisas',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
@ -33,57 +31,36 @@ class RTPIE(InfoExtractor):
|
|||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
title = self._html_search_meta(
|
title = self._html_search_meta(
|
||||||
'twitter:title', webpage, display_name='title', fatal=True)
|
'twitter:title', webpage, display_name='title', fatal=True)
|
||||||
description = self._html_search_meta('description', webpage)
|
|
||||||
thumbnail = self._og_search_thumbnail(webpage)
|
|
||||||
|
|
||||||
player_config = self._search_regex(
|
config = self._parse_json(self._search_regex(
|
||||||
r'(?s)RTPPLAY\.player\.newPlayer\(\s*(\{.*?\})\s*\)', webpage, 'player config')
|
r'(?s)RTPPlayer\(({.+?})\);', webpage,
|
||||||
config = self._parse_json(player_config, video_id)
|
'player config'), video_id, js_to_json)
|
||||||
|
file_url = config['file']
|
||||||
path, ext = config.get('file').rsplit('.', 1)
|
ext = determine_ext(file_url)
|
||||||
formats = [{
|
if ext == 'm3u8':
|
||||||
'format_id': 'rtmp',
|
file_key = config.get('fileKey')
|
||||||
'ext': ext,
|
formats = self._extract_m3u8_formats(
|
||||||
'vcodec': config.get('type') == 'audio' and 'none' or None,
|
file_url, video_id, 'mp4', 'm3u8_native',
|
||||||
'preference': -2,
|
m3u8_id='hls', fatal=file_key)
|
||||||
'url': 'rtmp://{streamer:s}/{application:s}'.format(**config),
|
if file_key:
|
||||||
'app': config.get('application'),
|
formats.append({
|
||||||
'play_path': '{ext:s}:{path:s}'.format(ext=ext, path=path),
|
'url': 'https://cdn-ondemand.rtp.pt' + file_key,
|
||||||
'page_url': url,
|
'preference': 1,
|
||||||
'rtmp_live': config.get('live', False),
|
})
|
||||||
'player_url': 'http://programas.rtp.pt/play/player.swf?v3',
|
self._sort_formats(formats)
|
||||||
'rtmp_real_time': True,
|
else:
|
||||||
}]
|
formats = [{
|
||||||
|
'url': file_url,
|
||||||
# Construct regular HTTP download URLs
|
'ext': ext,
|
||||||
replacements = {
|
}]
|
||||||
'audio': {
|
if config.get('mediaType') == 'audio':
|
||||||
'format_id': 'mp3',
|
for f in formats:
|
||||||
'pattern': r'^nas2\.share/wavrss/',
|
f['vcodec'] = 'none'
|
||||||
'repl': 'http://rsspod.rtp.pt/podcasts/',
|
|
||||||
'vcodec': 'none',
|
|
||||||
},
|
|
||||||
'video': {
|
|
||||||
'format_id': 'mp4_h264',
|
|
||||||
'pattern': r'^nas2\.share/h264/',
|
|
||||||
'repl': 'http://rsspod.rtp.pt/videocasts/',
|
|
||||||
'vcodec': 'h264',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
r = replacements[config['type']]
|
|
||||||
if re.match(r['pattern'], config['file']) is not None:
|
|
||||||
formats.append({
|
|
||||||
'format_id': r['format_id'],
|
|
||||||
'url': re.sub(r['pattern'], r['repl'], config['file']),
|
|
||||||
'vcodec': r['vcodec'],
|
|
||||||
})
|
|
||||||
|
|
||||||
self._sort_formats(formats)
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'title': title,
|
'title': title,
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
'description': description,
|
'description': self._html_search_meta(['description', 'twitter:description'], webpage),
|
||||||
'thumbnail': thumbnail,
|
'thumbnail': config.get('poster') or self._og_search_thumbnail(webpage),
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ from ..utils import (
|
|||||||
class VikiBaseIE(InfoExtractor):
|
class VikiBaseIE(InfoExtractor):
|
||||||
_VALID_URL_BASE = r'https?://(?:www\.)?viki\.(?:com|net|mx|jp|fr)/'
|
_VALID_URL_BASE = r'https?://(?:www\.)?viki\.(?:com|net|mx|jp|fr)/'
|
||||||
_API_QUERY_TEMPLATE = '/v4/%sapp=%s&t=%s&site=www.viki.com'
|
_API_QUERY_TEMPLATE = '/v4/%sapp=%s&t=%s&site=www.viki.com'
|
||||||
_API_URL_TEMPLATE = 'http://api.viki.io%s&sig=%s'
|
_API_URL_TEMPLATE = 'https://api.viki.io%s&sig=%s'
|
||||||
|
|
||||||
_APP = '100005a'
|
_APP = '100005a'
|
||||||
_APP_VERSION = '2.2.5.1428709186'
|
_APP_VERSION = '2.2.5.1428709186'
|
||||||
@ -377,7 +377,7 @@ class VikiChannelIE(VikiBaseIE):
|
|||||||
for video in page['response']:
|
for video in page['response']:
|
||||||
video_id = video['id']
|
video_id = video['id']
|
||||||
entries.append(self.url_result(
|
entries.append(self.url_result(
|
||||||
'http://www.viki.com/videos/%s' % video_id, 'Viki'))
|
'https://www.viki.com/videos/%s' % video_id, 'Viki'))
|
||||||
if not page['pagination']['next']:
|
if not page['pagination']['next']:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user