pyTivo Discussion Forum Forum Index pyTivo Discussion Forum
Answers and the development of pyTivo a TiVo transcoding server
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

fork of wmcbrine that parses metadata from XBMC NFO files
Goto page 1, 2  Next
 
Post new topic   Reply to topic    pyTivo Discussion Forum Forum Index -> pyTivo
 View previous topic :: View next topic  
Author Message
jczorkmid



Joined: 07 Oct 2010
Posts: 7

PostPosted: Tue Mar 06, 2012 10:51 pm    Post subject: fork of wmcbrine that parses metadata from XBMC NFO files Reply with quote

I'm not sure if this is of general interest or not, but I added support for TV and Movie metadata from XBMC NFO files rather than have redundant .nfo and pyTivo .txt files around. I'm on a Mac, so I just wanted to use the data from the built in XBMC scrapers for pyTivo (previously I had been using pyTivoMetaThis). I started looking into writing a converter, but it seemed easier to just add NFO support to pyTivo instead.

The only other change I made was making the pyTivo text parser continue up the directory tree when loading default.txt.

https://github.com/jpenney/pytivo
Back to top
View user's profile Send private message
wmcbrine



Joined: 04 Jan 2008
Posts: 2010
Location: Maryland

PostPosted: Wed Mar 07, 2012 6:41 am    Post subject: Reply with quote

Adopted.
_________________
My pyTivo fork . My page
Back to top
View user's profile Send private message Visit poster's website
wmcbrine



Joined: 04 Jan 2008
Posts: 2010
Location: Maryland

PostPosted: Wed Mar 07, 2012 8:19 am    Post subject: Reply with quote

This makes me a bit ill:

http://wiki.xbmc.org/index.php?title=Import/Export_library#Video_nfo_files_containing_a_mix_of_XML_and_URL

_________________
My pyTivo fork . My page
Back to top
View user's profile Send private message Visit poster's website
jczorkmid



Joined: 07 Oct 2010
Posts: 7

PostPosted: Wed Mar 07, 2012 12:07 pm    Post subject: Reply with quote

wmcbrine wrote:
Adopted.


Excellent!

wmcbrine wrote:
This makes me a bit ill


Oh dear. I admit I didn't handle that. My understanding is doing things like that is to basically seed the scraper in XBMC so it can get the full details into the DB. If you then export the DB as the updated NFO files they should be just the XML.

Still, I'll take a look and see what happens, because I'm guessing that the XML parser won't like those files if it encounters them.
Back to top
View user's profile Send private message
wmcbrine



Joined: 04 Jan 2008
Posts: 2010
Location: Maryland

PostPosted: Wed Mar 07, 2012 3:31 pm    Post subject: Reply with quote

Well, it's a broken spec; I'm not sure you should handle it. But my preferred method of handling it would be extreme violence against whoever decided that was OK.

I tested it and yes, the parser barfs.

_________________
My pyTivo fork . My page
Back to top
View user's profile Send private message Visit poster's website
jczorkmid



Joined: 07 Oct 2010
Posts: 7

PostPosted: Wed Mar 07, 2012 3:39 pm    Post subject: Reply with quote

I whipped together a "fix" this morning that handles cases where there is a line of non-xml data somewhere after the xml data (the samples on the wiki would pass). By handle it, I mean pretend it's not there. I'm not having pyTivo go retrieve the metadata from the URL like XBMC would. Any other xml errors will cause it to just ignore the .nfo file rather than barf.

I'll push it to my repo later today.
Back to top
View user's profile Send private message
KyleR96



Joined: 14 Jun 2008
Posts: 4
Location: Lewisville, TX

PostPosted: Tue Mar 13, 2012 4:36 am    Post subject: Reply with quote

Thanks a lot for setting this up! I use XBMC also so it really nice to have pyTivo using the .nfo files!
Back to top
View user's profile Send private message
jczorkmid



Joined: 07 Oct 2010
Posts: 7

PostPosted: Wed Mar 14, 2012 7:52 pm    Post subject: Reply with quote

KyleR96 wrote:
Thanks a lot for setting this up! I use XBMC also so it really nice to have pyTivo using the .nfo files!


No problem. Glad to hear someone else finds it useful. Let me know if you encounter any issues.
Back to top
View user's profile Send private message
wkearney99



Joined: 10 Apr 2012
Posts: 10
Location: Bethesda, MD USA

PostPosted: Tue Apr 10, 2012 3:12 pm    Post subject: Reply with quote

wmcbrine wrote:
Well, it's a broken spec; I'm not sure you should handle it. But my preferred method of handling it would be extreme violence against whoever decided that was OK.


Seriously, that's just garbage. It's either an XML file or it's not. Half-assing it by putting what looks like XML into a text file is totally brain-dead stupid. A beating should be rendered unto the idiots that thought it was anything remotely resembling a good idea.

Rather than trying to parse that crap on the fly all the time, wouldn't it be better to check timestamps to see if the garbage has changed and then special-case handle it? Seems safer to have parallel metadata that's reliable instead of integrated crap that's randomly wrong.
Back to top
View user's profile Send private message
lucasnz



Joined: 13 Sep 2010
Posts: 251

PostPosted: Fri Apr 20, 2012 11:30 am    Post subject: Reply with quote

I get the following error when I have an 'invalid' nfo file in the folder with the movie;
File "metadata.py", line 442, in _parse_nfo
import ipdb; ipdb.set_trace()
ImportError: No module named ipdb

It seems I don't have the module it's referencing, but the nfo is not an XMBC nfo file at all...

Luke
Back to top
View user's profile Send private message
jczorkmid



Joined: 07 Oct 2010
Posts: 7

PostPosted: Fri May 18, 2012 12:31 pm    Post subject: Reply with quote

lucasnz wrote:
I get the following error when I have an 'invalid' nfo file in the folder with the movie;
File "metadata.py", line 442, in _parse_nfo
import ipdb; ipdb.set_trace()
ImportError: No module named ipdb


Ugh! That should have been removed before I committed. Just delete that line (it drops to the debugger). I don't understand how it's still in there.
Back to top
View user's profile Send private message
jczorkmid



Joined: 07 Oct 2010
Posts: 7

PostPosted: Fri May 18, 2012 12:58 pm    Post subject: Reply with quote

wkearney99 wrote:
Seriously, that's just garbage. It's either an XML file or it's not. Half-assing it by putting what looks like XML into a text file is totally brain-dead stupid. A beating should be rendered unto the idiots that thought it was anything remotely resembling a good idea.


The use case for these files is to give a hint to the XBMC scraper so it can get the correct data. When you re-export your library to .NFO files (unless you tell it not to) the non-XML .NFO file will be overwritten with a valid XML one, so it's not like these should be hanging around long term.
Back to top
View user's profile Send private message
philhu



Joined: 04 Jan 2008
Posts: 474

PostPosted: Mon Apr 22, 2013 4:06 am    Post subject: Reply with quote

Hi

I found this is working ok. I did find a bug with it though. I have shows with NFO files, created by other programs and dumping them directly into a pytivo setup directory.

The title, show episode, etc are right.

It does not seem to parse the actors, director, etc.
It *DOES* get the season/episode and add it to the episode title, very cool. So I know it is working.

Also, the download program DOES put a .txt file in the .meta directory, under 'Season', like:

D:\TV\Program Name\Season 01\.meta\Episode Name.mkv.txt
with program:
D:\TV\Program Name\Season 01\Episode Name.mkv
D:\TV\Program Name\Season 01\Episode Name.nfo

So, what would be used in this case?


Here is a sample just downloaded:
<episodedetails xsd="http://www.w3.org/2001/XMLSchema" xsi="http://www.w3.org/2001/XMLSchema-instance">
<title>Under Siege</title>
<season>4</season>
<episode>1</episode>
<aired>2013-04-19</aired>
<plot>A hurricane isnΓÇÖt the only thing brewing in this season's premiere. A blacklisted visitor shows up mid storm. An important order's mishandling wreaks havoc on the shop; meanwhile the largest weapon in Red Jacket history may also prove to be the most problematic.</plot>
<displayseason />
<displayepisode />
<thumb />
<watched>false</watched>
<credits />
<director />
<rating />
<actor>
<name>Will Hayden</name>
<role>Founder</role>
<thumb>http://thetvdb.com/banners/actors/283221.jpg</thumb>
</actor>
<actor>
<name>Stephanie Hayden</name>
<role>Office Manager</role>
<thumb>http://thetvdb.com/banners/actors/283219.jpg</thumb>
</actor>
<actor>
<name>Vincent "Vince" Buckles</name>
<role>Head Gunsmith / Shop Manager</role>
<thumb>http://thetvdb.com/banners/actors/283220.jpg</thumb>
</actor>
<actor>
<name>Kris Ford</name>
<role>Shop Apprentice / Builder</role>
<thumb>http://thetvdb.com/banners/actors/283222.jpg</thumb>
</actor>
</episodedetails>
Back to top
View user's profile Send private message
wmcbrine



Joined: 04 Jan 2008
Posts: 2010
Location: Maryland

PostPosted: Mon Apr 22, 2013 8:09 am    Post subject: Reply with quote

In general, pyTivo will combine all available sources of metadata. As pyTivo's "native" metadata format, the .txt takes precedence over everything else, except for the internal metadata in .TiVo files. But, that's only on a field-by-field basis. If, for example, there's a description in the .nfo, but none in the .txt, the lack of it in the .txt doesn't cause it to be reset; the .nfo's description is carried through.
_________________
My pyTivo fork . My page
Back to top
View user's profile Send private message Visit poster's website
philhu



Joined: 04 Jan 2008
Posts: 474

PostPosted: Mon Apr 22, 2013 1:58 pm    Post subject: Reply with quote

Ok, thats cool. But the show info seems to be missing actors and Genres. Here is the .txt file found in the .meta folder

Code:

pi@rasputil:/cifs/TV_Underground/Sons of Guns/Season 04/.meta$ cat Sons.of.Guns.S04E01.Under\ Siege.mkv.txt   
title : Sons of Guns
seriesTitle : Sons of Guns
episodeTitle : 4x01 Under Siege
episodeNumber : 1
isEpisode : true
description : A hurricane isn't the only thing brewing in this season's premiere. A blacklisted visitor shows up mid storm. An important order's mishandling wreaks havoc on the shop; meanwhile the largest weapon in Red Jacket history may also prove to be the most problematic.
seriesId : EP01361285
callsign : Discovery
originalAirDate : 2013-04-19T00:00:00Z
vActor : Will Hayden
vActor : Stephanie Hayden
vActor : Vincent "Vince" Buckles
vActor : Kris Ford
starRating : 3.4
tvRating : TV-14
vProgramGenre : Documentary
vProgramGenre : Reality


Also, note, the actors are in both the .txt and .nfo files
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    pyTivo Discussion Forum Forum Index -> pyTivo All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Site is in NO WAY affiliated with TiVo Inc

Powered by phpBB © 2001, 2005 phpBB Group
phpBB SEO

Get pytivo at SourceForge.net. Fast, secure and Free Open Source software downloads
[ Time: 0.2851s ][ Queries: 12 (0.0123s) ][ GZIP on - Debug on ]