remove settings: onlyM4a

This commit is contained in:
Yaronzz
2022-06-20 17:34:41 +08:00
parent e1562ba30e
commit b1ebd6f0b2
7 changed files with 148 additions and 131 deletions
+2 -3
View File
@@ -108,7 +108,6 @@ def test():
SETTINGS.audioQuality = AudioQuality.Normal
SETTINGS.videoFileFormat = VideoQuality.P240
SETTINGS.onlyM4a = True
SETTINGS.checkExist = False
SETTINGS.includeEP = True
SETTINGS.saveCovers = True
@@ -125,13 +124,13 @@ def test():
Printf.settings()
# test example
# track 70973230 77798028 212657
# start('70973230')
start('70973230')
# album 58138532 77803199 21993753 79151897 56288918
# start('58138532')
# playlist 98235845-13e8-43b4-94e2-d9f8e603cee7
# start('98235845-13e8-43b4-94e2-d9f8e603cee7')
# video 155608351 188932980
start("155608351")
# start("155608351")
if __name__ == '__main__':
-13
View File
@@ -72,19 +72,6 @@ def __setMetaData__(track: Track, album: Album, filepath, contributors, lyrics):
obj.save(coverpath)
def convert(filepath, codec):
if not SETTINGS.onlyM4a:
return filepath
if 'ac4' in codec or 'mha1' in codec:
return filepath
if '.mp4' not in filepath:
return filepath
newpath = filepath.replace('.mp4', '.m4a')
aigpy.path.remove(newpath)
os.rename(filepath, newpath)
return newpath
def downloadCover(album):
if album is None:
return
-1
View File
@@ -197,7 +197,6 @@ def changeSettings():
Printf.settings(SETTINGS)
SETTINGS.showProgress = Printf.enterBool(LANG.CHANGE_SHOW_PROGRESS)
SETTINGS.showTrackInfo = Printf.enterBool(LANG.CHANGE_SHOW_TRACKINFO)
SETTINGS.onlyM4a = Printf.enterBool(LANG.CHANGE_ONLYM4A)
SETTINGS.checkExist = Printf.enterBool(LANG.CHANGE_CHECK_EXIST)
SETTINGS.includeEP = Printf.enterBool(LANG.CHANGE_INCLUDE_EP)
SETTINGS.saveCovers = Printf.enterBool(LANG.CHANGE_SAVE_COVERS)
+145 -109
View File
@@ -11,161 +11,197 @@
import aigpy
class StreamUrl(aigpy.model.ModelBase):
trackid = None
url = None
codec = None
encryptionKey = None
soundQuality = None
def __init__(self) -> None:
super().__init__()
self.trackid = None
self.url = None
self.codec = None
self.encryptionKey = None
self.soundQuality = None
class VideoStreamUrl(aigpy.model.ModelBase):
codec = None
resolution = None
resolutions = None
m3u8Url = None
def __init__(self) -> None:
super().__init__()
self.codec = None
self.resolution = None
self.resolutions = None
self.m3u8Url = None
class Artist(aigpy.model.ModelBase):
id = None
name = None
type = None
picture = None
def __init__(self) -> None:
super().__init__()
self.id = None
self.name = None
self.type = None
self.picture = None
class Album(aigpy.model.ModelBase):
id = None
title = None
duration = 0
numberOfTracks = 0
numberOfVideos = 0
numberOfVolumes = 0
releaseDate = None
type = None
version = None
cover = None
explicit = False
audioQuality = None
audioModes = None
artist = Artist()
artists = Artist()
def __init__(self) -> None:
super().__init__()
self.id = None
self.title = None
self.duration = 0
self.numberOfTracks = 0
self.numberOfVideos = 0
self.numberOfVolumes = 0
self.releaseDate = None
self.type = None
self.version = None
self.cover = None
self.explicit = False
self.audioQuality = None
self.audioModes = None
self.artist = Artist()
self.artists = Artist()
class Playlist(aigpy.model.ModelBase):
uuid = None
title = None
numberOfTracks = 0
numberOfVideos = 0
description = None
duration = 0
image = None
squareImage = None
def __init__(self) -> None:
super().__init__()
self.uuid = None
self.title = None
self.numberOfTracks = 0
self.numberOfVideos = 0
self.description = None
self.duration = 0
self.image = None
self.squareImage = None
class Track(aigpy.model.ModelBase):
id = None
title = None
duration = 0
trackNumber = 0
volumeNumber = 0
trackNumberOnPlaylist = 0
version = None
isrc = None
explicit = False
audioQuality = None
copyRight = None
artist = Artist()
artists = Artist()
album = Album()
allowStreaming = False
playlist = None
def __init__(self) -> None:
super().__init__()
self.id = None
self.title = None
self.duration = 0
self.trackNumber = 0
self.volumeNumber = 0
self.trackNumberOnPlaylist = 0
self.version = None
self.isrc = None
self.explicit = False
self.audioQuality = None
self.copyRight = None
self.artist = Artist()
self.artists = Artist()
self.album = Album()
self.allowStreaming = False
self.playlist = None
class Video(aigpy.model.ModelBase):
id = None
title = None
duration = 0
imageID = None
trackNumber = 0
releaseDate = None
version = None
quality = None
explicit = False
artist = Artist()
artists = Artist()
album = Album()
allowStreaming = False
playlist = None
def __init__(self) -> None:
super().__init__()
self.id = None
self.title = None
self.duration = 0
self.imageID = None
self.trackNumber = 0
self.releaseDate = None
self.version = None
self.quality = None
self.explicit = False
self.artist = Artist()
self.artists = Artist()
self.album = Album()
self.allowStreaming = False
self.playlist = None
class Mix(aigpy.model.ModelBase):
id = None
tracks = Track()
videos = Video()
def __init__(self) -> None:
super().__init__()
self.id = None
self.tracks = Track()
self.videos = Video()
class Lyrics(aigpy.model.ModelBase):
trackId = None
lyricsProvider = None
providerCommontrackId = None
providerLyricsId = None
lyrics = None
subtitles = None
def __init__(self) -> None:
super().__init__()
self.trackId = None
self.lyricsProvider = None
self.providerCommontrackId = None
self.providerLyricsId = None
self.lyrics = None
self.subtitles = None
class SearchDataBase(aigpy.model.ModelBase):
limit = 0
offset = 0
totalNumberOfItems = 0
def __init__(self) -> None:
super().__init__()
self.limit = 0
self.offset = 0
self.totalNumberOfItems = 0
class SearchAlbums(SearchDataBase):
items = Album()
def __init__(self) -> None:
super().__init__()
self.items = Album()
class SearchArtists(SearchDataBase):
items = Artist()
def __init__(self) -> None:
super().__init__()
self.items = Artist()
class SearchTracks(SearchDataBase):
items = Track()
def __init__(self) -> None:
super().__init__()
self.items = Track()
class SearchVideos(SearchDataBase):
items = Video()
def __init__(self) -> None:
super().__init__()
self.items = Video()
class SearchPlaylists(SearchDataBase):
items = Playlist()
def __init__(self) -> None:
super().__init__()
self.items = Playlist()
class SearchResult(aigpy.model.ModelBase):
artists = SearchArtists()
albums = SearchAlbums()
tracks = SearchTracks()
videos = SearchVideos()
playlists = SearchPlaylists()
def __init__(self) -> None:
super().__init__()
self.artists = SearchArtists()
self.albums = SearchAlbums()
self.tracks = SearchTracks()
self.videos = SearchVideos()
self.playlists = SearchPlaylists()
class LoginKey(object):
deviceCode = None
userCode = None
verificationUrl = None
authCheckTimeout = None
authCheckInterval = None
userId = None
countryCode = None
accessToken = None
refreshToken = None
expiresIn = None
class LoginKey(aigpy.model.ModelBase):
def __init__(self) -> None:
super().__init__()
self.deviceCode = None
self.userCode = None
self.verificationUrl = None
self.authCheckTimeout = None
self.authCheckInterval = None
self.userId = None
self.countryCode = None
self.accessToken = None
self.refreshToken = None
self.expiresIn = None
class StreamRespond(object):
trackid = None
videoid = None
streamType = None
assetPresentation = None
audioMode = None
audioQuality = None
videoQuality = None
manifestMimeType = None
manifest = None
class StreamRespond(aigpy.model.ModelBase):
def __init__(self) -> None:
super().__init__()
self.trackid = None
self.videoid = None
self.streamType = None
self.assetPresentation = None
self.audioMode = None
self.audioQuality = None
self.videoQuality = None
self.manifestMimeType = None
self.manifest = None
-2
View File
@@ -37,8 +37,6 @@ def __getExtension__(stream: StreamUrl):
if '.flac' in stream.url:
return '.flac'
if '.mp4' in stream.url:
if not SETTINGS.onlyM4a:
return '.mp4'
if 'ac4' in stream.codec or 'mha1' in stream.codec:
return '.mp4'
return '.m4a'
+1 -2
View File
@@ -20,7 +20,7 @@ from tidal_dl.settings import *
from tidal_dl.lang.language import *
VERSION = '2022.03.04.2'
VERSION = '2022.06.20.1'
__LOGO__ = f'''
/$$$$$$$$ /$$ /$$ /$$ /$$ /$$
|__ $$__/|__/ | $$ | $$ | $$| $$
@@ -93,7 +93,6 @@ class Printf(object):
#settings - else
[LANG.SETTING_USE_PLAYLIST_FOLDER, data.usePlaylistFolder],
[LANG.SETTING_ONLY_M4A, data.onlyM4a],
[LANG.SETTING_CHECK_EXIST, data.checkExist],
[LANG.SETTING_SHOW_PROGRESS, data.showProgress],
[LANG.SETTING_SHOW_TRACKINFO, data.showTrackInfo],
-1
View File
@@ -16,7 +16,6 @@ from tidal_dl.enums import *
class Settings(aigpy.model.ModelBase):
onlyM4a = False
checkExist = True
includeEP = True
saveCovers = True