mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-09-23 02:41:24 +02:00
Compare commits
No commits in common. "ba05b740ef32dddd2982cc4ed782d8af84a3beb8" and "520545b6ded38b42c788362871364010da734a96" have entirely different histories.
ba05b740ef
...
520545b6de
|
@ -279,14 +279,16 @@ class Updater:
|
||||||
def _get_version_info(self, tag: str) -> tuple[str | None, str | None]:
|
def _get_version_info(self, tag: str) -> tuple[str | None, str | None]:
|
||||||
if _VERSION_RE.fullmatch(tag):
|
if _VERSION_RE.fullmatch(tag):
|
||||||
return tag, None
|
return tag, None
|
||||||
|
elif self._exact and tag != 'latest':
|
||||||
|
return None, None
|
||||||
|
|
||||||
api_info = self._call_api(tag)
|
api_info = self._call_api(tag)
|
||||||
|
|
||||||
if tag == 'latest':
|
if tag == 'latest':
|
||||||
requested_version = api_info['tag_name']
|
requested_version = api_info['tag_name']
|
||||||
else:
|
else:
|
||||||
match = re.search(rf'\s+(?P<version>{_VERSION_RE.pattern})$', api_info.get('name', ''))
|
match = _VERSION_RE.search(api_info.get('name', ''))
|
||||||
requested_version = match.group('version') if match else None
|
requested_version = match[0] if match else None
|
||||||
|
|
||||||
if re.fullmatch(_HASH_PATTERN, api_info.get('target_commitish', '')):
|
if re.fullmatch(_HASH_PATTERN, api_info.get('target_commitish', '')):
|
||||||
target_commitish = api_info['target_commitish']
|
target_commitish = api_info['target_commitish']
|
||||||
|
@ -374,7 +376,7 @@ class Updater:
|
||||||
elif target_commitish:
|
elif target_commitish:
|
||||||
has_update = target_commitish != self.current_commit
|
has_update = target_commitish != self.current_commit
|
||||||
else:
|
else:
|
||||||
has_update = False
|
has_update = True
|
||||||
|
|
||||||
current_label = _make_label(ORIGIN, CHANNEL.partition("@")[2] or self.current_version, self.current_version)
|
current_label = _make_label(ORIGIN, CHANNEL.partition("@")[2] or self.current_version, self.current_version)
|
||||||
if not has_update:
|
if not has_update:
|
||||||
|
@ -443,6 +445,8 @@ class Updater:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
self.ydl.to_screen(f'Current Build Hash: {_sha256_file(self.filename)}')
|
self.ydl.to_screen(f'Current Build Hash: {_sha256_file(self.filename)}')
|
||||||
|
if not update_info.checksum:
|
||||||
|
self._block_restart('Automatically restarting into unverified builds is disabled for security reasons')
|
||||||
|
|
||||||
update_label = _make_label(self.requested_repo, update_info.tag, update_info.version)
|
update_label = _make_label(self.requested_repo, update_info.tag, update_info.version)
|
||||||
self.ydl.to_screen(f'Updating to {update_label} ...')
|
self.ydl.to_screen(f'Updating to {update_label} ...')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user