Compare commits

..

5 Commits

Author SHA1 Message Date
dirkf
6c9912e834
Remove initial space that is added in l.2391 if needed.Update youtube_dl/utils.py 2024-04-05 14:49:33 +01:00
dirkf
9ae12dc250
Revert and fix utils.bug_reports_message() (2) 2024-04-05 14:00:14 +01:00
dirkf
18d4b340f6
Apply suggestions from code review
Revert and fix `utils.bug_reports_message()` (1)

skipci
2024-04-05 13:55:43 +01:00
dirkf
e83b4e4638
Make bug_reports_message() fully updatable 2024-04-05 13:33:53 +01:00
dirkf
8d55e43949
Bring utils.py into the PR
Skip CI
2024-04-05 13:26:14 +01:00
2 changed files with 18 additions and 9 deletions

View File

@ -1812,10 +1812,10 @@ class InfoExtractor(object):
}
def _report_ignoring_subs(self, name):
self.report_warning(
self.report_warning(bug_reports_message(
'Ignoring subtitle tracks found in the {0} manifest; '
'if any subtitle tracks are missing, {1}'.format(name, bug_reports_message()),
only_once=True)
'if any subtitle tracks are missing,'.format(name)
), only_once=True)
def _extract_m3u8_formats(self, m3u8_url, video_id, ext=None,
entry_protocol='m3u8', preference=None,

View File

@ -2371,15 +2371,24 @@ def make_HTTPS_handler(params, **kwargs):
return YoutubeDLHTTPSHandler(params, context=context, **kwargs)
def bug_reports_message():
def bug_reports_message(before=';'):
if ytdl_is_updateable():
update_cmd = 'type youtube-dl -U to update'
else:
update_cmd = 'see https://yt-dl.org/update on how to update'
msg = '; please report this issue on https://yt-dl.org/bug .'
msg += ' Make sure you are using the latest version; %s.' % update_cmd
msg += ' Be sure to call youtube-dl with the --verbose flag and include its complete output.'
return msg
update_cmd = 'see https://github.com/ytdl-org/youtube-dl/#user-content-installation on how to update'
msg = (
'please report this issue on https://github.com/ytdl-org/youtube-dl/issues ,'
' using the appropriate issue template.'
' Make sure you are using the latest version; %s.'
' Be sure to call youtube-dl with the --verbose option and include the complete output.'
) % update_cmd
before = (before or '').rstrip()
if not before or before.endswith(('.', '!', '?')):
msg = msg[0].title() + msg[1:]
return (before + ' ' if before else '') + msg
class YoutubeDLError(Exception):