Linux library cleanup and preparation script
#1
Here s a script i wrote, i d be happy if other peoples were using it, giving me feedback and maybe fix some corner cases
Yes, the best would be to re-code it, and integrate this into xbmc.
To me, for somone running linux, that s the fastest way to prepare his movie collection to be used by xbmc
For the best effect, run an imdb based scrapper after running this script.

Maybe try the script by runing it with a test movie folder with only 2 movies inside
download http://www.2shared.com/file/VPIMWeUl/getnfotar.html
start script.sh

if it s your first run change firstrun=y in clean_names.sh then run the script and get a coffee"
afterward set firstrun=n in clean_names.sh and validate google searches"
this will make the script run in automated mode and will avoid any prompt
then you will confirm the other movies not found at first run

What the script does :

Get the imdb url
1 This script will take all movies at the root of the specified folder and put each one in it s own folder
2 It will look for an already existing movie.nfo
3 Else it will look for an already existing imdb url inside an already existing .nfo file
If it finds one, then it will create a movie.nfo file with the imdb url found inside
4 Else it will sugest an imdb movie from a google search
If you answer y, it will then create a movie.nfo file with the imdb url

Get the movie poster
1 If a folder.jpg exist it will skip the movie
2 Else If the largest picture has a poster aspect ratio it will be used as folder.jpg
3 Else If a movie.nfo file is found it will use its imdb url to get the poster
4 If a poster was found it will be used as folder icon in gnome and kde

Rename the folder
If at any point an imdb url was found and the script could find the movie name, then it will rename the movie folder
Reply
#2
Now the script manages also music a bit with the same logic, but it won t rename folders
it does a musicbrainz query, get the poster from amazon, ask you from confirmation, and try to find a poster already in the album folder
it handles either single folder hierarchy 'artist album', 2 folder hierarchy , artist/album and 3 folder hierarchy , artist/album/cd1
if there s a cover found it ll be used as folder icon in gnome and kde
if the musicbrainz search was successfull an Album.nfo will be generated with the musicbrainz album link

there s also a mock up of a tmdb fallback for the movie search, but it s not implemented at all.

start covers.sh for the music part
http://www.2shared.com/file/83iz5z6D/get...cript.html
Reply
#3
http://www.2shared.com/file/DreBaXQp/get...cript.html

small improvement in the case there is no stucture "/mp3/artist/album"
i use the - separator to get artist album "/mp3/artist - album"
Reply
#4
any update here?
are you still using the script?
Reply
#5
Hello

Ewww you searched far faar faaar awaaaay in the past.

The script is only useful for bulk loading your movies into kodi.
All it allowed was, you had a bunch of movies, quicky put imdb url into the an nfo file
At the time this was the minimum info scrappers needed to find identify a movie, grab proper posters actor and stuff and put them in the database.
At the time; if you had like 500 movies, were a first time kodi user, kodi pattern recognition was bad and would recognize like 50 movies, this script would identify like 400 movies put the url in an nfo file and that was enough hint for kodi to fetch all the movies info.

There's a more full featured app https://www.tinymediamanager.org/ (no me) that i can suggest you, that's the last one i used.
It has a gui, lot of options, can run on linux, can download posters and stuff

I don't even remember how the music part worked Smile

As i said, you searched very far, what was your primary need ?
Reply

Logout Mark Read Team Forum Stats Members Help
library cleanup and preparation script0