]> jfr.im git - yt-dlp.git/commitdiff
[update] Do not check `_update_spec` when up to date
authorpukkandan <redacted>
Wed, 29 Jun 2022 22:07:48 +0000 (03:37 +0530)
committerpukkandan <redacted>
Wed, 29 Jun 2022 23:32:19 +0000 (05:02 +0530)
yt_dlp/update.py

index 9589443a70f289690d231245d2e7782269f5d227..7f15aa211e0be0ed86a14dd722833873ad4a59c7 100644 (file)
@@ -88,6 +88,10 @@ def __init__(self, ydl):
 
     @functools.cached_property
     def _tag(self):
+        latest = self._get_version_info('latest')['tag_name']
+        if version_tuple(__version__) >= version_tuple(latest):
+            return 'latest'
+
         identifier = f'{detect_variant()} {system_identifier()}'
         for line in self._download('_update_spec', 'latest').decode().splitlines():
             if not line.startswith('lock '):