]>
jfr.im git - yt-dlp.git/blob - scripts/update-version.py
1 from __future__
import unicode_literals
2 from datetime
import datetime
5 response
= urllib
.request
.urlopen('https://blackjack4494.github.io/youtube-dlc/update/LATEST_VERSION')
7 _LATEST_VERSION
= response
.read().decode('utf-8')
9 _OLD_VERSION
= _LATEST_VERSION
.rsplit("-", 1)
11 if len(_OLD_VERSION
) > 0:
12 old_ver
= _OLD_VERSION
[0]
15 if len(_OLD_VERSION
) > 1:
16 old_rev
= _OLD_VERSION
[1]
19 # ver = f'{datetime.today():%Y.%m.%d}'
20 ver
= now
.strftime("%Y.%m.%d")
25 rev
= int(old_rev
) + 1
31 version
= _SEPARATOR
.join(filter(None, [ver
, str(rev
)]))