mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-08-14 18:49:06 -07:00
[core] Align error reporting methods with yt-dlp
This commit is contained in:
parent
f47fdb9564
commit
d5ef405c5d
3 changed files with 36 additions and 16 deletions
|
@ -72,7 +72,8 @@ class FakeYDL(YoutubeDL):
|
|||
def to_screen(self, s, skip_eol=None):
|
||||
print(s)
|
||||
|
||||
def trouble(self, s, tb=None):
|
||||
def trouble(self, *args, **kwargs):
|
||||
s = args[0] if len(args) > 0 else kwargs.get('message', 'Missing message')
|
||||
raise Exception(s)
|
||||
|
||||
def download(self, x):
|
||||
|
|
|
@ -930,17 +930,11 @@ class TestYoutubeDL(unittest.TestCase):
|
|||
# Test case for https://github.com/ytdl-org/youtube-dl/issues/27064
|
||||
def test_ignoreerrors_for_playlist_with_url_transparent_iterable_entries(self):
|
||||
|
||||
class _YDL(YDL):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(_YDL, self).__init__(*args, **kwargs)
|
||||
|
||||
def trouble(self, s, tb=None):
|
||||
pass
|
||||
|
||||
ydl = _YDL({
|
||||
ydl = YDL({
|
||||
'format': 'extra',
|
||||
'ignoreerrors': True,
|
||||
})
|
||||
ydl.trouble = lambda *_, **__: None
|
||||
|
||||
class VideoIE(InfoExtractor):
|
||||
_VALID_URL = r'video:(?P<id>\d+)'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue