1.0.073 - Version bump, log adjustments, spacing adjustments

#233
pull/240/head
RandomNinjaAtk 2 years ago committed by GitHub
parent 86a217a77e
commit 178ade4cf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
scriptVersion="1.0.072" scriptVersion="1.0.073"
if [ -z "$lidarrUrl" ] || [ -z "$lidarrApiKey" ]; then if [ -z "$lidarrUrl" ] || [ -z "$lidarrApiKey" ]; then
lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)" lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)"
@ -86,9 +86,13 @@ Configuration () {
log "CONFIG :: Download Location :: $downloadPath" log "CONFIG :: Download Location :: $downloadPath"
log "CONFIG :: Music Video Location :: $videoPath" log "CONFIG :: Music Video Location :: $videoPath"
log "CONFIG :: Subtitle Language set to: $youtubeSubtitleLanguage" log "CONFIG :: Subtitle Language set to: $youtubeSubtitleLanguage"
log "CONFIG :: yt-dlp format (mkv): $videoFormat"
log "CONFIG :: yt-dlp format (mp4): --format-sort ext:mp4:m4a --merge-output-format mp4"
log "CONFIG :: Video container set to format: $videoContainer" log "CONFIG :: Video container set to format: $videoContainer"
if [ "$videoContainer" == "mkv" ]; then
log "CONFIG :: yt-dlp format: $videoFormat"
fi
if [ "$videoContainer" == "mp4" ]; then
log "CONFIG :: yt-dlp format: --format-sort ext:mp4:m4a --merge-output-format mp4"
fi
if [ -n "$videoDownloadTag" ]; then if [ -n "$videoDownloadTag" ]; then
log "CONFIG :: Video download tag set to: $videoDownloadTag" log "CONFIG :: Video download tag set to: $videoDownloadTag"
fi fi
@ -447,9 +451,9 @@ VideoTagProcess () {
filenamenoext="${filename%.*}" filenamenoext="${filename%.*}"
artistGenres="" artistGenres=""
OLDIFS="$IFS" OLDIFS="$IFS"
IFS=$'\n' IFS=$'\n'
artistGenres=($(echo $lidarrArtistData | jq -r ".genres[]")) artistGenres=($(echo $lidarrArtistData | jq -r ".genres[]"))
IFS="$OLDIFS" IFS="$OLDIFS"
if [ ! -z "$artistGenres" ]; then if [ ! -z "$artistGenres" ]; then
for genre in ${!artistGenres[@]}; do for genre in ${!artistGenres[@]}; do
@ -461,10 +465,8 @@ VideoTagProcess () {
genre="" genre=""
fi fi
if [[ $filenoext.$videoContainer == *.mkv ]] if [[ $filenoext.$videoContainer == *.mkv ]]; then
then mv "$filenoext.$videoContainer" "$filenoext-temp.$videoContainer"
mv "$filenoext.$videoContainer" "$filenoext-temp.$videoContainer"
log "$processCount of $lidarrArtistIdsCount :: $4 :: $lidarrArtistName :: ${1}${2} $3 :: Tagging file" log "$processCount of $lidarrArtistIdsCount :: $4 :: $lidarrArtistName :: ${1}${2} $3 :: Tagging file"
ffmpeg -y \ ffmpeg -y \
-i "$filenoext-temp.$videoContainer" \ -i "$filenoext-temp.$videoContainer" \
@ -479,32 +481,28 @@ VideoTagProcess () {
-metadata ENCODED_BY="lidarr-extended" \ -metadata ENCODED_BY="lidarr-extended" \
-attach "$downloadPath/incomplete/${1}${2}.jpg" -metadata:s:t mimetype=image/jpeg \ -attach "$downloadPath/incomplete/${1}${2}.jpg" -metadata:s:t mimetype=image/jpeg \
"$filenoext.$videoContainer" &>/dev/null "$filenoext.$videoContainer" &>/dev/null
rm "$filenoext-temp.$videoContainer" rm "$filenoext-temp.$videoContainer"
chmod 666 "$filenoext.$videoContainer" chmod 666 "$filenoext.$videoContainer"
else else
mv "$filenoext.$videoContainer" "$filenoext-temp.$videoContainer"
mv "$filenoext.$videoContainer" "$filenoext-temp.$videoContainer"
log "$processCount of $lidarrArtistIdsCount :: $4 :: $lidarrArtistName :: ${1}${2} $3 :: Tagging file" log "$processCount of $lidarrArtistIdsCount :: $4 :: $lidarrArtistName :: ${1}${2} $3 :: Tagging file"
ffmpeg -y \ ffmpeg -y \
-i "$filenoext-temp.$videoContainer" \ -i "$filenoext-temp.$videoContainer" \
-i "$downloadPath/incomplete/${1}${2}.jpg" \ -i "$downloadPath/incomplete/${1}${2}.jpg" \
-map 1 \ -map 1 \
-map 0 \ -map 0 \
-c copy \ -c copy \
-c:v:0 mjpeg \ -c:v:0 mjpeg \
-disposition:0 attached_pic \ -disposition:0 attached_pic \
-movflags faststart \ -movflags faststart \
-metadata TITLE="${1}" \ -metadata TITLE="${1}" \
-metadata ARTIST="$lidarrArtistName" \ -metadata ARTIST="$lidarrArtistName" \
-metadata DATE="$3" \ -metadata DATE="$3" \
-metadata GENRE="$genre" \ -metadata GENRE="$genre" \
"$filenoext.$videoContainer" &>/dev/null "$filenoext.$videoContainer" &>/dev/null
rm "$filenoext-temp.$videoContainer" rm "$filenoext-temp.$videoContainer"
chmod 666 "$filenoext.$videoContainer" chmod 666 "$filenoext.$videoContainer"
fi fi
done done
} }

Loading…
Cancel
Save