def main():
    if len(sys.argv) > 1:
        mainCommand()
        return

    Printf.logo()
    Printf.settings(CONF)

    checkLogin()

    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()
        choice = Printf.enter(LANG.PRINT_ENTER_CHOICE)
        if choice == "0":
            return
        elif choice == "1":
            checkLogin()
        elif choice == "2":
            changeSettings()
        else:
            start(USER, CONF, choice)
Esempio n. 2
0
def main(argv=None):
    print(LOG)
    cf = TidalConfig()
    if logIn(cf.username, cf.password) == False:
        while logIn("", "") == False:
            pass
    
    cf = TidalConfig()
    onlineVer = pipHelper.getLastVersion('tidal-dl')
    print("====================Tidal-dl========================")
    # print("Username     :\t" + cf.username)
    print("OutputDir    :\t" + cf.outputdir)
    # print("SessionID    :\t" + cf.sessionid)
    # print("CountryCode  :\t" + cf.countrycode)
    print("SoundQuality :\t" + cf.quality)
    print("Resolution   :\t" + cf.resolution)
    print("ThreadNum    :\t" + cf.threadnum)
    print("OnlyM4a      :\t" + cf.onlym4a)
    print("ShowProgress :\t" + cf.showprogress + "(enable when threadnum=1)")
    print("AddHyphen    :\t" + cf.addhyphen + "(between number and title)")
    print("AddYear      :\t" + cf.addyear + "(before album title)")
    print("Version      :\t" + TIDAL_DL_VERSION)
    if onlineVer != None:
        print("LastVer      :\t" + onlineVer)
    print("====================================================")
    
    dl = Download(cf.threadnum)
    if not dl.ffmpeg.enable:
        printWarring(0, "Couldn't find ffmpeg!\n")
    while True:
        printMenu()
        strchoice,choice = printChoice2("Enter Choice:", 99)
        if choice == 0:
            return
        elif choice == 1:
            logIn()
            cf = TidalConfig()
            dl = Download(cf.threadnum)
        elif choice == 2:
            setting()
            cf = TidalConfig()
            dl = Download(cf.threadnum)
        elif choice == 3:
            dl.downloadAlbum()
        elif choice == 4:
            dl.downloadTrack()
        elif choice == 5:
            dl.downloadPlaylist()
        elif choice == 6:
            dl.downloadVideo()
        elif choice == 7:
            dl.downloadFavorite()
        elif choice == 8:
            dl.downloadArtistAlbum()
        elif choice == 9:
            showConfig()
        else:
            dl.downloadUrl(strchoice)
            dl.downloadByFile(strchoice)
def main(argv=None):
    print(tidal.LOG)

    cf = TidalConfig()
    while logIn(cf.username, cf.password) == False:
        pass

    if cf.username == "" or cf.password == "":
        cf = TidalConfig()

    onlineVer = pipHelper.getLastVersion('tidal-dl')
    print("====================Tidal-dl========================")
    print("Username     :\t" + cf.username)
    print("OutputDir    :\t" + cf.outputdir)
    print("SessionID    :\t" + cf.sessionid)
    print("CountryCode  :\t" + cf.countrycode)
    print("SoundQuality :\t" + cf.quality)
    print("Resolution   :\t" + cf.resolution)
    print("ThreadNum    :\t" + cf.threadnum)
    print("OnlyM4a      :\t" + cf.onlym4a)
    print("Version      :\t" + TIDAL_DL_VERSION)
    if onlineVer != None:
        print("LastVer      :\t" + onlineVer)
    print("====================================================")

    dl = Download()
    if not dl.ffmpeg.enable:
        printWarring(0, "Couldn't find ffmpeg!\n")
    while True:
        printMenu()
        strchoice, choice = printChoice2("Enter Choice:", 99)
        if choice == 0:
            return
        elif choice == 1:
            logIn()
            dl = Download(cf.threadnum)
        elif choice == 2:
            setting()
            dl = Download(cf.threadnum)
        elif choice == 3:
            dl.downloadAlbum()
        elif choice == 4:
            dl.downloadTrack()
        elif choice == 5:
            dl.downloadPlaylist()
        elif choice == 6:
            dl.downloadVideo()
        elif choice == 7:
            dl.downloadFavorite()
        elif choice == 8:
            dl.downloadArtistAlbum()
        else:
            dl.downloadUrl(strchoice)
Esempio n. 4
0
def main():
    if len(sys.argv) > 1:
        mainCommand()
        return

    Printf.logo()
    Printf.settings(CONF)

    checkLogin()

    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()
        raw = Printf.enter(LANG.PRINT_ENTER_CHOICE).strip()

        choice = int(re.sub('[^0-9]', '', raw))
        if choice == 0:
            return
        elif choice == 1:
            checkLogin()
        elif choice == 2:
            changeSettings()
        elif choice == 3:
            checkLogout()
        elif choice == 4:
            Printf.searchTypes()

            searchRaw = Printf.enter(LANG.PRINT_ENTER_CHOICE).strip()

            searchType = int(re.sub('[^0-9]', '', searchRaw))

            if (searchType == 3):
                searchRaw = Printf.enter("Enter a url or id: ").strip()
                start(TOKEN, CONF, searchRaw)
                return

            field = "track" if searchType == 0 else 'album' if searchType == 1 else 'playlist'

            if searchType >= 0 and searchType <= 2:
                song = Printf.enter("Enter the song name: ")
                searchTrack(TOKEN, LANG.PRINT_ENTER_CHOICE, field, song, CONF)
            else:
                os.system('clear')
                Printf.err("Invalid option!")
        else:
            os.system('clear')
            Printf.err("Invalid option!")
def main():
    if len(sys.argv) > 1:
        mainCommand()
        return

    Printf.logo()
    Printf.settings(CONF)

    checkLogin()

    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()
        choice = Printf.enter(LANG.PRINT_ENTER_CHOICE)
        if choice == "0":
            return
        elif choice == "1":
            checkLogin()
        elif choice == "2":
            changeSettings()
        elif choice == "3":
            checkLogout()
        elif choice == "4":
            setAccessToken()
        elif choice == '5':
            if setAPIKey():
                checkLogout()
        elif choice == "10":  # test track
            start(TOKEN, CONF, '70973230')
        elif choice == "11":  # test video
            start(TOKEN, CONF, '188932980')
        elif choice == "12":  # test album
            start(TOKEN, CONF, '58138532')
        elif choice == "13":  # test playlist
            start(TOKEN, CONF, '98235845-13e8-43b4-94e2-d9f8e603cee7')
        elif choice == "14":  # test playlist
            start(TOKEN, CONF, '01453963b7dbd41c8b82ccb678d127')
        else:
            start(TOKEN, CONF, choice)
Esempio n. 6
0
def main(argv=None):
    cf = TidalConfig()
    print(tidal.LOG)
    while logIn(cf.username, cf.password) == False:
        pass

    onlineVer = pipHelper.getLastVersion('tidal-dl')
    print("====================Tidal-dl========================")
    print("OutputDir    :\t" + cf.outputdir)
    print("SessionID    :\t" + cf.sessionid)
    print("CountryCode  :\t" + cf.countrycode)
    print("SoundQuality :\t" + cf.quality)
    print("Resolution   :\t" + cf.resolution)
    print("ThreadNum    :\t" + cf.threadnum)
    print("Version      :\t" + TIDAL_DL_VERSION)
    if onlineVer != None:
        print("LastVer      :\t" + onlineVer)
    print("====================================================")

    dl = Download()
    while True:
        printMenu()
        choice = printChoice("Enter Choice:", True, 99)
        if choice == 0:
            return
        elif choice == 1:
            logIn()
            dl = Download(cf.threadnum)
        elif choice == 2:
            setting()
            dl = Download(cf.threadnum)
        elif choice == 3:
            dl.downloadAlbum()
        elif choice == 4:
            dl.downloadTrack()
        elif choice == 5:
            dl.downloadPlaylist()
        elif choice == 6:
            dl.downloadVideo()
        elif choice == 7:
            dl.downloadFavorite()
        elif choice == 8:
            dl.downloadArtistAlbum()
def main():
    if len(sys.argv) > 1:
        mainCommand()
        return

    Printf.logo()
    Printf.settings(CONF)

    checkLogin()
    autoGetAccessToken()

    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()
        choice = Printf.enter(LANG.PRINT_ENTER_CHOICE)
        if choice == "0":
            return
        elif choice == "1":
            login()
        elif choice == "2":
            changeSettings()
        elif choice == "3":
            setAccessToken()
        elif choice == "4":
            #batch processing
            try:
                with open('batch.txt') as batchfile:
                    line = batchfile.readline()
                    while line:
                        if len(line.strip()) > 0:
                            print('\033[1m' + f"Batching {line.strip()}" + '\033[0m')
                            start(USER, CONF, line.strip())
                            line = batchfile.readline()
            except:
                traceback.print_exc()
        else:
            start(USER, CONF, choice)
Esempio n. 8
0
def main(argv=None):
    if byCommand() is True:
        return

    print(LOG)
    cf = TidalConfig()
    if logIn(cf.username, cf.password) == False:
        while logIn("", "") == False:
            pass

    cf = TidalConfig()
    onlineVer = pipHelper.getLastVersion('tidal-dl')
    print("====================Tidal-dl========================")
    print("Output directory                 : " + cf.outputdir)
    print("Sound Quality                    : " + cf.quality)
    print("Video Resolution                 : " + cf.resolution)
    print("Download Threads                 : " + cf.threadnum)
    print("Only M4a                         : " + cf.onlym4a)
    print("Show download progress           : " + cf.showprogress +
          "(enable when threadnum=1)")
    print("Use hyphens                      : " + cf.addhyphen +
          "(between number and title)")
    print("Add year                         : " + cf.addyear +
          "(in album title)")
    print("Add explicit tag                 : " + cf.addexplicit)
    print("Playlist songs in artist folders : " + cf.plfile2arfolder +
          "(organized with artist folder)")
    print("Include singles                  : " + cf.includesingle +
          "(download artist album)")
    print("Save covers                      : " + cf.savephoto)
    print("ArtistName Before Track-Title    : " + cf.artistbeforetitle)
    print("Add ID Before AlbumFolderName    : " + cf.addAlbumidbeforefolder)
    print("Current Version                  : " + TIDAL_DL_VERSION)
    if onlineVer != None:
        print("Latest Version                   : " + onlineVer)
    print("====================================================")

    dl = Download(cf.threadnum)
    if not dl.ffmpeg.enable:
        printWarning(0, "Couldn't find ffmpeg!\n")
    while True:
        printMenu()
        strchoice, choice = printChoice2("Enter Choice:", 99)
        if choice == 0:
            return
        elif choice == 1:
            logIn()
            cf = TidalConfig()
            dl = Download(cf.threadnum)
        elif choice == 2:
            setting()
            cf = TidalConfig()
            dl = Download(cf.threadnum)
        elif choice == 3:
            dl.downloadAlbum()
        elif choice == 4:
            dl.downloadTrack()
        elif choice == 5:
            dl.downloadPlaylist()
        elif choice == 6:
            dl.downloadVideo()
        elif choice == 7:
            dl.downloadFavorite()
        elif choice == 8:
            dl.downloadArtistAlbum(cf.includesingle == "True")
        elif choice == 9:
            showConfig()
        elif choice == 10:
            setAccessToken()
            cf = TidalConfig()
            dl = Download(cf.threadnum)
        #Hidden Code For Developer [200-299]
        elif choice == 200:
            dl.downloadArtistAlbum(False)
        else:
            dl.downloadUrl(strchoice)
            dl.downloadByFile(strchoice)