without using database
1 I connect my server sshfs (fuse installed ...)
2 I use sshfs manager (windows) for connected to xbmc
3 scrapbook with plug https://www.themoviedb.org
4 I export the video file by mediateque, creation of files (nfo, poster, faniart) per file. nfo if a file exists in the folder it will delete
5 I created a script that starts every day (Cromb -e) to retrieve information from the nfo file to create a comment. txt, and converted the file poster cover
my first
#!/bin/bash
#path
cd /home/… /…
#convert remplaced cp
find . -name "*poster.jpg" | while read i ; do convert "${i%/*}/*poster.jpg" "${i%/*}/cover.jpg" ; done
find -type f -name "*.nfo" -print0 | while read -d $'\0' a; do
nfo=".nfo"
empty=""
slash="/"
singleQuote="'"
singleQuoteReplaced="'"
doubleQuote="""
youtube="plugin://plugin.video.youtube/?action=play_video&videoid="
base=${a/$nfo/$empty}
name=`cat "$a" | grep -i "<title>" | iconv -f utf-8 -t windows-1252//TRANSLIT`
original=`cat "$a" | grep -i "<originaltitle>" | iconv -f utf-8 -t windows-1252//TRANSLIT`
mpaa=`cat "$a" | grep -i "<mpaa>"`
genre=`cat "$a" | grep -i "<genre>" | iconv -f utf-8 -t windows-1252//TRANSLIT`
plot=`cat "$a" | grep -i "<plot>" | iconv -f utf-8 -t windows-1252//TRANSLIT`
actors=`cat "$a" | grep -i "<name>" | iconv -f utf-8 -t windows-1252//TRANSLIT`
director=`cat "$a" | grep -i "<director>" | iconv -f utf-8 -t windows-1252//TRANSLIT`
credits=`cat "$a" | grep -i "<credits>" | iconv -f utf-8 -t windows-1252//TRANSLIT`
country=`cat "$a" | grep -i "<country>" | iconv -f utf-8 -t windows-1252//TRANSLIT`
name=`echo $name | sed 's/<[^>]*[>]//g'`
name="${name#"${name%%[![:space:]]*}"}"
name="${name%"${name##*[![:space:]]}"}"
name=${name// : / }
name=${name// :/ }
name=${name//: / }
name=${name//:/ }
name=${name//$slash/$empty}
name=${name//$singleQuote/$singleQuoteReplaced}
name=${name//$doubleQuote/$singleQuoteReplaced}
year=`cat "$a" | grep -i "<year>" | sed 's/<[^>]*[>]//g'`
year=${year//[[:space:]]/}
original=`echo $original| sed 's/<[^>]*[>]//g'`
original=${original//$slash/$empty}
original=${original//$singleQuote/$singleQuoteReplaced}
country=`echo $country| sed 's/<[^>]*[>]//g'`
country=${country//[[:space:]]/}
country=${country//UnitedKingdom/Royaume-Uni}
country=${country//UnitedStatesofAmerica/États-Unis}
country=${country//Spain/Espagne}
mpaa=`echo $mpaa| sed 's/<[^>]*[>]//g'`
mpaa=${mpaa//*/Avertissement : des scènes, des propos ou des images peuvent heurter la sensibilité des spectateurs }
genre=`echo $genre| sed 's/<[^>]*[>]/./g'`
genre=${genre//$slash/$empty}
genre=${genre//$singleQuote/$singleQuoteReplaced}
rating=`cat "$a" | grep -i "<rating>" | sed 's/<[^>]*[>]//g'`
rating=`cat "$a" | grep -i "<rating>" | sed 's/\([0-9]*\.[0-9][0-9]\).*/\1/'`
rating=${rating//[[:space:]]/}
rating=${rating//<rating>/}
votes=`cat "$a" | grep -i "<votes>" | sed 's/<[^>]*[>]//g'`
votes=${votes//[[:space:]]/}
id=`cat "$a" | grep -i "<id>" | sed 's/<[^>]*[>]//g'`
id=${id//[[:space:]]/}
plot=`echo $plot| sed 's/<[^>]*[>]//g'`
plot=${plot//$slash/$empty}
plot=${plot//$singleQuote/$singleQuoteReplaced}
plot=${plot//$doubleQuote/$singleQuoteReplaced}
trailer=`cat "$a" | grep -i "<trailer>" | sed 's/<[^>]*[>]//g'`
trailer=${trailer//[[:space:]]/}
trailer=${trailer//$youtube/$empty}
actors=`echo $actors| sed 's/<[^>]*[>]/./g'`
actors=${actors//$singleQuote/$singleQuoteReplaced}
director=`echo $director| sed 's/<[^>]*[>]//g'`
director=${director//$singleQuote/$singleQuoteReplaced}
credits=`echo $credits| sed 's/<[^>]*[>]/./g'`
credits=${credits//$singleQuote/$singleQuoteReplaced}
if [ -f "${a%/*}/"comment.txt ]
then
echo "${a%/*}/"comment.txt "existant";
else
echo "~~Année:~~ __""$year""__ \\\ ~~Titre:~~ __""$name""__ \\\ ~~Titre Original:~~ __""$original""__ (""$country"") \\\ ~~Genre:~~ __""$genre""__ \\\ ~~Acteurs:~~ __""$actors""__ \\\ ~~Réalisateur:~~ __""$director""__ \\\ ~~Scénariste:~~ __""$credits""__ \\\ ~~Intérêt:~~ __""$rating"" (""$votes"" votes {link:www.themoviedb.org|https://www.themoviedb.org/search?query=""$id""} )__ / {link:recherche allocine.fr|http://www.allocine.fr/recherche/?q=""$original""} \\\\ ~~Résumé:~~ __""$mpaa""\\\ \\\\""$plot""__""\\\ {link:Bande annonce|http://www.youtube.com/embed/""$trailer""} \\\ \\\\""${a%/*}/" > "${a%/*}/"comment.txt;
fi
done
exit 0;