Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
Merge nfo files with online database
#1
Hi,
It seems Kodi cannot parse file names like ThisMovieName2010-1080x5.1.mpv, or movies with THIS_MOVIE_NAME.vob, etc. Kodi found 360 of my 960 movies, and I am not going to rename them, so I wrote a quick and dirty script to write .nfo files for each movie.
This works great, I now have all my movies with the correct title, however there is NO metadata. When I try to look it up (and this is a really stupid feature, if you ask me), it puts the movie filename in the space instead of the title. This is again unusable.

Does anyone know of any plugins or some box I've missed that will meld the nfo title and go find the meta data from the online db? It's pretty sad that one of the most important features, that of finding and adding metadata for media it seems it is very immature. I would expect this from alpha or perhaps beta software, but not something that has been around as long as Kodi.
Reply
#2
My nfo files are like this, if it matters.
 <?xml version="1.0" encoding="UTF-8" standalone="yes" ?><movie><title>The Movie Name</title></movie>
Reply
#3
(2023-01-19, 05:12)rickyrockrat Wrote: My nfo files are like this, if it matters.
 <?xml version="1.0" encoding="UTF-8" standalone="yes" ?><movie><title>The Movie Name</title></movie>
Yes, it does matter. It also matters where you saved the nfo file and how you have named it.
If you are hoping that Kodi will read the <title> tags and use that for the lookup, then it won't.
You need to use a Parsing NFO file... https://kodi.wiki/view/NFO_files/Parsing
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#4
For Real? I have to look the title up manually? What's the purpose of Kodi, then? Are you really serious? This is truly the best way?

There is nothing wrong with the .nfo files I did create with a simple bash script because it allowed Kodi to find the other 630 files it originally missed, so I both have movies and the correct titles, and they do play.

If I have to manually look up the movies, I may as well continue with my original endeavor and install Alpine.

I'm grateful CoreElec gave me a stable video driver and  sort of stable player on the Le Potato (clearly mvp based, not mplayer...it would be nice to have a choice), but it has this thing called Kodi that I forever find myself confronted with the words Wisky Tango Foxtrot.

Then there is this other part of me that sees a glaring problem and thinks I should find a solution....
Reply
#5
i sense a tone of disrespect here, thats the only person whos bothered to even answer you so you might be more grateful
no, looking up every movie is not the only option you have
1. you can modify the existing scraper to meet your needs as youve chosen a non-standard file naming pattern for 960 movies, some minor changes to the regex before its process should be enough
2. you can write your own scraper https://kodi.wiki/view/Scrapers
3. you can rename your files, not a good option but its not a non-option
the rest of the media world follows a standard naming pattern and you want a custom one then complain when nobody wrote a file scraper thats custom to fit it
Reply
#6
It's unfortunate that that the first answer was the first answer. I presumed that was my only course. Yours is a far better answer. It's nice to have options.

I suppose I am used to writing software that tries very, very hard not to fail, and at the very least it would be nice if the parser could handle capitalization, and, hey, part of the title, but I digress.

It's not disrespect for the author, I appreciate that someone bothered to respond at all, and I am grateful for that. It is directed towards the software, rather, or perhaps it's lack thereof, and my frustration in general with it as a user.

I might have a look at the parser. Any clues on where to start? Source, repo? I'm sure I can eventually find it, but a pointer would be appreciated.

Thanks
Reply
#7
sure do have a clue and in fact a pretty decent idea i think
when kodi calls the scraper, it calls it with each individual filename one at a time, if i were in your position i would go to that function and insert my own code to replace the filename to something the scraper understands, a middle man string parser
off the top of my head, no i dont know the exact place, it should be defined in the addon.xml you should be able to locate it easy enough between that and the link above

i understand writing code that runs with minimal or no failure, i wrote a data entry system 20 years ago that i lost the source code to 10 years ago and its still running and in use to this day
only recently i needed to extend the functionality from a custom client to a web browser based one, which i did 6 months ago and havent touched since

glad to have the tone of your post lifted

EDIT:

https://github.com/xbmc/xbmc/blob/master...es/demo.py

if action == 'find':
title = params['title']

i would insert the middleman code here
Reply
#8
I'm guessing it's in one of the calls here, likely doScan, or something it calls. Trouble is I'll need to load the whole project. Wouldn't it be nice to have a settings text entry to the regex? If if find the time to do that, I'll likely add that as well so anyone can modify it to fit their needs.
https://github.com/xbmc/xbmc/blob/Nexus/...canner.cpp
I'm sure it's not a trivial stack.

Kodi is close to being a viable solution, but it's either missing the things I want or I can't find what I want going through the menus. A web browser would be nice, since I like to look up info on actors or about the movie, an alternate player in addition to mpv, since though mpv has better hw decode integration (at least it used to), it's seek is completely broken on movies that mplayer has no issues with, and of course trying harder to find movies.
Reply
#9
that looks like a demo, not the real deal.
Reply
#10
yes but a little too deep for what im thinking
far easier to modify the addon https://github.com/xbmc/metadata.themoviedb.org.python
kodi will scrape the files, feed each filename to the addon ^ and thats where you would trap it before the addon parses it from tmdb

yes thats a demo, i was trying to get an easy to read example of how the addons are setup to parse what kodi feeds it

the scraper flow
kodi binary reads a directory, gets [file1,file2,file3,etc,...]
then
for each file
call scraper(filename,someextrainfo)

in the scraper
function scraper(filename,[extra])
searchonlineinfo(filename)
then itll return to kodi the info you see in the addon demo

rinse and repeat

(obviously thats a quick out of my head flow, not actual code or data)
Reply
#11
in the tmdb addon from the link

python/scraper.py: line 168, function run()
it calls search_for_movie

search_for_movie is defined on line 29:
def search_for_movie(title, year, handle, settings):

so between run() and search_for_movie(title, year, handle, settings) would be where you can inject a custom parsing

or within search_for_movie have it clean up the name before line 31:
title = _strip_trailing_article(title)

so it would be more like

31: title = cleanmyfilename(title,year)
32: title = _strip_trailing_article(title)

then you can define your own function

def cleanmyfilename(title,year):
return title.replace("_"," ") # or some regex, etc and so on until it meets your needs based on your filenames
Reply
#12
(2023-01-22, 07:26)rickyrockrat Wrote: Kodi is close to being a viable solution, but it's either missing the things I want or I can't find what I want going through the menus. A web browser would be nice, since I like to look up info on actors or about the movie, an alternate player in addition to mpv, since though mpv has better hw decode integration (at least it used to), it's seek is completely broken on movies that mplayer has no issues with
Going thru the menus is one things, some other settings are to be set via the advancedsettings.xml file, as not everything can be placed in the GUI options. Being a media player that needs to work on various OS'es creates a bigger challenge. (Yes I know other media players are available in other OS forms, but they are still "just a standalone player". Kodi has the 'total media experience' to drag along.) And should you prefer MPV, you can also set it as the external player in Kodi, replacing the built-in one.
Reply
#13
Why is writing a script to rename your files and/or fix the file structure not an option?  It would seem at worst no different level of effort than changing the program code, especially since you seem to have programming experience.

Just curious.
HP Stream Mini w/Libreelec -> HDMI -> Toshiba 37"
Intel NUC8i3BEH w/Libreelec -> HDMI -> LG OLED55C3PUA -> S/PDIF -> Sony HT-CT80
Dell Optiplex 7050 Micro w/Libreelec -> HDMI -> Yamaha RX-V467 -> HDMI -> Toshiba 47L7200U
Reply
#14
the great thing @Jogee we dont have to like the way people do things, with kodi being open source it allows any number of configuration variations to suit anybody and *almost* everybody
Reply
#15
(2023-01-22, 21:24)Jogee Wrote: Why is writing a script to rename your files and/or fix the file structure not an option?  It would seem at worst no different level of effort than changing the program code, especially since you seem to have programming experience.

Just curious.
I spent a lot of time so that my movie titles are readable and have the year and the format embedded into the filename to play them from the command line on Linux. Kodi is just one of many options, and I am sure not going to throw away that work. Sure,  I could create a file to restore them while renaming, but IMO, this is broken in Kodi.
Reply

Logout Mark Read Team Forum Stats Members Help
Merge nfo files with online database0