diff options
author | Felix S <felix.von.s@posteo.de> | 2021-04-22 21:16:29 +0200 |
---|---|---|
committer | Felix S <felix.von.s@posteo.de> | 2021-04-28 17:19:23 +0530 |
commit | 5873d4ccdd8f132e37c285665a1c5e72a81ecfe6 (patch) | |
tree | 3f288cf9b521a66c5e9f9f0e95ab4cd15bddf22f | |
parent | c72967d5de3eeccb6d787c4d9651ce544ca2ede2 (diff) | |
download | hypervideo-pre-5873d4ccdd8f132e37c285665a1c5e72a81ecfe6.tar.lz hypervideo-pre-5873d4ccdd8f132e37c285665a1c5e72a81ecfe6.tar.xz hypervideo-pre-5873d4ccdd8f132e37c285665a1c5e72a81ecfe6.zip |
[utils] Improve bug_report_message
Add an optional argument specifying the text that should go before
the message.
-rw-r--r-- | yt_dlp/utils.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/yt_dlp/utils.py b/yt_dlp/utils.py index 40d956808..9ddd6453f 100644 --- a/yt_dlp/utils.py +++ b/yt_dlp/utils.py @@ -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): |