Create a NFO with <tag>

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
syralk
Posts: 7
Joined: 15 Nov 2019, 19:29

Create a NFO with <tag>

Post by syralk »

I use Tynrmediamanager in the past and it is able to create nfo with <tag>
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"
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Create a NFO with <tag>

Post by rednoah »

:!: The artwork.* scripts don't use the --filter option, so specifying it has no effect.


Indeed, <tags> is not generated, and there is no option (other than modifying the code) to change that:
https://github.com/filebot/scripts/blob ... roovy#L132


:?: What kind of information would <tags> include? Examples? I'm pretty sure TheTVDB doesn't have any "tags" information in their database records.
:idea: Please read the FAQ and How to Request Help.
syralk
Posts: 7
Joined: 15 Nov 2019, 19:29

Re: Create a NFO with <tag>

Post by syralk »

I did a script that do exactly what I need
if it can be included in filebot that will be great
the way it work is I do

Code: Select all

filebot -script fn:artwork.tmdb  --filter "n == /$movie_name_year/" --def extras=y "$movie_path"
then I run script below

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
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Create a NFO with <tag>

Post by rednoah »

Can you paste an example nfo file with <tag> values?
:idea: Please read the FAQ and How to Request Help.
syralk
Posts: 7
Joined: 15 Nov 2019, 19:29

Re: Create a NFO with <tag>

Post by syralk »

for example in the Movie "Shrek 2 (2004)" it will be

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>
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Create a NFO with <tag>

Post by rednoah »

Alright. I'll add support with the upcoming release.
:idea: Please read the FAQ and How to Request Help.
syralk
Posts: 7
Joined: 15 Nov 2019, 19:29

Re: Create a NFO with <tag>

Post by syralk »

rednoah wrote: 19 Nov 2019, 14:25 Alright. I'll add support with the upcoming release.
Great thanks :)
let me know what will be the command line when its ready :)
Post Reply