mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-15 21:53:21 +00:00
Compare commits
No commits in common. "f0500bd1e4e3910abd58a1be812ba35fc20049e7" and "dfb855b42da32807ffac243f1e763f480c4d44ba" have entirely different histories.
f0500bd1e4
...
dfb855b42d
@ -44,7 +44,7 @@ def try_rm(filename):
|
|||||||
raise
|
raise
|
||||||
|
|
||||||
|
|
||||||
def report_warning(message, *args, **kwargs):
|
def report_warning(message):
|
||||||
'''
|
'''
|
||||||
Print the message to stderr, it will be prefixed with 'WARNING:'
|
Print the message to stderr, it will be prefixed with 'WARNING:'
|
||||||
If stderr is a tty file the 'WARNING:' will be colored
|
If stderr is a tty file the 'WARNING:' will be colored
|
||||||
@ -67,10 +67,10 @@ class FakeYDL(YoutubeDL):
|
|||||||
super().__init__(params, auto_init=False)
|
super().__init__(params, auto_init=False)
|
||||||
self.result = []
|
self.result = []
|
||||||
|
|
||||||
def to_screen(self, s, *args, **kwargs):
|
def to_screen(self, s, skip_eol=None):
|
||||||
print(s)
|
print(s)
|
||||||
|
|
||||||
def trouble(self, s, *args, **kwargs):
|
def trouble(self, s, tb=None):
|
||||||
raise Exception(s)
|
raise Exception(s)
|
||||||
|
|
||||||
def download(self, x):
|
def download(self, x):
|
||||||
@ -80,10 +80,10 @@ class FakeYDL(YoutubeDL):
|
|||||||
# Silence an expected warning matching a regex
|
# Silence an expected warning matching a regex
|
||||||
old_report_warning = self.report_warning
|
old_report_warning = self.report_warning
|
||||||
|
|
||||||
def report_warning(self, message, *args, **kwargs):
|
def report_warning(self, message):
|
||||||
if re.match(regex, message):
|
if re.match(regex, message):
|
||||||
return
|
return
|
||||||
old_report_warning(message, *args, **kwargs)
|
old_report_warning(message)
|
||||||
self.report_warning = types.MethodType(report_warning, self)
|
self.report_warning = types.MethodType(report_warning, self)
|
||||||
|
|
||||||
|
|
||||||
@ -301,9 +301,9 @@ def assertEqual(self, got, expected, msg=None):
|
|||||||
def expect_warnings(ydl, warnings_re):
|
def expect_warnings(ydl, warnings_re):
|
||||||
real_warning = ydl.report_warning
|
real_warning = ydl.report_warning
|
||||||
|
|
||||||
def _report_warning(w, *args, **kwargs):
|
def _report_warning(w):
|
||||||
if not any(re.search(w_re, w) for w_re in warnings_re):
|
if not any(re.search(w_re, w) for w_re in warnings_re):
|
||||||
real_warning(w, *args, **kwargs)
|
real_warning(w)
|
||||||
|
|
||||||
ydl.report_warning = _report_warning
|
ydl.report_warning = _report_warning
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ class YDL(FakeYDL):
|
|||||||
def process_info(self, info_dict):
|
def process_info(self, info_dict):
|
||||||
self.downloaded_info_dicts.append(info_dict.copy())
|
self.downloaded_info_dicts.append(info_dict.copy())
|
||||||
|
|
||||||
def to_screen(self, msg, *args, **kwargs):
|
def to_screen(self, msg):
|
||||||
self.msgs.append(msg)
|
self.msgs.append(msg)
|
||||||
|
|
||||||
def dl(self, *args, **kwargs):
|
def dl(self, *args, **kwargs):
|
||||||
|
@ -14,16 +14,16 @@ from yt_dlp.cookies import (
|
|||||||
|
|
||||||
|
|
||||||
class Logger:
|
class Logger:
|
||||||
def debug(self, message, *args, **kwargs):
|
def debug(self, message):
|
||||||
print(f'[verbose] {message}')
|
print(f'[verbose] {message}')
|
||||||
|
|
||||||
def info(self, message, *args, **kwargs):
|
def info(self, message):
|
||||||
print(message)
|
print(message)
|
||||||
|
|
||||||
def warning(self, message, *args, **kwargs):
|
def warning(self, message, only_once=False):
|
||||||
self.error(message)
|
self.error(message)
|
||||||
|
|
||||||
def error(self, message, *args, **kwargs):
|
def error(self, message):
|
||||||
raise Exception(message)
|
raise Exception(message)
|
||||||
|
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ class YoutubeDL(yt_dlp.YoutubeDL):
|
|||||||
self.processed_info_dicts = []
|
self.processed_info_dicts = []
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
|
|
||||||
def report_warning(self, message, *args, **kwargs):
|
def report_warning(self, message):
|
||||||
# Don't accept warnings during tests
|
# Don't accept warnings during tests
|
||||||
raise ExtractorError(message)
|
raise ExtractorError(message)
|
||||||
|
|
||||||
|
@ -391,10 +391,9 @@ class F4mFD(FragmentFD):
|
|||||||
query.append(info_dict['extra_param_to_segment_url'])
|
query.append(info_dict['extra_param_to_segment_url'])
|
||||||
url_parsed = base_url_parsed._replace(path=base_url_parsed.path + name, query='&'.join(query))
|
url_parsed = base_url_parsed._replace(path=base_url_parsed.path + name, query='&'.join(query))
|
||||||
try:
|
try:
|
||||||
success = self._download_fragment(ctx, url_parsed.geturl(), info_dict)
|
success, down_data = self._download_fragment(ctx, url_parsed.geturl(), info_dict)
|
||||||
if not success:
|
if not success:
|
||||||
return False
|
return False
|
||||||
down_data = self._read_fragment(ctx)
|
|
||||||
reader = FlvReader(down_data)
|
reader = FlvReader(down_data)
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
|
@ -747,7 +747,6 @@ from .khanacademy import (
|
|||||||
KhanAcademyIE,
|
KhanAcademyIE,
|
||||||
KhanAcademyUnitIE,
|
KhanAcademyUnitIE,
|
||||||
)
|
)
|
||||||
from .kicker import KickerIE
|
|
||||||
from .kickstarter import KickStarterIE
|
from .kickstarter import KickStarterIE
|
||||||
from .kinja import KinjaEmbedIE
|
from .kinja import KinjaEmbedIE
|
||||||
from .kinopoisk import KinoPoiskIE
|
from .kinopoisk import KinoPoiskIE
|
||||||
|
@ -24,7 +24,7 @@ class BellMediaIE(InfoExtractor):
|
|||||||
)/.*?(?:\b(?:vid(?:eoid)?|clipId)=|-vid|~|%7E|/(?:episode)?)(?P<id>[0-9]{6,})'''
|
)/.*?(?:\b(?:vid(?:eoid)?|clipId)=|-vid|~|%7E|/(?:episode)?)(?P<id>[0-9]{6,})'''
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'https://www.bnnbloomberg.ca/video/david-cockfield-s-top-picks~1403070',
|
'url': 'https://www.bnnbloomberg.ca/video/david-cockfield-s-top-picks~1403070',
|
||||||
'md5': '3e5b8e38370741d5089da79161646635',
|
'md5': '36d3ef559cfe8af8efe15922cd3ce950',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '1403070',
|
'id': '1403070',
|
||||||
'ext': 'flv',
|
'ext': 'flv',
|
||||||
@ -32,14 +32,6 @@ class BellMediaIE(InfoExtractor):
|
|||||||
'description': 'md5:810f7f8c6a83ad5b48677c3f8e5bb2c3',
|
'description': 'md5:810f7f8c6a83ad5b48677c3f8e5bb2c3',
|
||||||
'upload_date': '20180525',
|
'upload_date': '20180525',
|
||||||
'timestamp': 1527288600,
|
'timestamp': 1527288600,
|
||||||
'season_id': 73997,
|
|
||||||
'season': '2018',
|
|
||||||
'thumbnail': 'http://images2.9c9media.com/image_asset/2018_5_25_baf30cbd-b28d-4a18-9903-4bb8713b00f5_PNG_956x536.jpg',
|
|
||||||
'tags': [],
|
|
||||||
'categories': ['ETFs'],
|
|
||||||
'season_number': 8,
|
|
||||||
'duration': 272.038,
|
|
||||||
'series': 'Market Call Tonight',
|
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
'url': 'http://www.thecomedynetwork.ca/video/player?vid=923582',
|
'url': 'http://www.thecomedynetwork.ca/video/player?vid=923582',
|
||||||
|
@ -1,55 +0,0 @@
|
|||||||
from .common import InfoExtractor
|
|
||||||
from .dailymotion import DailymotionIE
|
|
||||||
|
|
||||||
|
|
||||||
class KickerIE(InfoExtractor):
|
|
||||||
_VALID_URL = r'https?://(?:www\.)kicker\.(?:de)/(?P<id>[\w-]+)/video'
|
|
||||||
_TESTS = [{
|
|
||||||
'url': 'https://www.kicker.de/pogba-dembel-co-die-top-11-der-abloesefreien-spieler-905049/video',
|
|
||||||
'info_dict': {
|
|
||||||
'id': 'km04mrK0DrRAVxy2GcA',
|
|
||||||
'title': 'md5:b91d145bac5745ac58d5479d8347a875',
|
|
||||||
'ext': 'mp4',
|
|
||||||
'duration': 350,
|
|
||||||
'description': 'md5:a5a3dd77dbb6550dbfb997be100b9998',
|
|
||||||
'uploader_id': 'x2dfupo',
|
|
||||||
'timestamp': 1654677626,
|
|
||||||
'like_count': int,
|
|
||||||
'uploader': 'kicker.de',
|
|
||||||
'view_count': int,
|
|
||||||
'age_limit': 0,
|
|
||||||
'thumbnail': r're:https://s\d+\.dmcdn\.net/v/T-x741YeYAx8aSZ0Z/x1080',
|
|
||||||
'tags': ['published', 'category.InternationalSoccer'],
|
|
||||||
'upload_date': '20220608'
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
'url': 'https://www.kicker.de/ex-unioner-in-der-bezirksliga-felix-kroos-vereinschallenge-in-pankow-902825/video',
|
|
||||||
'info_dict': {
|
|
||||||
'id': 'k2omNsJKdZ3TxwxYSFJ',
|
|
||||||
'title': 'md5:72ec24d7f84b8436fe1e89d198152adf',
|
|
||||||
'ext': 'mp4',
|
|
||||||
'uploader_id': 'x2dfupo',
|
|
||||||
'duration': 331,
|
|
||||||
'timestamp': 1652966015,
|
|
||||||
'thumbnail': r're:https?://s\d+\.dmcdn\.net/v/TxU4Z1YYCmtisTbMq/x1080',
|
|
||||||
'tags': ['FELIX KROOS', 'EINFACH MAL LUPPEN', 'KROOS', 'FSV FORTUNA PANKOW', 'published', 'category.Amateurs', 'marketingpreset.Spreekick'],
|
|
||||||
'age_limit': 0,
|
|
||||||
'view_count': int,
|
|
||||||
'upload_date': '20220519',
|
|
||||||
'uploader': 'kicker.de',
|
|
||||||
'description': 'md5:0c2060c899a91c8bf40f578f78c5846f',
|
|
||||||
'like_count': int,
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
|
|
||||||
def _real_extract(self, url):
|
|
||||||
video_slug = self._match_id(url)
|
|
||||||
|
|
||||||
webpage = self._download_webpage(url, video_slug)
|
|
||||||
dailymotion_video_id = self._search_regex(
|
|
||||||
r'data-dmprivateid\s*=\s*[\'"](?P<video_id>\w+)', webpage,
|
|
||||||
'video id', group='video_id')
|
|
||||||
|
|
||||||
return self.url_result(
|
|
||||||
f'https://www.dailymotion.com/video/{dailymotion_video_id}',
|
|
||||||
ie=DailymotionIE, video_title=self._html_extract_title(webpage))
|
|
@ -20,7 +20,7 @@ class MediasetIE(ThePlatformBaseIE):
|
|||||||
(?:
|
(?:
|
||||||
mediaset:|
|
mediaset:|
|
||||||
https?://
|
https?://
|
||||||
(?:\w+\.)+mediaset\.it/
|
(?:(?:www|static3)\.)?mediasetplay\.mediaset\.it/
|
||||||
(?:
|
(?:
|
||||||
(?:video|on-demand|movie)/(?:[^/]+/)+[^/]+_|
|
(?:video|on-demand|movie)/(?:[^/]+/)+[^/]+_|
|
||||||
player/index\.html\?.*?\bprogramGuid=
|
player/index\.html\?.*?\bprogramGuid=
|
||||||
@ -159,9 +159,6 @@ class MediasetIE(ThePlatformBaseIE):
|
|||||||
}, {
|
}, {
|
||||||
'url': 'https://www.mediasetplay.mediaset.it/movie/herculeslaleggendahainizio/hercules-la-leggenda-ha-inizio_F305927501000102',
|
'url': 'https://www.mediasetplay.mediaset.it/movie/herculeslaleggendahainizio/hercules-la-leggenda-ha-inizio_F305927501000102',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
}, {
|
|
||||||
'url': 'https://mediasetinfinity.mediaset.it/video/braveandbeautiful/episodio-113_F310948005000402',
|
|
||||||
'only_matching': True,
|
|
||||||
}]
|
}]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -289,7 +286,7 @@ class MediasetShowIE(MediasetIE):
|
|||||||
_VALID_URL = r'''(?x)
|
_VALID_URL = r'''(?x)
|
||||||
(?:
|
(?:
|
||||||
https?://
|
https?://
|
||||||
(\w+\.)+mediaset\.it/
|
(?:(?:www|static3)\.)?mediasetplay\.mediaset\.it/
|
||||||
(?:
|
(?:
|
||||||
(?:fiction|programmi-tv|serie-tv|kids)/(?:.+?/)?
|
(?:fiction|programmi-tv|serie-tv|kids)/(?:.+?/)?
|
||||||
(?:[a-z-]+)_SE(?P<id>\d{12})
|
(?:[a-z-]+)_SE(?P<id>\d{12})
|
||||||
|
Loading…
Reference in New Issue
Block a user