aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Avtalion <ori@avtalion.name>2024-04-05 17:25:29 +0300
committerGitHub <noreply@github.com>2024-04-05 15:25:29 +0100
commit4ea59c6107d63bbabe1de74569ceb984b1646426 (patch)
tree42253840ecbf67b64e01ef18177ff495aa13d85d
parent21792b88b791b16e3ab0a0fb2e26e5bb8a4e2ff3 (diff)
[utils] Fix crash in _report_ignoring_subs from c58b655 (#32762)
Align `utils.bug_reports_message()` with yt-dlp https://github.com/yt-dlp/yt-dlp/commit/5873d4ccdd, thanks fstirlitz --------- Co-authored-by: dirkf <fieldhouse@gmx.net>
-rw-r--r--youtube_dl/utils.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index 083446342..e1b05b307 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -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):