mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-10-01 06:41:27 +02:00
Compare commits
No commits in common. "38bb163fe158f707a2c4dfada640e98b0e015e2a" and "daeb7ec631727ca7749e036f66af4af65e0d2a04" have entirely different histories.
38bb163fe1
...
daeb7ec631
|
@ -493,6 +493,7 @@
|
|||
- **gem.cbc.ca**: [*cbcgem*](## "netrc machine")
|
||||
- **gem.cbc.ca:live**
|
||||
- **gem.cbc.ca:playlist**
|
||||
- **generic**: Generic downloader that works on some sites
|
||||
- **Genius**
|
||||
- **GeniusLyrics**
|
||||
- **Gettr**
|
||||
|
@ -1471,7 +1472,6 @@
|
|||
- **TuneInPodcast**
|
||||
- **TuneInPodcastEpisode**
|
||||
- **TuneInStation**
|
||||
- **Turbo**
|
||||
- **tv.dfb.de**
|
||||
- **TV2**
|
||||
- **TV2Article**
|
||||
|
@ -1601,6 +1601,7 @@
|
|||
- **ViMP:Playlist**
|
||||
- **Vine**
|
||||
- **vine:user**
|
||||
- **Viously**
|
||||
- **Viqeo**
|
||||
- **Viu**
|
||||
- **viu:ott**: [*viu*](## "netrc machine")
|
||||
|
|
|
@ -1216,10 +1216,7 @@ from .nexx import (
|
|||
NexxIE,
|
||||
NexxEmbedIE,
|
||||
)
|
||||
from .nfb import (
|
||||
NFBIE,
|
||||
ONFIE,
|
||||
)
|
||||
from .nfb import NFBIE
|
||||
from .nfhsnetwork import NFHSNetworkIE
|
||||
from .nfl import (
|
||||
NFLIE,
|
||||
|
@ -1347,6 +1344,7 @@ from .onet import (
|
|||
OnetMVPIE,
|
||||
OnetPlIE,
|
||||
)
|
||||
from .onf import ONFIE
|
||||
from .onionstudios import OnionStudiosIE
|
||||
from .opencast import (
|
||||
OpencastIE,
|
||||
|
|
|
@ -2,17 +2,31 @@ from .common import InfoExtractor
|
|||
from ..utils import int_or_none
|
||||
|
||||
|
||||
class NFBBaseIE(InfoExtractor):
|
||||
class NFBIE(InfoExtractor):
|
||||
_VALID_URL = r'https?://(?:www\.)?nfb\.ca/film/(?P<id>[^/?#&]+)'
|
||||
_TESTS = [{
|
||||
'url': 'https://www.nfb.ca/film/trafficopter/',
|
||||
'info_dict': {
|
||||
'id': 'trafficopter',
|
||||
'ext': 'mp4',
|
||||
'title': 'Trafficopter',
|
||||
'description': 'md5:060228455eb85cf88785c41656776bc0',
|
||||
'thumbnail': r're:^https?://.*\.jpg$',
|
||||
'uploader': 'Barrie Howells',
|
||||
'release_year': 1972,
|
||||
},
|
||||
}]
|
||||
|
||||
def _real_extract(self, url):
|
||||
video_id = self._match_id(url)
|
||||
|
||||
webpage = self._download_webpage(f'https://{self.domain}/film/%s/' % video_id, video_id)
|
||||
webpage = self._download_webpage('https://www.nfb.ca/film/%s/' % video_id, video_id)
|
||||
|
||||
iframe = self._html_search_regex(
|
||||
r'<[^>]+\bid=["\']player-iframe["\'][^>]*src=["\']([^"\']+)',
|
||||
webpage, 'iframe', default=None, fatal=True)
|
||||
if iframe.startswith('/'):
|
||||
iframe = f'https://{self.domain}{iframe}'
|
||||
iframe = f'https://www.nfb.ca{iframe}'
|
||||
|
||||
player = self._download_webpage(iframe, video_id)
|
||||
|
||||
|
@ -42,37 +56,3 @@ class NFBBaseIE(InfoExtractor):
|
|||
'formats': formats,
|
||||
'subtitles': subtitles,
|
||||
}
|
||||
|
||||
|
||||
class NFBIE(NFBBaseIE):
|
||||
_VALID_URL = r'https?://(?:www\.)?nfb\.ca/film/(?P<id>[^/?#&]+)'
|
||||
_TESTS = [{
|
||||
'url': 'https://www.nfb.ca/film/trafficopter/',
|
||||
'info_dict': {
|
||||
'id': 'trafficopter',
|
||||
'ext': 'mp4',
|
||||
'title': 'Trafficopter',
|
||||
'description': 'md5:060228455eb85cf88785c41656776bc0',
|
||||
'thumbnail': r're:^https?://.*\.jpg$',
|
||||
'uploader': 'Barrie Howells',
|
||||
'release_year': 1972,
|
||||
},
|
||||
}]
|
||||
domain = 'www.nfb.ca'
|
||||
|
||||
|
||||
class ONFIE(NFBBaseIE):
|
||||
_VALID_URL = r'https?://(?:www\.)?onf\.ca/film/(?P<id>[^/?#&]+)'
|
||||
_TESTS = [{
|
||||
'url': 'https://www.onf.ca/film/mal-du-siecle/',
|
||||
'info_dict': {
|
||||
'id': 'mal-du-siecle',
|
||||
'ext': 'mp4',
|
||||
'title': 'Le mal du siècle',
|
||||
'description': 'md5:1abf774d77569ebe603419f2d344102b',
|
||||
'thumbnail': r're:^https?://.*\.jpg$',
|
||||
'uploader': 'Catherine Lepage',
|
||||
'release_year': 2019
|
||||
},
|
||||
}]
|
||||
domain = 'www.onf.ca'
|
||||
|
|
58
yt_dlp/extractor/onf.py
Normal file
58
yt_dlp/extractor/onf.py
Normal file
|
@ -0,0 +1,58 @@
|
|||
from .common import InfoExtractor
|
||||
from ..utils import int_or_none
|
||||
|
||||
|
||||
class ONFIE(InfoExtractor):
|
||||
_VALID_URL = r'https?://(?:www\.)?onf\.ca/film/(?P<id>[^/?#&]+)'
|
||||
_TESTS = [{
|
||||
'url': 'https://www.onf.ca/film/mal-du-siecle/',
|
||||
'info_dict': {
|
||||
'id': 'mal-du-siecle',
|
||||
'ext': 'mp4',
|
||||
'title': 'Le mal du siècle',
|
||||
'description': 'md5:1abf774d77569ebe603419f2d344102b',
|
||||
'thumbnail': r're:^https?://.*\.jpg$',
|
||||
'uploader': 'Catherine Lepage',
|
||||
'release_year': 2019
|
||||
},
|
||||
}]
|
||||
|
||||
def _real_extract(self, url):
|
||||
video_id = self._match_id(url)
|
||||
|
||||
webpage = self._download_webpage('https://www.onf.ca/film/%s/' % video_id, video_id)
|
||||
|
||||
iframe = self._html_search_regex(
|
||||
r'<[^>]+\bid=["\']player-iframe["\'][^>]*src=["\']([^"\']+)',
|
||||
webpage, 'iframe', default=None, fatal=True)
|
||||
if iframe.startswith('/'):
|
||||
iframe = f'https://www.onf.ca{iframe}'
|
||||
|
||||
player = self._download_webpage(iframe, video_id)
|
||||
|
||||
source = self._html_search_regex(
|
||||
r'source:\s*\'([^\']+)',
|
||||
player, 'source', default=None, fatal=True)
|
||||
|
||||
formats, subtitles = self._extract_m3u8_formats_and_subtitles(source, video_id, ext='mp4')
|
||||
|
||||
return {
|
||||
'id': video_id,
|
||||
'title': self._html_search_regex(
|
||||
r'<[^>]+\bid=["\']titleHeader["\'][^>]*>\s*<h1[^>]*>\s*([^<]+?)\s*</h1>',
|
||||
webpage, 'title', default=None),
|
||||
'description': self._html_search_regex(
|
||||
r'<[^>]+\bid=["\']tabSynopsis["\'][^>]*>\s*<p[^>]*>\s*([^<]+)',
|
||||
webpage, 'description', default=None),
|
||||
'thumbnail': self._html_search_regex(
|
||||
r'poster:\s*\'([^\']+)',
|
||||
player, 'thumbnail', default=None),
|
||||
'uploader': self._html_search_regex(
|
||||
r'<[^>]+\bitemprop=["\']name["\'][^>]*>([^<]+)',
|
||||
webpage, 'uploader', default=None),
|
||||
'release_year': int_or_none(self._html_search_regex(
|
||||
r'<[^>]+\bitemprop=["\']datePublished["\'][^>]*>([^<]+)',
|
||||
webpage, 'release_year', default=None)),
|
||||
'formats': formats,
|
||||
'subtitles': subtitles,
|
||||
}
|
Loading…
Reference in New Issue
Block a user