mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-05-24 14:26:29 +02:00
update workflow, semi fix integrated updater
This commit is contained in:
parent
b137e533ee
commit
915f2a92ac
7 changed files with 410 additions and 1 deletions
28
scripts/update-version.py
Normal file
28
scripts/update-version.py
Normal file
|
@ -0,0 +1,28 @@
|
|||
from datetime import datetime
|
||||
import urllib.request
|
||||
|
||||
response = urllib.request.urlopen('https://blackjack4494.github.io/youtube-dlc/update/LATEST_VERSION')
|
||||
|
||||
_LATEST_VERSION = response.read().decode('utf-8')
|
||||
|
||||
_OLD_VERSION = _LATEST_VERSION.rsplit("-", 1)
|
||||
|
||||
if len(_OLD_VERSION) > 0:
|
||||
old_ver = _OLD_VERSION[0]
|
||||
|
||||
old_rev = ''
|
||||
if len(_OLD_VERSION) > 1:
|
||||
old_rev = _OLD_VERSION[1]
|
||||
|
||||
ver = f'{datetime.today():%Y.%m.%d}'
|
||||
rev = ''
|
||||
|
||||
if old_ver == ver:
|
||||
if old_rev:
|
||||
rev = int(old_rev) + 1
|
||||
else:
|
||||
rev = 1
|
||||
|
||||
_SEPARATOR = '-'
|
||||
|
||||
version = _SEPARATOR.join(filter(None, [ver, str(rev)]))
|
Loading…
Add table
Add a link
Reference in a new issue