Skip to content

Commit

Permalink
upload new version
Browse files Browse the repository at this point in the history
  • Loading branch information
yaronzz committed Feb 7, 2022
1 parent 1d5b8cd commit c9ae7bf
Show file tree
Hide file tree
Showing 8 changed files with 1,882 additions and 59 deletions.
Binary file modified TIDALDL-PY/exe/tidal-dl.exe
Binary file not shown.
14 changes: 7 additions & 7 deletions TIDALDL-PY/tidal_dl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ def setAccessToken():
def setAPIKey():
global LANG
item = apiKey.getItem(CONF.apiKeyIndex)
ver = apiKey.getVersion()
Printf.info(f'Current APIKeys: {str(CONF.apiKeyIndex)} {item["platform"]}-{item["formats"]}')
Printf.info(f'Current Version: {str(ver)}')
Printf.apikeys(apiKey.getItems())
index = int(Printf.enterLimit("APIKEY index:", LANG.MSG_INPUT_ERR, apiKey.getLimitIndexs()))

Expand Down Expand Up @@ -196,13 +198,11 @@ def main():

checkLogin()

# onlineVer = getLastVersion('tidal-dl')
# if not isNull(onlineVer):
# icmp = cmpVersion(onlineVer, VERSION)
# if icmp > 0:
# Printf.info(LANG.PRINT_LATEST_VERSION + ' ' + onlineVer)

# Printf.info("For some reasons, this version only supports LOSSLESS.")
onlineVer = getLastVersion('tidal-dl')
if not isNull(onlineVer):
icmp = cmpVersion(onlineVer, VERSION)
if icmp > 0:
Printf.info(LANG.PRINT_LATEST_VERSION + ' ' + onlineVer)

while True:
Printf.choices()
Expand Down
121 changes: 71 additions & 50 deletions TIDALDL-PY/tidal_dl/apiKey.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,52 +8,57 @@
@Contact : [email protected]
@Desc :
"""
import json
import requests

__API_KEYS__ = [
#api key from @Fokka-Engineering
#https://github.com/Fokka-Engineering/libopenTIDAL/blob/655528e26e4f3ee2c426c06ea5b8440cf27abc4a/README.md#example
{
'platform': 'Fire TV',
'formats': 'Normal/High/HiFi(No Master)',
'clientId': 'OmDtrzFgyVVL6uW56OnFA2COiabqm',
'clientSecret': 'zxen1r3pO0hgtOC7j6twMo9UAqngGrmRiWpV7QC1zJ8=',
'valid': 'False',
},
#api key from @Dniel97
#https://github.com/Dniel97/RedSea/blob/4ba02b88cee33aeb735725cb854be6c66ff372d4/config/settings.example.py#L68
{
'platform': 'Fire TV',
'formats': 'Master-Only(Else Error)',
'clientId': '7m7Ap0JC9j1cOM3n',
'clientSecret': 'vRAdA108tlvkJpTsGZS8rGZ7xTlbJ0qaZ2K9saEzsgY=',
'valid': 'True',
},
{
'platform': 'Android TV',
'formats': 'Normal/High/HiFi(No Master)',
'clientId': 'Pzd0ExNVHkyZLiYN',
'clientSecret': 'W7X6UvBaho+XOi1MUeCX6ewv2zTdSOV3Y7qC3p3675I=',
'valid': 'False',
},
#api key from @morguldir
#https://github.com/morguldir/python-tidal/commit/50f1afcd2079efb2b4cf694ef5a7d67fdf619d09
{
'platform': 'TV',
'formats': 'Normal/High/HiFi/Master',
'clientId': '8SEZWa4J1NVC5U5Y',
'clientSecret': 'owUYDkxddz+9FpvGX24DlxECNtFEMBxipU0lBfrbq60=',
'valid': 'False',
},
{
'platform': 'Android Auto',
'formats': 'Normal/High/HiFi/Master',
'clientId': 'zU4XHVVkc2tDPo4t',
'clientSecret': 'VJKhDFqJPqvsPVNBV6ukXTJmwlvbttP7wlMlrc72se4=',
'valid': 'True',
},

]

__KEYS_JSON__ = '''
{
"version": "1.0.1",
"keys": [
{
"platform": "Fire TV",
"formats": "Normal/High/HiFi(No Master)",
"clientId": "OmDtrzFgyVVL6uW56OnFA2COiabqm",
"clientSecret": "zxen1r3pO0hgtOC7j6twMo9UAqngGrmRiWpV7QC1zJ8=",
"valid": "False",
"from": "Fokka-Engineering (https://github.com/Fokka-Engineering/libopenTIDAL/blob/655528e26e4f3ee2c426c06ea5b8440cf27abc4a/README.md#example)"
},
{
"platform": "Fire TV",
"formats": "Master-Only(Else Error)",
"clientId": "7m7Ap0JC9j1cOM3n",
"clientSecret": "vRAdA108tlvkJpTsGZS8rGZ7xTlbJ0qaZ2K9saEzsgY=",
"valid": "True",
"from": "Dniel97 (https://github.com/Dniel97/RedSea/blob/4ba02b88cee33aeb735725cb854be6c66ff372d4/config/settings.example.py#L68)"
},
{
"platform": "Android TV",
"formats": "Normal/High/HiFi(No Master)",
"clientId": "Pzd0ExNVHkyZLiYN",
"clientSecret": "W7X6UvBaho+XOi1MUeCX6ewv2zTdSOV3Y7qC3p3675I=",
"valid": "False",
"from": ""
},
{
"platform": "TV",
"formats": "Normal/High/HiFi/Master",
"clientId": "8SEZWa4J1NVC5U5Y",
"clientSecret": "owUYDkxddz+9FpvGX24DlxECNtFEMBxipU0lBfrbq60=",
"valid": "False",
"from": "morguldir (https://github.com/morguldir/python-tidal/commit/50f1afcd2079efb2b4cf694ef5a7d67fdf619d09)"
},
{
"platform": "Android Auto",
"formats": "Normal/High/HiFi/Master",
"clientId": "zU4XHVVkc2tDPo4t",
"clientSecret": "VJKhDFqJPqvsPVNBV6ukXTJmwlvbttP7wlMlrc72se4=",
"valid": "True",
"from": "1nikolas (https://github.com/yaronzz/Tidal-Media-Downloader/pull/840)"
}
]
}
'''
__API_KEYS__ = json.loads(__KEYS_JSON__)
__ERROR_KEY__ = {
'platform': 'None',
'formats': '',
Expand All @@ -63,22 +68,38 @@
},



def getNum():
return len(__API_KEYS__)
return len(__API_KEYS__['keys'])


def getItem(index: int):
if index < 0 or index >= len(__API_KEYS__):
if index < 0 or index >= len(__API_KEYS__['keys']):
return __ERROR_KEY__
return __API_KEYS__[index]
return __API_KEYS__['keys'][index]


def getItems():
return __API_KEYS__
return __API_KEYS__['keys']


def getLimitIndexs():
array = []
for i in range(len(__API_KEYS__)):
for i in range(len(__API_KEYS__['keys'])):
array.append(str(i))
return array


def getVersion():
return __API_KEYS__['version']

#Load from gist
try:
respond = requests.get('https://api.github.com/gists/48d01f5a24b4b7b37f19443977c22cd6')
if respond.status_code == 200:
content = respond.json()['files']['tidal-api-key.json']['content']
__API_KEYS__ = json.loads(content)
except:
pass


2 changes: 1 addition & 1 deletion TIDALDL-PY/tidal_dl/printf.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
https://github.com/yaronzz/Tidal-Media-Downloader
'''
VERSION = '2022.01.21.2'
VERSION = '2022.02.07.1'


class Printf(object):
Expand Down
Loading

0 comments on commit c9ae7bf

Please sign in to comment.