Merge pull request #260 from ytdl-org/master
[pull] master from ytdl-org:master
This commit is contained in:
commit
5146ff20db
@ -497,7 +497,6 @@ from .jeuxvideo import JeuxVideoIE
|
|||||||
from .jove import JoveIE
|
from .jove import JoveIE
|
||||||
from .joj import JojIE
|
from .joj import JojIE
|
||||||
from .jwplatform import JWPlatformIE
|
from .jwplatform import JWPlatformIE
|
||||||
from .jpopsukitv import JpopsukiIE
|
|
||||||
from .kakao import KakaoIE
|
from .kakao import KakaoIE
|
||||||
from .kaltura import KalturaIE
|
from .kaltura import KalturaIE
|
||||||
from .kanalplay import KanalPlayIE
|
from .kanalplay import KanalPlayIE
|
||||||
|
@ -1,68 +0,0 @@
|
|||||||
# coding: utf-8
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from .common import InfoExtractor
|
|
||||||
from ..utils import (
|
|
||||||
int_or_none,
|
|
||||||
unified_strdate,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class JpopsukiIE(InfoExtractor):
|
|
||||||
IE_NAME = 'jpopsuki.tv'
|
|
||||||
_VALID_URL = r'https?://(?:www\.)?jpopsuki\.tv/(?:category/)?video/[^/]+/(?P<id>\S+)'
|
|
||||||
|
|
||||||
_TEST = {
|
|
||||||
'url': 'http://www.jpopsuki.tv/video/ayumi-hamasaki---evolution/00be659d23b0b40508169cdee4545771',
|
|
||||||
'md5': '88018c0c1a9b1387940e90ec9e7e198e',
|
|
||||||
'info_dict': {
|
|
||||||
'id': '00be659d23b0b40508169cdee4545771',
|
|
||||||
'ext': 'mp4',
|
|
||||||
'title': 'ayumi hamasaki - evolution',
|
|
||||||
'description': 'Release date: 2001.01.31\r\n浜崎あゆみ - evolution',
|
|
||||||
'thumbnail': 'http://www.jpopsuki.tv/cache/89722c74d2a2ebe58bcac65321c115b2.jpg',
|
|
||||||
'uploader': 'plama_chan',
|
|
||||||
'uploader_id': '404',
|
|
||||||
'upload_date': '20121101'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
def _real_extract(self, url):
|
|
||||||
video_id = self._match_id(url)
|
|
||||||
|
|
||||||
webpage = self._download_webpage(url, video_id)
|
|
||||||
|
|
||||||
video_url = 'http://www.jpopsuki.tv' + self._html_search_regex(
|
|
||||||
r'<source src="(.*?)" type', webpage, 'video url')
|
|
||||||
|
|
||||||
video_title = self._og_search_title(webpage)
|
|
||||||
description = self._og_search_description(webpage)
|
|
||||||
thumbnail = self._og_search_thumbnail(webpage)
|
|
||||||
uploader = self._html_search_regex(
|
|
||||||
r'<li>from: <a href="/user/view/user/(.*?)/uid/',
|
|
||||||
webpage, 'video uploader', fatal=False)
|
|
||||||
uploader_id = self._html_search_regex(
|
|
||||||
r'<li>from: <a href="/user/view/user/\S*?/uid/(\d*)',
|
|
||||||
webpage, 'video uploader_id', fatal=False)
|
|
||||||
upload_date = unified_strdate(self._html_search_regex(
|
|
||||||
r'<li>uploaded: (.*?)</li>', webpage, 'video upload_date',
|
|
||||||
fatal=False))
|
|
||||||
view_count_str = self._html_search_regex(
|
|
||||||
r'<li>Hits: ([0-9]+?)</li>', webpage, 'video view_count',
|
|
||||||
fatal=False)
|
|
||||||
comment_count_str = self._html_search_regex(
|
|
||||||
r'<h2>([0-9]+?) comments</h2>', webpage, 'video comment_count',
|
|
||||||
fatal=False)
|
|
||||||
|
|
||||||
return {
|
|
||||||
'id': video_id,
|
|
||||||
'url': video_url,
|
|
||||||
'title': video_title,
|
|
||||||
'description': description,
|
|
||||||
'thumbnail': thumbnail,
|
|
||||||
'uploader': uploader,
|
|
||||||
'uploader_id': uploader_id,
|
|
||||||
'upload_date': upload_date,
|
|
||||||
'view_count': int_or_none(view_count_str),
|
|
||||||
'comment_count': int_or_none(comment_count_str),
|
|
||||||
}
|
|
@ -18,7 +18,7 @@ class NovaEmbedIE(InfoExtractor):
|
|||||||
_VALID_URL = r'https?://media\.cms\.nova\.cz/embed/(?P<id>[^/?#&]+)'
|
_VALID_URL = r'https?://media\.cms\.nova\.cz/embed/(?P<id>[^/?#&]+)'
|
||||||
_TEST = {
|
_TEST = {
|
||||||
'url': 'https://media.cms.nova.cz/embed/8o0n0r?autoplay=1',
|
'url': 'https://media.cms.nova.cz/embed/8o0n0r?autoplay=1',
|
||||||
'md5': 'b3834f6de5401baabf31ed57456463f7',
|
'md5': 'ee009bafcc794541570edd44b71cbea3',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '8o0n0r',
|
'id': '8o0n0r',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
@ -44,11 +44,17 @@ class NovaEmbedIE(InfoExtractor):
|
|||||||
formats = []
|
formats = []
|
||||||
for format_id, format_list in bitrates.items():
|
for format_id, format_list in bitrates.items():
|
||||||
if not isinstance(format_list, list):
|
if not isinstance(format_list, list):
|
||||||
continue
|
format_list = [format_list]
|
||||||
for format_url in format_list:
|
for format_url in format_list:
|
||||||
format_url = url_or_none(format_url)
|
format_url = url_or_none(format_url)
|
||||||
if not format_url:
|
if not format_url:
|
||||||
continue
|
continue
|
||||||
|
if format_id == 'hls':
|
||||||
|
formats.extend(self._extract_m3u8_formats(
|
||||||
|
format_url, video_id, ext='mp4',
|
||||||
|
entry_protocol='m3u8_native', m3u8_id='hls',
|
||||||
|
fatal=False))
|
||||||
|
continue
|
||||||
f = {
|
f = {
|
||||||
'url': format_url,
|
'url': format_url,
|
||||||
}
|
}
|
||||||
@ -91,7 +97,7 @@ class NovaIE(InfoExtractor):
|
|||||||
_VALID_URL = r'https?://(?:[^.]+\.)?(?P<site>tv(?:noviny)?|tn|novaplus|vymena|fanda|krasna|doma|prask)\.nova\.cz/(?:[^/]+/)+(?P<id>[^/]+?)(?:\.html|/|$)'
|
_VALID_URL = r'https?://(?:[^.]+\.)?(?P<site>tv(?:noviny)?|tn|novaplus|vymena|fanda|krasna|doma|prask)\.nova\.cz/(?:[^/]+/)+(?P<id>[^/]+?)(?:\.html|/|$)'
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'http://tn.nova.cz/clanek/tajemstvi-ukryte-v-podzemi-specialni-nemocnice-v-prazske-krci.html#player_13260',
|
'url': 'http://tn.nova.cz/clanek/tajemstvi-ukryte-v-podzemi-specialni-nemocnice-v-prazske-krci.html#player_13260',
|
||||||
'md5': '1dd7b9d5ea27bc361f110cd855a19bd3',
|
'md5': '249baab7d0104e186e78b0899c7d5f28',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '1757139',
|
'id': '1757139',
|
||||||
'display_id': 'tajemstvi-ukryte-v-podzemi-specialni-nemocnice-v-prazske-krci',
|
'display_id': 'tajemstvi-ukryte-v-podzemi-specialni-nemocnice-v-prazske-krci',
|
||||||
@ -113,7 +119,8 @@ class NovaIE(InfoExtractor):
|
|||||||
'params': {
|
'params': {
|
||||||
# rtmp download
|
# rtmp download
|
||||||
'skip_download': True,
|
'skip_download': True,
|
||||||
}
|
},
|
||||||
|
'skip': 'gone',
|
||||||
}, {
|
}, {
|
||||||
# media.cms.nova.cz embed
|
# media.cms.nova.cz embed
|
||||||
'url': 'https://novaplus.nova.cz/porad/ulice/epizoda/18760-2180-dil',
|
'url': 'https://novaplus.nova.cz/porad/ulice/epizoda/18760-2180-dil',
|
||||||
@ -128,6 +135,7 @@ class NovaIE(InfoExtractor):
|
|||||||
'skip_download': True,
|
'skip_download': True,
|
||||||
},
|
},
|
||||||
'add_ie': [NovaEmbedIE.ie_key()],
|
'add_ie': [NovaEmbedIE.ie_key()],
|
||||||
|
'skip': 'CHYBA 404: STRÁNKA NENALEZENA',
|
||||||
}, {
|
}, {
|
||||||
'url': 'http://sport.tn.nova.cz/clanek/sport/hokej/nhl/zivot-jde-dal-hodnotil-po-vyrazeni-z-playoff-jiri-sekac.html',
|
'url': 'http://sport.tn.nova.cz/clanek/sport/hokej/nhl/zivot-jde-dal-hodnotil-po-vyrazeni-z-playoff-jiri-sekac.html',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
@ -152,14 +160,29 @@ class NovaIE(InfoExtractor):
|
|||||||
|
|
||||||
webpage = self._download_webpage(url, display_id)
|
webpage = self._download_webpage(url, display_id)
|
||||||
|
|
||||||
|
description = clean_html(self._og_search_description(webpage, default=None))
|
||||||
|
if site == 'novaplus':
|
||||||
|
upload_date = unified_strdate(self._search_regex(
|
||||||
|
r'(\d{1,2}-\d{1,2}-\d{4})$', display_id, 'upload date', default=None))
|
||||||
|
elif site == 'fanda':
|
||||||
|
upload_date = unified_strdate(self._search_regex(
|
||||||
|
r'<span class="date_time">(\d{1,2}\.\d{1,2}\.\d{4})', webpage, 'upload date', default=None))
|
||||||
|
else:
|
||||||
|
upload_date = None
|
||||||
|
|
||||||
# novaplus
|
# novaplus
|
||||||
embed_id = self._search_regex(
|
embed_id = self._search_regex(
|
||||||
r'<iframe[^>]+\bsrc=["\'](?:https?:)?//media\.cms\.nova\.cz/embed/([^/?#&]+)',
|
r'<iframe[^>]+\bsrc=["\'](?:https?:)?//media\.cms\.nova\.cz/embed/([^/?#&]+)',
|
||||||
webpage, 'embed url', default=None)
|
webpage, 'embed url', default=None)
|
||||||
if embed_id:
|
if embed_id:
|
||||||
return self.url_result(
|
return {
|
||||||
'https://media.cms.nova.cz/embed/%s' % embed_id,
|
'_type': 'url_transparent',
|
||||||
ie=NovaEmbedIE.ie_key(), video_id=embed_id)
|
'url': 'https://media.cms.nova.cz/embed/%s' % embed_id,
|
||||||
|
'ie_key': NovaEmbedIE.ie_key(),
|
||||||
|
'id': embed_id,
|
||||||
|
'description': description,
|
||||||
|
'upload_date': upload_date
|
||||||
|
}
|
||||||
|
|
||||||
video_id = self._search_regex(
|
video_id = self._search_regex(
|
||||||
[r"(?:media|video_id)\s*:\s*'(\d+)'",
|
[r"(?:media|video_id)\s*:\s*'(\d+)'",
|
||||||
@ -233,18 +256,8 @@ class NovaIE(InfoExtractor):
|
|||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
|
|
||||||
title = mediafile.get('meta', {}).get('title') or self._og_search_title(webpage)
|
title = mediafile.get('meta', {}).get('title') or self._og_search_title(webpage)
|
||||||
description = clean_html(self._og_search_description(webpage, default=None))
|
|
||||||
thumbnail = config.get('poster')
|
thumbnail = config.get('poster')
|
||||||
|
|
||||||
if site == 'novaplus':
|
|
||||||
upload_date = unified_strdate(self._search_regex(
|
|
||||||
r'(\d{1,2}-\d{1,2}-\d{4})$', display_id, 'upload date', default=None))
|
|
||||||
elif site == 'fanda':
|
|
||||||
upload_date = unified_strdate(self._search_regex(
|
|
||||||
r'<span class="date_time">(\d{1,2}\.\d{1,2}\.\d{4})', webpage, 'upload date', default=None))
|
|
||||||
else:
|
|
||||||
upload_date = None
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'display_id': display_id,
|
'display_id': display_id,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user