]> jfr.im git - yt-dlp.git/blob - scripts/update-version.py
[youtube] Extract playlist description
[yt-dlp.git] / scripts / update-version.py
1 # Unused
2
3 from __future__ import unicode_literals
4 from datetime import datetime
5 import urllib.request
6
7 response = urllib.request.urlopen('https://blackjack4494.github.io/youtube-dlc/update/LATEST_VERSION')
8
9 _LATEST_VERSION = response.read().decode('utf-8')
10
11 _OLD_VERSION = _LATEST_VERSION.rsplit("-", 1)
12
13 if len(_OLD_VERSION) > 0:
14 old_ver = _OLD_VERSION[0]
15
16 old_rev = ''
17 if len(_OLD_VERSION) > 1:
18 old_rev = _OLD_VERSION[1]
19
20 now = datetime.now()
21 # ver = f'{datetime.today():%Y.%m.%d}'
22 ver = now.strftime("%Y.%m.%d")
23 rev = ''
24
25 if old_ver == ver:
26 if old_rev:
27 rev = int(old_rev) + 1
28 else:
29 rev = 1
30
31 _SEPARATOR = '-'
32
33 version = _SEPARATOR.join(filter(None, [ver, str(rev)]))