Compare commits
No commits in common. "b900166ae7bb0f503bce482b81e47b254f4bee96" and "354b0fbda22558e753726dca3e2020b4f00709db" have entirely different histories.
b900166ae7
...
354b0fbda2
1 changed files with 32 additions and 39 deletions
|
|
@ -1,16 +1,13 @@
|
||||||
#!/bin/bash
|
#!/usr/bin/bash
|
||||||
|
|
||||||
# This script helps me download back my own albums from deab.bandcamp.com from my unraid server
|
# This script helped me download back my own albums from deab.bandcamp.com
|
||||||
#
|
#
|
||||||
# It takes the first positional argument : a folder with youtube-dl downloaded audio-only tracks from bandcamp with their associated pictures and json metadata
|
# It takes the first positional argument : a folder with youtube-dl downloaded audio-only tracks from bandcamp with their associated pictures and json metadata
|
||||||
# And it parses the json to extract track name and number, album name, cover and number of tracks, and uses eyeD3 to updates the ID3 tags, rename and move the files
|
# And it parses the json to extract track name and number, album name, cover and number of tracks, and uses eyeD3 to updates the ID3 tags, rename and move the files
|
||||||
|
#
|
||||||
|
# WATCHOUT for bash version because the -v (to variable) option in printf is a newish thing at the time of writing...
|
||||||
|
|
||||||
for d in "/mnt/user/downloads/youtube-dl/audio/*/";
|
files="$1*.mp3"
|
||||||
do
|
|
||||||
echo "Processing " "$d"
|
|
||||||
echo "..."
|
|
||||||
|
|
||||||
files="$d*.mp3"
|
|
||||||
|
|
||||||
for f in $files;
|
for f in $files;
|
||||||
do
|
do
|
||||||
|
|
@ -31,18 +28,14 @@ for d in "/mnt/user/downloads/youtube-dl/audio/*/";
|
||||||
--album "$album" \
|
--album "$album" \
|
||||||
--release-year "$year" \
|
--release-year "$year" \
|
||||||
--add-image "$cover":FRONT_COVER: \
|
--add-image "$cover":FRONT_COVER: \
|
||||||
"$f";
|
"$f"
|
||||||
|
|
||||||
# moves the files into an path/to/music/folder/artist/album/
|
# moves the files to a correct name into an artist/album/ folder
|
||||||
new_name=$(printf '%02d - %s.mp3' "$track_number" "$track");
|
new_name=$(printf '%02d - %s.mp3' "$track_number" "$track")
|
||||||
mkdir -p "/mnt/user/music/nettoyage/youtubedl/$artist";
|
mkdir -p "$artist"
|
||||||
mkdir -p "/mnt/user/music/nettoyage/youtubedl/$artist/$album";
|
mkdir -p "$artist/$album"
|
||||||
mv "$f" "/mnt/user/music/nettoyage/youtubedl/$artist/$album/$new_name";
|
mv "$f" "$artist/$album/$new_name"
|
||||||
done
|
done
|
||||||
|
|
||||||
# removes the original folder
|
# removes the original folder asking confirmation
|
||||||
rm -R "$d"
|
rm -R "$1"
|
||||||
|
|
||||||
echo "Done with" "$d"
|
|
||||||
echo "---"
|
|
||||||
done
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue