mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-10 03:10:38 +00:00
[utils] Improve bug_report_message
Add an optional argument specifying the text that should go before the message.
This commit is contained in:
parent
c72967d5de
commit
5873d4ccdd
@ -2340,15 +2340,20 @@ 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 yt-dlp -U to update'
|
||||
else:
|
||||
update_cmd = 'see https://github.com/yt-dlp/yt-dlp on how to update'
|
||||
msg = '; please report this issue on https://github.com/yt-dlp/yt-dlp .'
|
||||
msg = 'please report this issue on https://github.com/yt-dlp/yt-dlp .'
|
||||
msg += ' Make sure you are using the latest version; %s.' % update_cmd
|
||||
msg += ' Be sure to call yt-dlp with the --verbose flag and include its complete output.'
|
||||
return msg
|
||||
|
||||
before = before.rstrip()
|
||||
if not before or before.endswith(('.', '!', '?')):
|
||||
msg = msg[0].title() + msg[1:]
|
||||
|
||||
return (before + ' ' if before else '') + msg
|
||||
|
||||
|
||||
class YoutubeDLError(Exception):
|
||||
|
Loading…
Reference in New Issue
Block a user