Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
totalreset
Phreakuency Radio
Commits
3dded507
Commit
3dded507
authored
Nov 12, 2021
by
totalreset
Browse files
fixed tagger
parent
21b64989
Changes
1
Hide whitespace changes
Inline
Side-by-side
scripts/phreaktagger.py
View file @
3dded507
...
...
@@ -3,15 +3,17 @@
## The program will set id3 "song" tag with the filename of the .mp3 file.
from
mp3_tagger
import
MP3File
,
VERSION_
BOTH
from
mp3_tagger
import
MP3File
,
VERSION_
1
import
os
print
(
"
\n
Phreaktagger v0.1"
)
print
(
"
\n
Starting tagging...
\n
"
)
folder
=
"/path/to/your/folder/"
folder
=
"/path/to/songs/"
folder_2
=
"/path/to/sets/"
songs
=
os
.
listdir
(
folder
)
sets
=
os
.
listdir
(
folder_2
)
song_path
=
""
tagged_songs
=
0
...
...
@@ -19,15 +21,29 @@ for song in songs:
try
:
song_path
=
folder
+
song
mp3
=
MP3File
(
song_path
)
mp3
.
song
=
song
mp3
.
set_version
(
VERSION_1
)
mp3
.
song
=
song
.
removesuffix
(
".mp3"
)
mp3
.
save
()
tagged_songs
+=
1
print
(
mp3
.
song
)
print
(
"Song tagged.
\n
"
)
except
:
print
(
"Not .mp3 f
ormat
, skipping.
\n
"
)
print
(
"Not
a
.mp3 f
ile
, skipping."
)
pass
print
(
"
\n
The total number of tagged songs is "
+
str
(
tagged_songs
))
print
(
"
\n
Tagging complete. Thanks for using phreaktagger."
)
for
s
in
sets
:
try
:
song_path
=
folder_2
+
s
mp3
=
MP3File
(
song_path
)
mp3
.
set_version
(
VERSION_1
)
mp3
.
song
=
s
mp3
.
save
()
tagged_songs
+=
1
print
(
mp3
.
song
)
print
(
"Set tagged.
\n
"
)
except
:
print
(
"Not .mp3 format, skipping.
\n
"
)
pass
print
(
"
\n
The total number of tagged songs and set is "
+
str
(
tagged_songs
))
print
(
"
\n
Tagging complete. Thanks for using phreaktagger."
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment