mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-08-15 00:48:28 +00:00
Apply review suggestions
Co-Authored-By: bashonly <88596187+bashonly@users.noreply.github.com>
This commit is contained in:
parent
9ff32adb33
commit
168752f705
@ -162,9 +162,6 @@ ## UPDATE
|
|||||||
* `yt-dlp --update-to 2023.10.07` upgrade/downgrade to tag `2023.10.07` if it exists on the current channel
|
* `yt-dlp --update-to 2023.10.07` upgrade/downgrade to tag `2023.10.07` if it exists on the current channel
|
||||||
* `yt-dlp --update-to example/yt-dlp@2023.09.24` upgrade/downgrade to the release from the `example/yt-dlp` repository, tag `2023.09.24`
|
* `yt-dlp --update-to example/yt-dlp@2023.09.24` upgrade/downgrade to the release from the `example/yt-dlp` repository, tag `2023.09.24`
|
||||||
|
|
||||||
When running a yt-dlp version that is older than 90 days, you will see a warning message suggesting to update to the latest version.
|
|
||||||
You can suppress this warning by adding `--no-update` to your command or configuration file.
|
|
||||||
|
|
||||||
**Important**: Any user experiencing an issue with the `stable` release should install or update to the `nightly` release before submitting a bug report:
|
**Important**: Any user experiencing an issue with the `stable` release should install or update to the `nightly` release before submitting a bug report:
|
||||||
```
|
```
|
||||||
# To update to nightly from stable executable/binary:
|
# To update to nightly from stable executable/binary:
|
||||||
@ -174,6 +171,9 @@ # To install nightly with pip:
|
|||||||
python3 -m pip install -U --pre "yt-dlp[default]"
|
python3 -m pip install -U --pre "yt-dlp[default]"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
When running a yt-dlp version that is older than 90 days, you will see a warning message suggesting to update to the latest version.
|
||||||
|
You can suppress this warning by adding `--no-update` to your command or configuration file.
|
||||||
|
|
||||||
## DEPENDENCIES
|
## DEPENDENCIES
|
||||||
Python versions 3.9+ (CPython) and 3.11+ (PyPy) are supported. Other versions and implementations may or may not work correctly.
|
Python versions 3.9+ (CPython) and 3.11+ (PyPy) are supported. Other versions and implementations may or may not work correctly.
|
||||||
|
|
||||||
|
@ -505,6 +505,7 @@ class YoutubeDL:
|
|||||||
force_keyframes_at_cuts: Re-encode the video when downloading ranges to get precise cuts
|
force_keyframes_at_cuts: Re-encode the video when downloading ranges to get precise cuts
|
||||||
noprogress: Do not print the progress bar
|
noprogress: Do not print the progress bar
|
||||||
live_from_start: Whether to download livestreams videos from the start
|
live_from_start: Whether to download livestreams videos from the start
|
||||||
|
warn_when_outdated: Emit a warning if the yt-dlp version is older than 90 days
|
||||||
|
|
||||||
The following parameters are not used by YoutubeDL itself, they are used by
|
The following parameters are not used by YoutubeDL itself, they are used by
|
||||||
the downloader (see yt_dlp/downloader/common.py):
|
the downloader (see yt_dlp/downloader/common.py):
|
||||||
@ -704,8 +705,7 @@ def process_color_policy(stream):
|
|||||||
system_deprecation = _get_system_deprecation()
|
system_deprecation = _get_system_deprecation()
|
||||||
if system_deprecation:
|
if system_deprecation:
|
||||||
self.deprecated_feature(system_deprecation.replace('\n', '\n '))
|
self.deprecated_feature(system_deprecation.replace('\n', '\n '))
|
||||||
|
elif self.params.get('warn_when_outdated'):
|
||||||
if self.params.get('warn_when_outdated'):
|
|
||||||
if version_age_warning := _get_version_age_warning():
|
if version_age_warning := _get_version_age_warning():
|
||||||
self.report_warning(version_age_warning)
|
self.report_warning(version_age_warning)
|
||||||
|
|
||||||
|
@ -173,25 +173,18 @@ def _get_system_deprecation():
|
|||||||
|
|
||||||
|
|
||||||
def _get_version_age_warning():
|
def _get_version_age_warning():
|
||||||
# Only yt-dlp guarantees a stable release at least every 3 months
|
# Only yt-dlp guarantees a stable release at least every 90 days
|
||||||
if not ORIGIN.startswith('yt-dlp/'):
|
if not ORIGIN.startswith('yt-dlp/'):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
try:
|
with contextlib.suppress(Exception):
|
||||||
version_parts = version_tuple(__version__)
|
last_updated = dt.date(*version_tuple(__version__)[:3])
|
||||||
if len(version_parts) < 3:
|
if last_updated < dt.datetime.now(dt.timezone.utc).date() - dt.timedelta(days=90):
|
||||||
return None
|
|
||||||
|
|
||||||
update_message = UPDATE_HINT or 'Run "yt-dlp --update" to update'
|
|
||||||
|
|
||||||
if dt.date(*version_parts[:3]) < dt.datetime.now(dt.timezone.utc).date() - dt.timedelta(days=90):
|
|
||||||
return ('\n '.join((
|
return ('\n '.join((
|
||||||
f'Your yt-dlp version ({__version__}) is older than 90 days!',
|
f'Your yt-dlp version ({__version__}) is older than 90 days!',
|
||||||
'It is strongly recommeded to always use the latest versions, as sites regularly change and extractors need to be adjusted.',
|
'It is strongly recommended to always use the latest version.',
|
||||||
f'{update_message}. To suppress this warning, add "--no-update" to your command/config.')))
|
f'{UPDATE_HINT or """Run "yt-dlp -U" to update"""}.',
|
||||||
except Exception:
|
'To suppress this warning, add --no-update to your command/config.')))
|
||||||
pass
|
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user