just wondering how do I do that with filebot
right now my command line is
Code: Select all
filebot -script fn:artwork.tmdb --filter "n == /$movie_name_year/" --def extras=y "$movie_path"
Code: Select all
filebot -script fn:artwork.tmdb --filter "n == /$movie_name_year/" --def extras=y "$movie_path"
Code: Select all
filebot -script fn:artwork.tmdb --filter "n == /$movie_name_year/" --def extras=y "$movie_path"
Code: Select all
#!/bin/bash
API_KEY=# insert your TMDB API KEY HERE
PATH_NFO=#insert location of NFO generated by filebot
#------------------------------------------------------------
IMDBID=$(awk -F "[><]" '/<id>/{print $3}' "$PATH_NFO" | awk -F'[ ]' '{print $1}')
JSON_IMDB=($(curl -s "https://api.themoviedb.org/3/find/$IMDBID?api_key=$API_KEY&external_source=imdb_id" | jq -r '.movie_results[] | .id'))
TMDBID="${JSON_IMDB[0]}"
#-----------------------------------------------------------
echo "TMBD: $TMDBID"
JSON_TAG=$(curl -s "https://api.themoviedb.org/3/movie/$TMDBID/keywords?api_key=$API_KEY")
for row in $(echo "${JSON_TAG}" | jq -r '.keywords[] | @base64'); do
_jq() {
echo ${row} | base64 --decode | jq -r ${1}
}
tag_info="$(_jq '.name')"
sed -i 's/<\/movie>/ <tag>'"$tag_info"'<\/tag>\n&/' "$PATH_NFO"
done
Code: Select all
<tag>prison</tag>
<tag>magic</tag>
<tag>liberation</tag>
<tag>honeymoon</tag>
<tag>prince</tag>
<tag>fairy tale</tag>
<tag>parents-in-law</tag>
<tag>donkey</tag>
<tag>kingdom</tag>
<tag>enchantment</tag>
<tag>transformation</tag>
<tag>princess</tag>
<tag>sequel</tag>
<tag>anthropomorphism</tag>
<tag>dragon</tag>
<tag>ogre</tag>