mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-10-01 06:41:27 +02:00
Compare commits
3 Commits
daeb7ec631
...
38bb163fe1
Author | SHA1 | Date | |
---|---|---|---|
|
38bb163fe1 | ||
|
5ef4ef2d59 | ||
|
c46e6b9075 |
|
@ -493,7 +493,6 @@
|
||||||
- **gem.cbc.ca**: [*cbcgem*](## "netrc machine")
|
- **gem.cbc.ca**: [*cbcgem*](## "netrc machine")
|
||||||
- **gem.cbc.ca:live**
|
- **gem.cbc.ca:live**
|
||||||
- **gem.cbc.ca:playlist**
|
- **gem.cbc.ca:playlist**
|
||||||
- **generic**: Generic downloader that works on some sites
|
|
||||||
- **Genius**
|
- **Genius**
|
||||||
- **GeniusLyrics**
|
- **GeniusLyrics**
|
||||||
- **Gettr**
|
- **Gettr**
|
||||||
|
@ -1472,6 +1471,7 @@
|
||||||
- **TuneInPodcast**
|
- **TuneInPodcast**
|
||||||
- **TuneInPodcastEpisode**
|
- **TuneInPodcastEpisode**
|
||||||
- **TuneInStation**
|
- **TuneInStation**
|
||||||
|
- **Turbo**
|
||||||
- **tv.dfb.de**
|
- **tv.dfb.de**
|
||||||
- **TV2**
|
- **TV2**
|
||||||
- **TV2Article**
|
- **TV2Article**
|
||||||
|
@ -1601,7 +1601,6 @@
|
||||||
- **ViMP:Playlist**
|
- **ViMP:Playlist**
|
||||||
- **Vine**
|
- **Vine**
|
||||||
- **vine:user**
|
- **vine:user**
|
||||||
- **Viously**
|
|
||||||
- **Viqeo**
|
- **Viqeo**
|
||||||
- **Viu**
|
- **Viu**
|
||||||
- **viu:ott**: [*viu*](## "netrc machine")
|
- **viu:ott**: [*viu*](## "netrc machine")
|
||||||
|
|
|
@ -1216,7 +1216,10 @@ from .nexx import (
|
||||||
NexxIE,
|
NexxIE,
|
||||||
NexxEmbedIE,
|
NexxEmbedIE,
|
||||||
)
|
)
|
||||||
from .nfb import NFBIE
|
from .nfb import (
|
||||||
|
NFBIE,
|
||||||
|
ONFIE,
|
||||||
|
)
|
||||||
from .nfhsnetwork import NFHSNetworkIE
|
from .nfhsnetwork import NFHSNetworkIE
|
||||||
from .nfl import (
|
from .nfl import (
|
||||||
NFLIE,
|
NFLIE,
|
||||||
|
@ -1344,7 +1347,6 @@ from .onet import (
|
||||||
OnetMVPIE,
|
OnetMVPIE,
|
||||||
OnetPlIE,
|
OnetPlIE,
|
||||||
)
|
)
|
||||||
from .onf import ONFIE
|
|
||||||
from .onionstudios import OnionStudiosIE
|
from .onionstudios import OnionStudiosIE
|
||||||
from .opencast import (
|
from .opencast import (
|
||||||
OpencastIE,
|
OpencastIE,
|
||||||
|
|
|
@ -2,31 +2,17 @@ from .common import InfoExtractor
|
||||||
from ..utils import int_or_none
|
from ..utils import int_or_none
|
||||||
|
|
||||||
|
|
||||||
class NFBIE(InfoExtractor):
|
class NFBBaseIE(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):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
|
|
||||||
webpage = self._download_webpage('https://www.nfb.ca/film/%s/' % video_id, video_id)
|
webpage = self._download_webpage(f'https://{self.domain}/film/%s/' % video_id, video_id)
|
||||||
|
|
||||||
iframe = self._html_search_regex(
|
iframe = self._html_search_regex(
|
||||||
r'<[^>]+\bid=["\']player-iframe["\'][^>]*src=["\']([^"\']+)',
|
r'<[^>]+\bid=["\']player-iframe["\'][^>]*src=["\']([^"\']+)',
|
||||||
webpage, 'iframe', default=None, fatal=True)
|
webpage, 'iframe', default=None, fatal=True)
|
||||||
if iframe.startswith('/'):
|
if iframe.startswith('/'):
|
||||||
iframe = f'https://www.nfb.ca{iframe}'
|
iframe = f'https://{self.domain}{iframe}'
|
||||||
|
|
||||||
player = self._download_webpage(iframe, video_id)
|
player = self._download_webpage(iframe, video_id)
|
||||||
|
|
||||||
|
@ -56,3 +42,37 @@ class NFBIE(InfoExtractor):
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
'subtitles': subtitles,
|
'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'
|
||||||
|
|
|
@ -1,58 +0,0 @@
|
||||||
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