-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[extractor/common] Fix crash in _report_ignoring_subs #32762
Conversation
Thanks, good catch. There was supposed to be a matching change to Would you like to revert your change and apply the missing change (adapted from yt-dlp) instead? --- old/youtube-dl/youtube_dl/utils.py
+++ new/youtube-dl/youtube_dl/utils.py
@@ -2371,15 +2371,24 @@
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): |
@dirkf That makes much more sense! I'm uncomfortable with copy-pasting someone else's code without credit - I'd much rather you commit it as originally intended. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With my maintainer superpower, I (will) have added some commits into your PR branch to make my suggested change.
It would be a great help if you'd be able to pull the latest version of the branch and test that the issue is fixed (since I'm deep in the mind-numbing twaddle that fixing the TikTok extractor brings).
Once it's OK, I can merge the PR as a single commit credited to us jointly with acknowledgments to yt-dlp, and then it can be in the next nightly build.
Revert and fix `utils.bug_reports_message()` (1) skipci
The video that caused the issues no longer does (probably because it was a live video on youtube, and after a while, I think they re-encode it in a different format.) But I forced the error, and it works fine. My only suggestion is removing the whitespace before |
Yes, the crash would only have been seen in this specific combination of circumstances:
Many thanks for your help! |
* https://github.com/ytdl-org/youtube-dl: [utils] Fix crash in _report_ignoring_subs from c58b655 (ytdl-org#32762)
Before submitting a pull request make sure you have:
In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:
What is the purpose of your pull request?
Description of your pull request and other information
When subs are not available and
_report_ignoring_subs
is called, it crashes because it passes an argument tobug_reports_message
, which accepts none.I changed it to be appended to the message, like what's done in other places.
Now the message is like this:
The ", ;" is not correct but I don't know if you want to get rid of the semicolon. The important thing is that it doesn't crash, and the file can be downloaded.