|
|
@ -1,5 +1,5 @@
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
scriptVersion="1.0.025"
|
|
|
|
scriptVersion="1.0.026"
|
|
|
|
|
|
|
|
|
|
|
|
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)"
|
|
|
@ -707,6 +707,26 @@ for lidarrArtistId in $(echo $lidarrArtistIds); do
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
videoDownloadUrl="https://www.youtube.com/watch?v=$imvdbVideoYoutubeId"
|
|
|
|
videoDownloadUrl="https://www.youtube.com/watch?v=$imvdbVideoYoutubeId"
|
|
|
|
plexVideoType="-video"
|
|
|
|
plexVideoType="-video"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ ! -z "$imvdbVideoFeaturedArtistsSlug" ]; then
|
|
|
|
|
|
|
|
for featuredArtistSlug in $(echo "$imvdbVideoFeaturedArtistsSlug"); do
|
|
|
|
|
|
|
|
if [ -f /config/extended/cache/imvdb/$featuredArtistSlug ]; then
|
|
|
|
|
|
|
|
featuredArtistName="$(cat /config/extended/cache/imvdb/$featuredArtistSlug)"
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
query_data=$(curl -s -A "$agent" "https://musicbrainz.org/ws/2/url?query=url:%22https://imvdb.com/n/$featuredArtistSlug%22&fmt=json")
|
|
|
|
|
|
|
|
count=$(echo "$query_data" | jq -r ".count")
|
|
|
|
|
|
|
|
if [ "$count" != "0" ]; then
|
|
|
|
|
|
|
|
featuredArtistName="$(echo "$query_data" | jq -r ".urls[].\"relation-list\"[].relations[].artist.name")"
|
|
|
|
|
|
|
|
echo "$featuredArtistName" > /config/extended/cache/imvdb/$featuredArtistSlug
|
|
|
|
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$featuredArtistName" ]; then
|
|
|
|
|
|
|
|
continue
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if [ -d "/music-videos/$lidarrArtistFolder" ]; then
|
|
|
|
if [ -d "/music-videos/$lidarrArtistFolder" ]; then
|
|
|
|
if [[ -n $(find "/music-videos/$lidarrArtistFolder" -iname "${videoTitleClean}${plexVideoType}.*") ]]; then
|
|
|
|
if [[ -n $(find "/music-videos/$lidarrArtistFolder" -iname "${videoTitleClean}${plexVideoType}.*") ]]; then
|
|
|
|
log "$processCount of $lidarrArtistIdsCount :: IMVDB :: $lidarrArtistName :: ${imvdbVideoTitle} :: Previously Downloaded, skipping..."
|
|
|
|
log "$processCount of $lidarrArtistIdsCount :: IMVDB :: $lidarrArtistName :: ${imvdbVideoTitle} :: Previously Downloaded, skipping..."
|
|
|
@ -727,25 +747,6 @@ for lidarrArtistId in $(echo $lidarrArtistIds); do
|
|
|
|
videoUploadDate="$(echo "$videoData" | jq -r .upload_date)"
|
|
|
|
videoUploadDate="$(echo "$videoData" | jq -r .upload_date)"
|
|
|
|
videoYear="${videoUploadDate:0:4}"
|
|
|
|
videoYear="${videoUploadDate:0:4}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ ! -z "$imvdbVideoFeaturedArtistsSlug" ]; then
|
|
|
|
|
|
|
|
for featuredArtistSlug in $(echo "$imvdbVideoFeaturedArtistsSlug"); do
|
|
|
|
|
|
|
|
if [ -f /config/extended/cache/imvdb/$featuredArtistSlug ]; then
|
|
|
|
|
|
|
|
featuredArtistName="$(cat /config/extended/cache/imvdb/$featuredArtistSlug)"
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
query_data=$(curl -s -A "$agent" "https://musicbrainz.org/ws/2/url?query=url:%22https://imvdb.com/n/$featuredArtistSlug%22&fmt=json")
|
|
|
|
|
|
|
|
count=$(echo "$query_data" | jq -r ".count")
|
|
|
|
|
|
|
|
if [ "$count" != "0" ]; then
|
|
|
|
|
|
|
|
featuredArtistName="$(echo "$query_data" | jq -r ".urls[].\"relation-list\"[].relations[].artist.name")"
|
|
|
|
|
|
|
|
echo "$featuredArtistName" > /config/extended/cache/imvdb/$featuredArtistSlug
|
|
|
|
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$featuredArtistName" ]; then
|
|
|
|
|
|
|
|
continue
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
log "$processCount of $lidarrArtistIdsCount :: IMVDB :: $lidarrArtistName :: ${imvdbVideoTitle} :: $videoDownloadUrl..."
|
|
|
|
log "$processCount of $lidarrArtistIdsCount :: IMVDB :: $lidarrArtistName :: ${imvdbVideoTitle} :: $videoDownloadUrl..."
|
|
|
|
DownloadVideo "$videoDownloadUrl" "$videoTitleClean" "$plexVideoType" "IMVDB"
|
|
|
|
DownloadVideo "$videoDownloadUrl" "$videoTitleClean" "$plexVideoType" "IMVDB"
|
|
|
|
if [ "$downloadFailed" = "true" ]; then
|
|
|
|
if [ "$downloadFailed" = "true" ]; then
|
|
|
|