mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-22 08:34:32 +01:00
[olympicchannel] Add extractor
This commit is contained in:
parent
e0b6e98871
commit
b7717e24be
@ -792,6 +792,7 @@ from .nzz import NZZIE
|
||||
from .odatv import OdaTVIE
|
||||
from .odnoklassniki import OdnoklassnikiIE
|
||||
from .oktoberfesttv import OktoberfestTVIE
|
||||
from .olympicchannel import OlympicChannelIE
|
||||
from .ondemandkorea import OnDemandKoreaIE
|
||||
from .onet import (
|
||||
OnetIE,
|
||||
|
43
youtube_dl/extractor/olympicchannel.py
Normal file
43
youtube_dl/extractor/olympicchannel.py
Normal file
@ -0,0 +1,43 @@
|
||||
# coding: utf-8
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from .common import InfoExtractor
|
||||
from ..utils import ExtractorError, unified_strdate
|
||||
|
||||
|
||||
class OlympicChannelIE(InfoExtractor):
|
||||
_VALID_URL = r'https?://(?:www\.)?olympicchannel\.com/../video/detail/(?P<id>[^/]+)'
|
||||
_TEST = {
|
||||
'url': 'https://www.olympicchannel.com/en/video/detail/men-s-halfpipe-finals-snowboard-pyeongchang-2018-replays/',
|
||||
'info_dict': {
|
||||
'id': '1789cf09-7143-4972-b822-16210fa1a4b1',
|
||||
'ext': 'mp4',
|
||||
'title': 'Men\'s Halfpipe Finals - Snowboard | PyeongChang 2018 Replays',
|
||||
'description': 'The men\'s halfpipe finals were held at the Phoenix Snow Park on 14 February 2018.',
|
||||
'release_date': '20180308',
|
||||
'thumbnail': r're:^https?://.*',
|
||||
}
|
||||
}
|
||||
|
||||
def _real_extract(self, url):
|
||||
display_id = self._match_id(url)
|
||||
webpage = self._download_webpage(url, display_id)
|
||||
|
||||
video_id = self._html_search_meta('episode_uid', webpage)
|
||||
title = self._html_search_meta('episode_title', webpage)
|
||||
formats = self._extract_m3u8_formats(self._html_search_meta('video_url', webpage), video_id, 'mp4')
|
||||
description = self._html_search_meta('episode_synopsis', webpage, fatal=False)
|
||||
release_date = unified_strdate(self._html_search_meta('content_release_date_local_utc', webpage, fatal=False))
|
||||
thumbnail = self._og_search_thumbnail(webpage)
|
||||
|
||||
self._sort_formats(formats)
|
||||
|
||||
return {
|
||||
'id': video_id,
|
||||
'display_id': display_id,
|
||||
'title': title,
|
||||
'formats': formats,
|
||||
'description': description,
|
||||
'release_date': release_date,
|
||||
'thumbnail': thumbnail,
|
||||
}
|
Loading…
Reference in New Issue
Block a user