Skip to content
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

Merged
merged 6 commits into from Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions youtube_dl/extractor/common.py
Expand Up @@ -1812,10 +1812,10 @@ def _m3u8_meta_format(self, m3u8_url, ext=None, preference=None, m3u8_id=None):
}

def _report_ignoring_subs(self, name):
self.report_warning(bug_reports_message(
self.report_warning(
dirkf marked this conversation as resolved.
Show resolved Hide resolved
'Ignoring subtitle tracks found in the {0} manifest; '
'if any subtitle tracks are missing,'.format(name)
), only_once=True)
'if any subtitle tracks are missing, {1}'.format(name, bug_reports_message()),
only_once=True)
dirkf marked this conversation as resolved.
Show resolved Hide resolved

def _extract_m3u8_formats(self, m3u8_url, video_id, ext=None,
entry_protocol='m3u8', preference=None,
Expand Down
7 changes: 2 additions & 5 deletions youtube_dl/utils.py
Expand Up @@ -2371,15 +2371,12 @@ def set_alpn_protocols(ctx):
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'
dirkf marked this conversation as resolved.
Show resolved Hide resolved
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
return '; please report this issue on https://yt-dl.org/bug .'
dirkf marked this conversation as resolved.
Show resolved Hide resolved


class YoutubeDLError(Exception):
Expand Down