def setting(): cf = TidalConfig() print("----------------Settings----------------") print("OutputDir :\t" + cf.outputdir) 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)") while True: outputdir = myinput("Outputdir(Enter '0' Unchanged):".ljust(12)) if outputdir == '0': outputdir = cf.outputdir break if os.path.isdir(outputdir) == False: printErr(0, "Path is Err!") continue break while True: index = myinputInt( "Quality(0-LOW,1-HIGH,2-LOSSLESS,3-HI_RES):".ljust(12), 999) if index > 3 or index < 0: printErr(0, "Quality Err!") continue if index == 0: quality = 'LOW' if index == 1: quality = 'HIGH' if index == 2: quality = 'LOSSLESS' if index == 3: quality = 'HI_RES' break while True: index = myinputInt( "Resolution(0-1080,1-720,2-480,3-360,4-240):".ljust(12), 99) if index > 4 or index < 0: printErr(0, "Resolution Err") continue if index == 0: resolution = '1080' if index == 1: resolution = '720' if index == 2: resolution = '480' if index == 3: resolution = '360' if index == 4: resolution = '240' break while True: threadnum = myinput("ThreadNum:".ljust(12)) if cf.valid_threadnum(threadnum) == False: printErr(0, "ThreadNum Err") continue break status = myinputInt("ConvertMp4toM4a(0-False,1-True):".ljust(12), 0) status2 = myinputInt("ShowProgress(0-False,1-True):".ljust(12), 0) status3 = myinputInt("AddHyphen(0-False,1-True):".ljust(12), 0) cf.set_outputdir(outputdir) cf.set_quality(quality) cf.set_resolution(resolution) cf.set_threadnum(threadnum) cf.set_onlym4a(status) cf.set_showprogress(status2) cf.set_addhyphen(status3) pathHelper.mkdirs(outputdir + "/Album/") pathHelper.mkdirs(outputdir + "/Playlist/") pathHelper.mkdirs(outputdir + "/Video/") pathHelper.mkdirs(outputdir + "/Favorite/") return
def setting(): cf = TidalConfig() print("----------------Settings----------------") print("Output directory :\t" + cf.outputdir) print("Sound Quality :\t" + cf.quality) print("Video Resolution :\t" + cf.resolution) print("Download Threads :\t" + cf.threadnum) print("Only M4a :\t" + cf.onlym4a) print("Show download progress :\t" + cf.showprogress + "(enable when threadnum=1)") print("Use hyphens :\t" + cf.addhyphen + "(between number and title)") print("Add year :\t" + cf.addyear + "(in album title)") print("Add explicit tag :\t" + cf.addexplicit) print("Playlist songs in artist folders :\t" + cf.plfile2arfolder + "(organized with artist folder)") print("Include singles :\t" + cf.includesingle + "(download artist album)") print("Save covers :\t" + cf.savephoto) print("ArtistName Before Track-Title :\t" + cf.artistbeforetitle) print("Add ID Before AlbumFolderName :\t" + cf.addAlbumidbeforefolder) while True: outputdir = myinput("Output directory(Enter '0' Unchanged):".ljust(12)) if outputdir == '0': outputdir = cf.outputdir break if os.path.isdir(outputdir) == False: printErr(0, "Path is Err!") continue break while True: index = myinputInt( "Download Quality(0-LOW,1-HIGH,2-LOSSLESS,3-HI_RES):".ljust(12), 999) if index > 3 or index < 0: printErr(0, "Quality Err!") continue if index == 0: quality = 'LOW' if index == 1: quality = 'HIGH' if index == 2: quality = 'LOSSLESS' if index == 3: quality = 'HI_RES' break while True: index = myinputInt( "Video resolution(0-1080,1-720,2-480,3-360,4-240):".ljust(12), 99) if index > 4 or index < 0: printErr(0, "Resolution Err") continue if index == 0: resolution = '1080' if index == 1: resolution = '720' if index == 2: resolution = '480' if index == 3: resolution = '360' if index == 4: resolution = '240' break while True: threadnum = myinput("Number of download threads:".ljust(12)) if cf.valid_threadnum(threadnum) == False: printErr(0, "ThreadNum Err") continue break status = myinputInt("Convert Mp4 to M4a(0-No, 1-Yes):".ljust(12), 0) status2 = myinputInt( "Show download progress (only available on single thread)(0-No, 1-Yes):" .ljust(12), 0) status3 = myinputInt( "Use hyphens instead of spaces in file names(0-No, 1-Yes):".ljust(12), 0) while True: index = myinputInt( "Add year to album folder names(0-No, 1-Before, 2-After):".ljust( 12), 99) if index > 2 or index < 0: printErr(0, "Addyear input Err") continue if index == 0: addyear = 'No' if index == 1: addyear = 'Before' if index == 2: addyear = 'After' break status5 = myinputInt( "Download playlist songs in artist folder structure? (0-No,1-Yes):". ljust(12), 0) status6 = myinputInt( "Add explicit tag to file names(0-No, 1-Yes):".ljust(12), 0) status7 = myinputInt( "Include singles and EPs when downloading an artist's albums (0-No, 1-Yes):" .ljust(12), 0) status8 = myinputInt("Save covers(0-No, 1-Yes):".ljust(12), 0) status9 = myinputInt( "Add artistName before trackTitle(0-No, 1-Yes):".ljust(12), 0) status10 = myinputInt( "Add ID Before AlbumFolderName(0-No, 1-Yes):".ljust(12), 0) cf.set_outputdir(outputdir) cf.set_quality(quality) cf.set_resolution(resolution) cf.set_threadnum(threadnum) cf.set_onlym4a(status) cf.set_showprogress(status2) cf.set_addhyphen(status3) cf.set_addyear(addyear) cf.set_plfile2arfolder(status5) cf.set_addexplicit(status6) cf.set_includesingle(status7) cf.set_savephoto(status8) cf.set_artistbeforetitle(status9) cf.set_addAlbumidbeforefolder(status10) pathHelper.mkdirs(outputdir + "/Album/") pathHelper.mkdirs(outputdir + "/Playlist/") pathHelper.mkdirs(outputdir + "/Video/") pathHelper.mkdirs(outputdir + "/Favorite/") return