def logIn(username="", password=""):
    cf = TidalConfig()
    if username == "" or password == "":
        print("----------------LogIn------------------")
        username = myinput("username:"******"password:"******"" and account2.errmsg != "":
            printErr(0, account.errmsg)
            return False
        elif account.errmsg != "":
            account = account2
        elif account2.errmsg != "":
            account2 = account
        cf.set_account(username, password, account.session_id,
                       account.country_code, account.user_id,
                       account2.session_id)

    Curtime = time.time()
    cf.set_lastlogintime(str(Curtime))
    return True
示例#2
0
def logIn(username="", password=""):
    if username == "" or password == "":
        print("----------------LogIn------------------")
        username = myinput("username:"******"password:"******"":
    #     printErr(0, account.errmsg)
    #     return False
    # if account2.errmsg != "":
    #     printErr(0, account2.errmsg)
    #     return False
    if account.errmsg != "" and account2.errmsg != "":
        printErr(0, account.errmsg)
        return False
    elif account.errmsg != "":
        account = account2
    elif account2.errmsg != "":
        account2 = account

    cf = TidalConfig()
    cf.set_account(username, password, account.session_id, account.country_code, account.user_id, account2.session_id)

    Curtime = time.time()
    cf.set_lastlogintime(str(Curtime))
    return True
示例#3
0
def logIn(username = "", password = ""):
    if username == "" or password == "":
        print("----------------LogIn------------------")
        username = myinput("username:"******"password:"******"":
        printErr(0, account.errmsg)
        return False
    if account2.errmsg != "":
        printErr(0, account2.errmsg)
        return False

    cf = TidalConfig()
    cf.set_account(username, password, account.session_id, account.country_code, account.user_id, account2.session_id)
    return True
def debug():
    cf = TidalConfig()

    # import tidalapi
    # test = tidalapi.Config()
    # session = tidalapi.Session()
    # session.login(cf.username, cf.password)
    # TIDAL_TOKEN.token2 = "wc8j_yBJd20zOmx0"
    # x-tidal-token: qe5mgUGPtIfbgN574ngS74Sd1OmKIfvcLx7e28Yk
    # TIDAL_TOKEN.token1 = "CzET4vdadNUFQ5JU"

    TIDAL_TOKEN.token1 = "qe5mgUGPtIfbgN574ngS74Sd1OmKIfvcLx7e28Yk"
    TIDAL_TOKEN.token1 = "u5qPNNYIbD0S0o36MrAiFZ56K6qMCrCmYPzZuTnV"

    # TIDAL_TOKEN.token1 = TIDAL_TOKEN.token2
    account = TidalAccount(cf.username, cf.password, TIDAL_TOKEN, False, cf)

    # import requests
    # import uuid
    # from urllib.parse import urljoin

    # headers = {"X-Tidal-Token": 'u5qPNNYIbD0S0o36MrAiFZ56K6qMCrCmYPzZuTnV'}
    # postParams = {
    #     'username': '******',
    #     'password': '******',
    #     'token': 'u5qPNNYIbD0S0o36MrAiFZ56K6qMCrCmYPzZuTnV',
    #     'clientUniqueKey': str(uuid.uuid4()).replace('-', '')[16:],
    #     'clientVersion': '1.9.1'
    # }
    # location = 'https://api.tidalhifi.com/v1/'
    # myurl = urljoin(location, 'login/username')
    # re = requests.post(myurl, data=postParams)
    # tt = TidalMobileSession(cf.username, cf.password,'RnhXoTmoJgARtXHr')
    if logIn(cf.username, cf.password) == False:
        pass

    # add tag Credits,Info song and full tag (discnumber,irsc,composer,arrenger,publisher,replayGain,releasedate)
    # https://api.tidal.com/v1/albums/71121869/tracks?token=wdgaB1CilGA-S_s2&countryCode=TH
    print('\nThis is the debug version!!\n')
    # os.system("pip install aigpy --upgrade")
    # trackid = 70973230
    dl = Download(1)
    dl.downloadTrack("90521281")