LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-18-2019, 07:11 AM   #1
elsmandino
Member
 
Registered: Oct 2009
Posts: 103

Rep: Reputation: 0
Script to automatically create .nfo files for Kodi.


Hello,

I have quite a specific issue that I was hoping you guys might be able to help me with.

I have masses of TV recordings that I want to view via Kodi, in Library mode, but I cannot just use the inbuilt scraper as it seems to be picking up lots of incorrect shows and about a third of the shows are not being picked up at all.

The way round this is to have an .nfo file for each show, that Kodi can use to add the file to the library.

Is there any way that I can automatically create an .nfo file for each recording?
 
Old 01-18-2019, 02:31 PM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
find a software, or write a script, that produces the desired output, direct the output to an .nfo file, run that for every video you need.

Code:
find -type f -iname '*mp4' -exec myscript {} > {}.nfo \;
(not tested)
(see 'man find')
 
1 members found this post helpful.
Old 01-18-2019, 04:27 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Here is some information on how to manually create NFO files. python might be the easiest way to create the files although it depends on your programming skills.

https://kodi.wiki/view/NFO_files
 
1 members found this post helpful.
Old 01-22-2019, 08:29 AM   #4
alexpaton
Member
 
Registered: Jul 2009
Distribution: Ubuntu & ClearOS
Posts: 163

Rep: Reputation: 47
Why re-invent the wheel? try TMM (tiny media manager). I have found it useful for both Kodi and Emby. It also allows you to download the associated media and subtitles to the same folder as the videos. It also automatically sorts Box Sets out for movies, and can rename files to fit the Kodi criteria.

https://www.tinymediamanager.org
 
1 members found this post helpful.
Old 01-23-2019, 04:37 AM   #5
elsmandino
Member
 
Registered: Oct 2009
Posts: 103

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by alexpaton View Post
Why re-invent the wheel? try TMM (tiny media manager). I have found it useful for both Kodi and Emby. It also allows you to download the associated media and subtitles to the same folder as the videos. It also automatically sorts Box Sets out for movies, and can rename files to fit the Kodi criteria.

https://www.tinymediamanager.org
Thanks, Alex.

So just to clarify, can TinyMediaManager create an NFO without scraping the information from any internet source first - i.e. can it work purely on the filename?

Out of interest, can I just ask why you are using TMM if you are also using Emby? I was under the impression that they do the same thing.
 
Old 01-23-2019, 05:37 AM   #6
alexpaton
Member
 
Registered: Jul 2009
Distribution: Ubuntu & ClearOS
Posts: 163

Rep: Reputation: 47
I use kodi on android tv boxes, which seem to regularly 'lose' the media libraries, and I have to re-add and re-scrape. Even with nfo files, this can be a lengthy process; so lengthy, in fact, that on my FireTV box, it goes to sleep and you have to keep re-starting the scraping. I found TMM and it helped a lot. It is so frustrating though, that I ended up opting for the Server/Client model instead. Using Emby also lets me run Trakt from a central location. Emby also gives me the advantage that I can add content to Kodi that just can't be scraped at all; any tv shows that aren't on tvdb, and films that aren't on themoviedb, I just shove into a folder called "unfound/TV" or "unfound/movies", and add them as "Mixed Content". I've also done it for Football matches (soccer, if you are American) and binaural audio.

The BIG advantage of TMM, is that if the standard scrapes (tvdb for TV & themoviedb for movies) don't find your film or series, you can select trakt or imdb, and it writes that to the nfo. Whichever method I use (emby or kodi), I now have about a 95% success rate for movies and tv. Given that I am into obscure things like 1970s Czechoslovakian science fiction and Chinese martial arts fantasy stuff, that's pretty good.
 
1 members found this post helpful.
Old 01-23-2019, 07:13 AM   #7
elsmandino
Member
 
Registered: Oct 2009
Posts: 103

Original Poster
Rep: Reputation: 0
Thanks Alex - this is really useful.

I have a similar but slightly different set up.

I have four Raspberry Pis all running Libreelec.

I have a central, headless server, that does all my recording via TVHeadend (I have Openmediavault as the OS).

I use MYSQL on the server to keep all my watched statuses and libraries synced.

About 90% of everything that gets watched in my household is recorded from Freesat.

I have TVHeadend save its filenames in a Kodi-compliant away and then have the recording folder automatically scraped into Kodi's TV Shows library.

Unfortunately, this does not really work very well - masses of shows never show up in the library and lots of others get picked up as incorrect series.

If you are getting 95% with 1970s Czechoslovakian SF (by the way, that is marvellously niche!), I should be getting around 100% with the more mainstream stuff that we watch.

Is TinyMediaManager something I could install on the headless server and just let it do its thing or is there quite a lot of intervention involved from a user?
 
Old 01-24-2019, 05:59 AM   #8
alexpaton
Member
 
Registered: Jul 2009
Distribution: Ubuntu & ClearOS
Posts: 163

Rep: Reputation: 47
OHHHHHH you really need to check out Emby. There is a TVHeadend plugin for TV recording. Then there are 2 different methods of getting Emby content into Kodi:-

1) Embycon - This is a remote connect to the Emby server.
2) Emby for Kodi - Hijacks all the Kodi databases and works as though it is native Kodi data.

The only downside is that there is a small fee for Emby 'Premiere', which you would need to access the TVHeadend stuff across the network through Emby, though most other functionality works out of the box.


TinyMediaManager - I don't think there is any way to get it to run on a headless server, but if the media on it is on network shares, you can easily run it across the network - You would set up your TV and movie folders, and it will do a lot of the scanning itself. Then you have to go through a process of identifying the programs, MOST of which will be automatically picked up, if you follow the naming conventions that Kodi asks for, MOST will be alright. You then just need to scan the list to see which ones are wrong, and which ones aren't identified at all. If it doesn't pick them up from themoviedb or tvdb, just try the other sources from the dropdown.

In the worst case scenario, with foreign language tv, which often have multiple names in multiple languages, I searched IMDB for them, and copied and pasted the imdb ID into the search box (ttxxxxxx from the url) into the search box and it finds them no problem. I would say that it probably took a couple of hours to go through 7000 films and about 1500 series, maybe a little longer. In my case, since I use Trakt, I donated to TMM, to get the additional functionality, which also imported my watched status from trakt, which it also wrote to the nfo files.

Obviously, in your case, whenever you record something new, you would have to scan for that as well, but you are talking about a minute or 2, every week or more.

Last edited by alexpaton; 01-24-2019 at 06:02 AM.
 
1 members found this post helpful.
Old 01-25-2019, 04:36 AM   #9
elsmandino
Member
 
Registered: Oct 2009
Posts: 103

Original Poster
Rep: Reputation: 0
I can't thank you enough for this, Alex.

Have been checking out Emby and it looks amazing - it seems to solve all the issues I have.

Videos can be added to the library (with Emby for Kodi), without having to scrape them first or create an NFO, so I would not need anything like TMM at all.

The one thing I cannot quite get my head around is the TVHeadend plug-in.

What is the difference between using Kodi with both TVHeadend and Emby Plugins installed, vs just the Emby Plugin (which in turn uses its own Plugin for TVHeadend)?
 
Old 01-25-2019, 08:00 AM   #10
alexpaton
Member
 
Registered: Jul 2009
Distribution: Ubuntu & ClearOS
Posts: 163

Rep: Reputation: 47
To be honest, if you have TVHeadend installed and working OK, then there is little point in moving that part over. The main advantage is that it makes it an "All-in-one" solution. The only real advantage would be that with Emby, you can also set it up to access everything remotely (either by IP Address, or by using a dynamic DNS service).

The latest version of Emby has made some pretty big improvements to its ffmpeg stuff, so once a program is recorded, you can set it up to process the file to make it a bit less bulky.

If you are excited by Emby, have a look at the Embuary skin for Kodi, which is pretty finely tuned to integrate the emby functionality. It makes it SUCH a rich experience.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Kodi Devs Celebrate New Year with First Release Candidate of Kodi 17 "Krypton" LXer Syndicated Linux News 0 01-01-2017 12:00 AM
[SOLVED] Kodi freezes on exit, kodi.bin won't die pressman57 Linux - Software 6 12-19-2016 07:48 PM
NFO Viewer for Linux? GT_Onizuka Linux - Software 21 01-19-2011 03:27 AM
Looking for an .nfo program memo007 Linux - Software 2 04-21-2007 07:39 AM
how to create divx info (.nfo) file Kropotkin Linux - Desktop 2 10-02-2006 08:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration