Skip to content

Commit 7fe65ff

Browse files
committed
Album folder name can now contain quality and explicit tags
1 parent 3f93b4e commit 7fe65ff

File tree

3 files changed

+25
-88
lines changed

3 files changed

+25
-88
lines changed

config/settings.example.py

Lines changed: 6 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
path: Base download directory
2323
convert_to_alac: Converts a .flac file to an ALAC .m4a file (requires ffmpeg)
2424
lyrics: Enable lyrics tagging and synced lyrics as .lrc download using the Deezer API (from https://codeberg.org/RemixDev/deemix)
25-
Format variables are {title}, {artist}, {album}, {tracknumber}.
25+
Format variables are {title}, {artist}, {album}, {tracknumber}, {discnumber}, {date}, {quality}, {explicit}
26+
{quality} has a whitespaces in front, so it will look like this " [Dolby Atmos]", " [360]" or " [M]" according to the downloaded quality
27+
{explicit} has a whitespaces in front, so it will look like this " [E]"
2628
track_format: How tracks are formatted. The relevant extension is appended to the end.
2729
album_format: Base album directory - tracks and cover art are stored here. May have slashes in it, for instance {artist}/{album}.
2830
@@ -64,7 +66,7 @@
6466
"tries": 5,
6567
"path": path,
6668
"track_format": "{tracknumber} - {title}",
67-
"album_format": "{albumartist} - {album}",
69+
"album_format": "{albumartist} - {album}{quality}{explicit}",
6870
"convert_to_alac": False,
6971
"lyrics": True,
7072
"lyrics_provider_order": ["Deezer", "musiXmatch"],
@@ -87,7 +89,7 @@
8789
"tries": 5,
8890
"path": path,
8991
"track_format": "{tracknumber} - {title}",
90-
"album_format": "{albumartist} - {album}",
92+
"album_format": "{albumartist} - {album}{quality}{explicit}",
9193
"convert_to_alac": True,
9294
"lyrics": True,
9395
"lyrics_provider_order": ["Deezer", "musiXmatch"],
@@ -99,47 +101,6 @@
99101
"AAC_96": True
100102
},
101103

102-
# This preset will allow FLAC_16 and MQA files only
103-
"mqa_flac": {
104-
"keep_cover_jpg": True,
105-
"embed_album_art": True,
106-
"save_album_json": False,
107-
"tries": 5,
108-
"path": path,
109-
"track_format": "{tracknumber} - {title}",
110-
"album_format": "{albumartist} - {album}",
111-
"convert_to_alac": False,
112-
"lyrics": True,
113-
"lyrics_provider_order": ["Deezer", "musiXmatch"],
114-
"artwork_size": 3000,
115-
"resolution": 1080,
116-
"MQA_FLAC_24": True,
117-
"FLAC_16": True,
118-
"AAC_320": False,
119-
"AAC_96": False
120-
},
121-
122-
# This preset will only download MQA
123-
"MQA": {
124-
"keep_cover_jpg": True,
125-
"embed_album_art": True,
126-
"save_album_json": False,
127-
"tries": 5,
128-
"path": path,
129-
"track_format": "{tracknumber} - {title}",
130-
"album_format": "{albumartist} - {album}",
131-
"convert_to_alac": False,
132-
"lyrics": True,
133-
"lyrics_provider_order": ["Deezer", "musiXmatch"],
134-
"artwork_size": 3000,
135-
"resolution": 1080,
136-
"MQA_FLAC_24": True,
137-
"FLAC_16": False,
138-
"AAC_320": False,
139-
"AAC_96": False
140-
},
141-
142-
143104
# This preset will only download FLAC 16
144105
"FLAC": {
145106
"keep_cover_jpg": True,
@@ -148,7 +109,7 @@
148109
"tries": 5,
149110
"path": path,
150111
"track_format": "{tracknumber} - {title}",
151-
"album_format": "{albumartist} - {album}",
112+
"album_format": "{albumartist} - {album}{quality}{explicit}",
152113
"convert_to_alac": False,
153114
"lyrics": True,
154115
"lyrics_provider_order": ["Deezer", "musiXmatch"],
@@ -159,46 +120,4 @@
159120
"AAC_320": False,
160121
"AAC_96": False
161122
},
162-
163-
164-
# This preset will only download AAC ~320
165-
"320": {
166-
"keep_cover_jpg": True,
167-
"embed_album_art": True,
168-
"save_album_json": False,
169-
"tries": 5,
170-
"path": path,
171-
"track_format": "{tracknumber} - {title}",
172-
"album_format": "{albumartist} - {album}",
173-
"convert_to_alac": False,
174-
"lyrics": True,
175-
"lyrics_provider_order": ["Deezer", "musiXmatch"],
176-
"artwork_size": 3000,
177-
"resolution": 1080,
178-
"MQA_FLAC_24": False,
179-
"FLAC_16": False,
180-
"AAC_320": True,
181-
"AAC_96": False
182-
},
183-
184-
185-
# This preset will only download AAC ~96
186-
"96": {
187-
"keep_cover_jpg": True,
188-
"embed_album_art": True,
189-
"save_album_json": False,
190-
"tries": 5,
191-
"path": path,
192-
"track_format": "{tracknumber} - {title}",
193-
"album_format": "{albumartist} - {album}",
194-
"convert_to_alac": False,
195-
"lyrics": True,
196-
"lyrics_provider_order": ["Deezer", "musiXmatch"],
197-
"artwork_size": 3000,
198-
"resolution": 1080,
199-
"MQA_FLAC_24": False,
200-
"FLAC_16": False,
201-
"AAC_320": False,
202-
"AAC_96": True
203-
},
204123
}

readme.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ To do/Whishlist
146146
* Move lyrics support to tagger.py
147147
* Support for being used as a python module (maybe pip?)
148148
* Maybe Spotify playlist support
149+
* Artist video download (which downloads all videos from a given artist)
149150

150151
Config reference
151152
----------------
@@ -191,7 +192,11 @@ Config reference
191192

192193
`resolution`: Which resolution you want to download the videos
193194

194-
Format variables are `{title}`, `{artist}`, `{album}`, `{tracknumber}`.
195+
Format variables are `{title}`, `{artist}`, `{album}`, `{tracknumber}`, `{discnumber}`, `{date}`, `{quality}`, `{explicit}`.
196+
197+
* `{quality}` has a whitespace in front, so it will look like this " [Dolby Atmos]", " [360]" or " [M]" according to the downloaded quality
198+
199+
* `{explicit}` has a whitespace in front, so it will look like this " [E]"
195200

196201
`track_format`: How tracks are formatted. The relevant extension is appended to the end.
197202

redsea/tagger.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,19 @@ def tags(self, track_info, track_type, album_info=None, tagger=None):
110110
if 'genre' in track_info:
111111
tagger['genre'] = track_info['genre']
112112

113+
if track_type is None:
114+
if track_info['audioModes'] == ['DOLBY_ATMOS']:
115+
tagger['quality'] = " [Dolby Atmos]"
116+
elif track_info['audioModes'] == ['SONY_360RA']:
117+
tagger['quality'] = " [360]"
118+
elif track_info['audioQuality'] == 'HI_RES':
119+
tagger['quality'] = " [M]"
120+
else:
121+
tagger['quality'] = ""
122+
123+
if 'explicit' in album_info:
124+
tagger['explicit'] = ' [E]' if album_info['explicit'] else ''
125+
113126
return tagger
114127

115128
def _meta_tag(self, tagger, track_info, album_info, track_type):

0 commit comments

Comments
 (0)