mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-06-18 15:55:30 +02:00
parent
e491fd4d09
commit
7977b329ed
@ -44,6 +44,7 @@ yt-dlp is a feature-rich command-line audio/video downloader with support for [t
|
|||||||
* [Post-processing Options](#post-processing-options)
|
* [Post-processing Options](#post-processing-options)
|
||||||
* [SponsorBlock Options](#sponsorblock-options)
|
* [SponsorBlock Options](#sponsorblock-options)
|
||||||
* [Extractor Options](#extractor-options)
|
* [Extractor Options](#extractor-options)
|
||||||
|
* [Preset Aliases](#preset-aliases)
|
||||||
* [CONFIGURATION](#configuration)
|
* [CONFIGURATION](#configuration)
|
||||||
* [Configuration file encoding](#configuration-file-encoding)
|
* [Configuration file encoding](#configuration-file-encoding)
|
||||||
* [Authentication with netrc](#authentication-with-netrc)
|
* [Authentication with netrc](#authentication-with-netrc)
|
||||||
|
@ -9,11 +9,10 @@ from ..utils import (
|
|||||||
int_or_none,
|
int_or_none,
|
||||||
join_nonempty,
|
join_nonempty,
|
||||||
parse_qs,
|
parse_qs,
|
||||||
traverse_obj,
|
|
||||||
update_url_query,
|
update_url_query,
|
||||||
urlencode_postdata,
|
urlencode_postdata,
|
||||||
)
|
)
|
||||||
from ..utils.traversal import unpack
|
from ..utils.traversal import traverse_obj, unpack
|
||||||
|
|
||||||
|
|
||||||
class PlaySuisseIE(InfoExtractor):
|
class PlaySuisseIE(InfoExtractor):
|
||||||
|
@ -697,7 +697,7 @@ class SoundcloudIE(SoundcloudBaseIE):
|
|||||||
try:
|
try:
|
||||||
return self._extract_info_dict(info, full_title, token)
|
return self._extract_info_dict(info, full_title, token)
|
||||||
except ExtractorError as e:
|
except ExtractorError as e:
|
||||||
if not isinstance(e.cause, HTTPError) or not e.cause.status == 429:
|
if not isinstance(e.cause, HTTPError) or e.cause.status != 429:
|
||||||
raise
|
raise
|
||||||
self.report_warning(
|
self.report_warning(
|
||||||
'You have reached the API rate limit, which is ~600 requests per '
|
'You have reached the API rate limit, which is ~600 requests per '
|
||||||
|
@ -1342,7 +1342,7 @@ class TwitterIE(TwitterBaseIE):
|
|||||||
'tweet_mode': 'extended',
|
'tweet_mode': 'extended',
|
||||||
})
|
})
|
||||||
except ExtractorError as e:
|
except ExtractorError as e:
|
||||||
if not isinstance(e.cause, HTTPError) or not e.cause.status == 429:
|
if not isinstance(e.cause, HTTPError) or e.cause.status != 429:
|
||||||
raise
|
raise
|
||||||
self.report_warning('Rate-limit exceeded; falling back to syndication endpoint')
|
self.report_warning('Rate-limit exceeded; falling back to syndication endpoint')
|
||||||
status = self._call_syndication_api(twid)
|
status = self._call_syndication_api(twid)
|
||||||
|
@ -230,6 +230,9 @@ class _YoutubeDLOptionParser(optparse.OptionParser):
|
|||||||
formatter.indent()
|
formatter.indent()
|
||||||
heading = formatter.format_heading('Preset Aliases')
|
heading = formatter.format_heading('Preset Aliases')
|
||||||
formatter.indent()
|
formatter.indent()
|
||||||
|
description = formatter.format_description(
|
||||||
|
'Predefined aliases for convenience and ease of use. Note that future versions of yt-dlp '
|
||||||
|
'may add or adjust presets, but the existing preset names will not be changed or removed')
|
||||||
result = []
|
result = []
|
||||||
for name, args in _PRESET_ALIASES.items():
|
for name, args in _PRESET_ALIASES.items():
|
||||||
option = optparse.Option('-t', help=shlex.join(args))
|
option = optparse.Option('-t', help=shlex.join(args))
|
||||||
@ -238,7 +241,7 @@ class _YoutubeDLOptionParser(optparse.OptionParser):
|
|||||||
formatter.dedent()
|
formatter.dedent()
|
||||||
formatter.dedent()
|
formatter.dedent()
|
||||||
help_lines = '\n'.join(result)
|
help_lines = '\n'.join(result)
|
||||||
return f'{formatted_help}\n{heading}{help_lines}'
|
return f'{formatted_help}\n{heading}{description}\n{help_lines}'
|
||||||
|
|
||||||
|
|
||||||
def create_parser():
|
def create_parser():
|
||||||
@ -470,7 +473,7 @@ def create_parser():
|
|||||||
general.add_option(
|
general.add_option(
|
||||||
'--live-from-start',
|
'--live-from-start',
|
||||||
action='store_true', dest='live_from_start',
|
action='store_true', dest='live_from_start',
|
||||||
help='Download livestreams from the start. Currently only supported for YouTube (experimental) and Twitch')
|
help='Download livestreams from the start. Currently experimental and only supported for YouTube and Twitch')
|
||||||
general.add_option(
|
general.add_option(
|
||||||
'--no-live-from-start',
|
'--no-live-from-start',
|
||||||
action='store_false', dest='live_from_start',
|
action='store_false', dest='live_from_start',
|
||||||
@ -545,9 +548,9 @@ def create_parser():
|
|||||||
help=(
|
help=(
|
||||||
'Create aliases for an option string. Unless an alias starts with a dash "-", it is prefixed with "--". '
|
'Create aliases for an option string. Unless an alias starts with a dash "-", it is prefixed with "--". '
|
||||||
'Arguments are parsed according to the Python string formatting mini-language. '
|
'Arguments are parsed according to the Python string formatting mini-language. '
|
||||||
'E.g. --alias get-audio,-X "-S=aext:{0},abr -x --audio-format {0}" creates options '
|
'E.g. --alias get-audio,-X "-S aext:{0},abr -x --audio-format {0}" creates options '
|
||||||
'"--get-audio" and "-X" that takes an argument (ARG0) and expands to '
|
'"--get-audio" and "-X" that takes an argument (ARG0) and expands to '
|
||||||
'"-S=aext:ARG0,abr -x --audio-format ARG0". All defined aliases are listed in the --help output. '
|
'"-S aext:ARG0,abr -x --audio-format ARG0". All defined aliases are listed in the --help output. '
|
||||||
'Alias options can trigger more aliases; so be careful to avoid defining recursive options. '
|
'Alias options can trigger more aliases; so be careful to avoid defining recursive options. '
|
||||||
f'As a safety measure, each alias may be triggered a maximum of {_YoutubeDLOptionParser.ALIAS_TRIGGER_LIMIT} times. '
|
f'As a safety measure, each alias may be triggered a maximum of {_YoutubeDLOptionParser.ALIAS_TRIGGER_LIMIT} times. '
|
||||||
'This option can be used multiple times'))
|
'This option can be used multiple times'))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user