Author Topic: Export to XBMC  (Read 63121 times)

0 Members and 2 Guests are viewing this topic.

Offline deazo

  • Older Power User
  • *****
  • Posts: 283
    • View Profile
Export to XBMC
« on: September 09, 2009, 11:34:58 am »
  Hi Nostra Rick and all,

 I have now finally built my HTPC and I am copying over HDD all my burned avi's.
 Parallel to that I would like to find the best way to use XBMC to view PVD's info in their beautiful interface.
 My question you guessed it again is about the transfer process.
 I have read all posts about the subject on PVD's forum as well as XBMC one. And I came to a few conclusions. I'd like you to help me find the best one or if you think of others, to advise. Thanks for your help in advance.
Also before I list my "solutions" I'd like to point that I am clueless and useless at coding and scripting so I am not contemplating writing scripts unless someone tells me it's dead simple of course!

 1. From what I have read, a nice way would be to have PVD create a .nfo file next to each movie file, in the format accepted by XBMC. At the moment I do not think PVD has this feature, and I am not even sure if it can generate .nfo file. For info, the .nfo file structure for xbmc can be found here: http://xbmc.org/wiki/?title=Import_-_Export_Library#Video_nfo_Files
Can you tell if such a feature is in the pipeline by any chance, and that it is worth waiting for it to appear in a future update? (really I am not asking for this as I know there are a lot of other things to take care of, but I might be in luck?)

2. In the past I was using Extreme Movie Manager to manage my collection and my subscription to that software is still on, so I can use it. In its last updates, it has the ability to generate .nfo files in the XBMC format. So I'm now considering doing PVD --> EMM --> XBMC... Since I am useless at writing XML templates, I am thinking of finding a way to export in an xml file the following info from PVD (the crucial info I really do not want to loose):
- Original title
- Movie file path
- Posters
- Personal Rating
- IMDB URL (for re-scraping with EMM)
- Allmovie URL (for EMM re-scraping)
Is this feasable? What is the best way to generate such an xml file, readable by EMM ? (I guess I should also ask on EMM's forum)

I really do prefer PVD to EMM's overbusy interface with no interlink between plot keywords, but I also really need to use XBMC so this is the only solutions I came up with. I have also been on XBMC forum but can't find the info I need.
I know this might be asking a lot but if you can I would really appreciate some help!

Thanks
« Last Edit: October 19, 2010, 07:19:10 pm by nostra »

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Export to XBMC
« Reply #1 on: September 09, 2009, 12:01:26 pm »
It is no problem generating such nfo files (actually any text based files) using templates for the export plugin. The files can also be placed near video files automatically.
Just do a search for "export" on this forum and you will get lots of information about creating templates.
Gentlemen, you can’t fight in here! This is the War Room!

Offline deazo

  • Older Power User
  • *****
  • Posts: 283
    • View Profile
Re: Export to XBMC
« Reply #2 on: September 09, 2009, 01:37:13 pm »

 Thanks for the super fast answer Nostra.
 From what you're saying it should not be super hard to create a script that would do what I need.
 I'm just worried I am not good enough for the task but I'll give it a go.
 Just as a free tip, what should I do to make this script create an .nfo file next to each movie file?
 Thanks.

Offline deazo

  • Older Power User
  • *****
  • Posts: 283
    • View Profile
Re: Export to XBMC
« Reply #3 on: September 09, 2009, 02:26:12 pm »

 Also, I am wondering about posters:
 I have chosen the posters to be part of the database and not separated.
 When the .nfo file will be generated next to the movie file, is there going to be a kind of "image path" pointing XBMC to the right poster? Considering the poster is "part" of the pvd file, how can it have an image path?
 Please do not laugh if this sounds stupid.. :-\.

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Export to XBMC
« Reply #4 on: September 09, 2009, 10:26:37 pm »
Quote
Also before I list my "solutions" I'd like to point that I am clueless and useless at coding and scripting so I am not contemplating writing scripts unless someone tells me it's dead simple of course!

I'm pretty much useless at anything resembling "programming" too. And I don't use XBMC, so I'm not going to attempt to give you specific guidance. From my experience, however, I can tell you the best solution is to export everything to NFO so XBMC can import it (I imagine it does so automatically, if the files are present). At a glance, it seems it's documentation outlines exactly what you need. As nostra says, you don't need a script to create the NFO files—just a plain text export template to define the required format. A sample XML template is provided as a starting point. Although the documentation is rather thin, you can find out what you need to know by searching the forum. Although I don't expect you'll find it easy, the process of editing and troubleshooting an export template is "dead simple." Just edit the template and try an export. It either works or it doesn't. It helps if you're good at compulsive trial and error. ;)

Posters can also be exported "beside" the video file. I expect XBMC will find these and build it's thumbnails from them. I'm not sure, but it may just require a few lines in the same template.

If you share your efforts here, you may find there are other XBMC users who will pitch in to help. Considering how "open" XBMC is, I'm surprised someone hasn't done this already. Even if they have, you'll need to know how to revise your template anyway—so you can handle your custom fields and personal preferences.

Offline deazo

  • Older Power User
  • *****
  • Posts: 283
    • View Profile
Re: Export to XBMC
« Reply #5 on: September 09, 2009, 11:15:20 pm »
OK thanks I guess I'll start this new project, I really would rather use PVD only than having to go through EMM.
For anyone reading and expecting me to be at it very quick, please bear with me, time is hard to find...

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Export to XBMC
« Reply #6 on: September 09, 2009, 11:21:18 pm »
You could also get in touch with CAD and oska85. They seem to be writing a template for XBMC as well...
Gentlemen, you can’t fight in here! This is the War Room!

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Export to XBMC
« Reply #7 on: September 10, 2009, 12:30:38 am »
Quote
You could also get in touch with CAD...

See "imagepath" statement as well.  I forgot about these topics. After getting a lot of help here, it seems CAD forgot to post his finished template.  :o  ;)

I'm sure it would be very helpful to deazo. From the questions he asked, it seems the required template is not as straightforward as I assumed it might be.

Offline CAD

  • Older Power User
  • *****
  • Posts: 168
  • I've got my eye on you!
    • View Profile
Re: Export to XBMC
« Reply #8 on: September 10, 2009, 05:32:39 am »
hi - sorry been away.
template is mostly finished i think. havn't worked on it for while so not sure where i am up to.
i was waiting for Nostra to do some fixes. (nearfile) so I can save images to same directory.
Need to pull apart what nostra has done now and try and figure out how it works  ;).

Also need to figure out how to make credits work
see http://www.videodb.info/forum_en/index.php?topic=1481.0 if someone can help with this bit (may be fixed in new version??)

For peoples interest in how xbmc works and what im trying to do....
xbmc will scrape imdb, tv.com etc based on folder name (and/or file name??) (but definitely folder name)
If there is a .nfo file in the directory it will scrape that first.
if the .nfo has info required it will use that info.
it will also search .nfo for an imdb url and d/l missing info from that url.
So you can have a .nfo file full of crap with an imdb url and the scraper will find the url and d/l info based on that.
All this data is saved in a local sql database.

The problem (i have) with xbmc is that the scrapes are reeeaaally sloooow, the folder names need to be precise, saving/backing up database info is a bit of a pain. Not really an issue with pc based xbmc as you can use keyboard for data entry, but i'm using xbox to run xbmc

(Not really a big deal - but a matter of principle :) )...I don't want to have to maintain d/l the same data twice for different apps.

So what i am trying to achieve is:
Add movie into pvd, dl any required info from online sources. I can then export movie as a .nfo+image. These files can live in the movie directory. When xbmc does its library update. It will read the .nfo file first as a default and update its internal library with this info. (No need to do second d/l stuff from i/net).
The alternative is to have xbmc do the scrape from imdb and then import this info into pvd ( havn't even started on how to make this happen)

if you want to see fields xbmc is storing, do a individual export (export per movie). This will create a .nfo+images into the directory that movie is stored in. (.nfo file is xml). You can pull this apart to see what is required.

Anyway. attached what i have done so far.
Also included is an example of what xbmc will export. (I imported from xbmc and then exported to folder)

Things that i know are broken (in this version :) )

nearfiles needs too be fixed/checked to save images into same directory that .nfo file is generated.
associated xml entry inside .nfo file needs to be written correctly
I don't know how to make credits work (yet :) )


[attachment deleted by admin]
« Last Edit: September 10, 2009, 07:44:04 am by CAD »
three fingered salutation

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Export to XBMC
« Reply #9 on: September 10, 2009, 06:38:00 am »
Thanks for the update, CAD.

It seems you forgot to include your attachments. I'm curious about the XBMC export sample, although I suppose it may not tell me more than the wiki entry. I'm wondering if the information in XBMC is at all customizable, or can you only use the fields they provide (obviously you can choose whether or not to populate them). Can you, for example, create a custom field, and then fill it with anything you like from PVD? The main reason I'm wondering is to understand whether the template you're creating will be a general solution for all XBMC users, or something each will have to modify for their own use.

It sounds like you're almost there. You have the nearfiles function now. Hopefully nostra can help you with the other issues. Maybe deazo can beta test for you. ;)

Offline deazo

  • Older Power User
  • *****
  • Posts: 283
    • View Profile
Re: Export to XBMC
« Reply #10 on: September 10, 2009, 07:48:21 am »
Quote
So what i am trying to achieve is:
Add movie into pvd, dl any required info from online sources. I can then export movie as a .nfo+image. These files can live in the movie directory. When xbmc does its library update. It will read the .nfo file first as a default and update its internal library with this info. (No need to do second d/l stuff from i/net).

That's exactly what I'd like to achieve.

Quote
I'm wondering if the information in XBMC is at all customizable, or can you only use the fields they provide

From what I have gathered, it seems that XBMC is quite rigid and has its own restricted fields. I also think their search options are not that great. That's why I would still love to use PVD as the brain and XBMC as the face...

Quote
Maybe deazo can beta test for you
I'd be glad to do so, this would give me a great starting point. CAD could you post the files? (FYI I'm back home on monday so don't expect any testing before that)

Offline CAD

  • Older Power User
  • *****
  • Posts: 168
  • I've got my eye on you!
    • View Profile
Re: Export to XBMC
« Reply #11 on: September 10, 2009, 08:00:11 am »
Quote
Thanks for the update, CAD.

It seems you forgot to include your attachments. I'm curious about the XBMC export sample, although I suppose it may not tell me more than the wiki entry. I'm wondering if the information in XBMC is at all customizable, or can you only use the fields they provide (obviously you can choose whether or not to populate them). Can you, for example, create a custom field, and then fill it with anything you like from PVD? The main reason I'm wondering is to understand whether the template you're creating will be a general solution for all XBMC users, or something each will have to modify for their own use.

It sounds like you're almost there. You have the nearfiles function now. Hopefully nostra can help you with the other issues. Maybe deazo can beta test for you. Wink

doh - damn work proxies suck. had to zip it up as well.....

xbmc is open source so i guess that library stuff is customisable. i havn't pulled apart the scrapers. I think they are kinda like the way that nostra does it. compiled .dll type files. Can't say for certain as i haven't investigated / had no need. Maybe when i have more time/kids move out of home....

i have just been trying to do (as close as i can) map of xbmc requirements (from an export from xbmc) to what i can get out of pvd  so xbmc has no need to access internet and i can semi automate .nfo creation. also i am not interested in having xbmc have all movie info/cast people/ etc etc. ( i know others do) For movies - I have a bunch on my hard drive and want a quick reminder of what they are about so i can decide if i want to watch them or not. usually after watching - they are deleted.
I will get around to tv shows... but i use xbmc library as a watched/not watched list. I generally know what a tv series is about so i don't need to d/l info about it. just need an episode list. xbmc wll create an episode list in the library. When playing an episode from xbmc, it disappears from the list after watching it. I always know what episode im up to as they disappear after watching.= less having to remember stuff for me :)
three fingered salutation

Offline CAD

  • Older Power User
  • *****
  • Posts: 168
  • I've got my eye on you!
    • View Profile
Re: Export to XBMC
« Reply #12 on: September 10, 2009, 08:14:15 am »
Quote
From what I have gathered, it seems that XBMC is quite rigid and has its own restricted fields. I also think their search options are not that great. That's why I would still love to use PVD as the brain and XBMC as the face...

xbmc is highly customisable, has web front ends is open source and has huge support base.
so big that its really hard to find info on what you want (theres so much). it has web interface and db support (don't know about for firebird though). i though about web interface to pvd (firebird) server running in backend, (should be possible) but for the limited amount of stuff i stream it is probably not worth it. I may get around to it if i ever have time (or ask script kiddies in xbmc forums to have a go)  ;)   i mostly use pvd as movie catalogue/ filing system so i know where everything is. xbmc is pretty much used just to watch stuff. (this doesn't include music. i use xbmc library extensively to filter music)
three fingered salutation

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Export to XBMC
« Reply #13 on: September 10, 2009, 08:48:05 am »
Quote
xbmc is highly customisable, has web front ends is open source and has huge support base.

Yes, this is the impression I had. In other words, the answer to any question is always "Anything is possible." On the other hand, I would guess most users don't stray far from it's default configuration (for things like available metadata fields). If that's the case, a general template that fills as many of it's standard fields as possible may be the way to go. It might then be a ready solution for other XBMC users who want more control over where and how their metadata is obtained. If you can generate some interest in the XBMC community, you might attract the attention of someone who can create something to pull the information directly from the database. That's what us J. River Media Center users have, thanks to raldo. It's very cool. 8)

Offline deazo

  • Older Power User
  • *****
  • Posts: 283
    • View Profile
Re: Export to XBMC
« Reply #14 on: September 10, 2009, 09:24:14 am »

 It's true the forum is huge on XBMC's site, and I see other sites as well like the XBMC-Passion (French) site as well.
 I could not find anything on "personal ratings" for example, apart from enhancement requests.
 Also on the search options it looks like the search only harvest all text with no distinction.
 
 Thanks for the zip file I'll take a look when I can, and see if I understand anything.

Offline CAD

  • Older Power User
  • *****
  • Posts: 168
  • I've got my eye on you!
    • View Profile
Re: Export to XBMC
« Reply #15 on: September 14, 2009, 06:18:21 am »
Here is mkii.
You can export multiple .nfo files (way cool)

NB: Mappings are not complete.

There are a couple of issues.
"nearfiles"  parameter needs a path hard coded in or it fails to export images.
Without hardcoding "nearfiles" path, it saves either to where pvd is installed or if you saved a file
without nearfiles, it remembers the location.

Preferences/Folders --> Specify a path.
does not seem to have an effect on where files are saved with nearfiles.
(Perhaps Nostra can add a nearfiles path option) ;)

I can't get credits to work - no matter how hard i try :(

pls pls some request for Nostra ;)
Can we add file path option:
so if "file path" is populated, the exported .nfo/xml can be named the file name.
eg. if you have a movie in c:\movies\moviename\movie_5.1_en.iso
nearfiles=%filename%.nfo will create a file called "movie_5.1_en.nfo"
If you wanted to be super clever it could save the files to the path :) :)


[attachment deleted by admin]
three fingered salutation

Offline deazo

  • Older Power User
  • *****
  • Posts: 283
    • View Profile
Re: Export to XBMC
« Reply #16 on: September 14, 2009, 08:21:43 pm »

 I'm really not sure I'm doing things the right way, so see for yourself and please no bashing...
 I have unzipped your file and copied the content into the plugins templates directory.
 For testing purpose I am using a test database made of 2 movies. They are both in a folder of the exact same name than the movie file.
 I first tried to export and generate .nfo files and nothing was happening. All that I was getting was a new explorer window opening on PVD's directory. No file was being created.
 I then played around with the file in notepad, not knowing at all what I was doing.
 I changed the "nearfile" part to this:  nearfiles="%t%.nfo"
 and it actually worked.
 I mean that I got an image file and an nfo file generated for both movies in the right directory with the exact filenames.
The first nfo file (movie A) did not contain the imdb URL of the movie, while the second one, for movie B contained only the Allmovie URL.
Movie A in pvd only had an imdb URL while movie B in pvd had two URL's, imdb and allmovie.

 I then opened XBMC and tried to see if that nfo file was used by it.
The info it took from Movie A was only the poster, plot and runtime. The nfo file for Movie A contained more info, like director, actors, etc.
The info it took for Movie B is roughly as limited, with tagline and outline (this info was not present in movies A's nfo file).

I must then have done something wrong when modifying the script.
What should "nearfiles" be set as?
Also what is the use in pvd preferences/folders/specify a path. Specify for what?



Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Export to XBMC
« Reply #17 on: September 14, 2009, 08:28:30 pm »
Quote
I can't get credits to work - no matter how hard i try Sad

Could you remind me what the problem was?

Quote
Can we add file path option:
so if "file path" is populated, the exported .nfo/xml can be named the file name.
eg. if you have a movie in c:\movies\moviename\movie_5.1_en.iso
nearfiles=%filename%.nfo will create a file called "movie_5.1_en.nfo"

It already does this without any changes, so in your example c:\movies\moviename\movie_5.1_en.nfo would be created. You can lso specify smth like nearfiles="..\foldername\%t%-%o(%y%)%.nfo" in the latest version of the plugin.
Gentlemen, you can’t fight in here! This is the War Room!

Offline CAD

  • Older Power User
  • *****
  • Posts: 168
  • I've got my eye on you!
    • View Profile
Re: Export to XBMC
« Reply #18 on: September 15, 2009, 01:36:07 am »
Hi Deazo.
I'll try to explain how it works and then you can modify to suit.
Also - it will only extract info that exists in PVD so make sure fields are populated.
Also download notepad++ - It makes working with text files much much easier.

Anything that does NOT have something that looks like {%value=something} will not be populated
eg
<trailer></trailer> will not have data entered into it.

Main template file is XBMC2.ptm
Code: [Select]
%OPTIONS%
replace="http://www.imdb.com/title/<->"  <=== Leaves only imdb No (as per xbmc format)
filter="XML Files|*.nfo" <==== Did this to force recognition of .nfo
imagenameformat="%t%%ext%" <==== Exports posters as titlename.jpg
nearfiles="d:_test%t%.nfo"   <==== Exports individual .nfo files. I found I needed to have a file pathe here: eg c:xbmc
NB: You Need to change this path to suit where you want to save your files to.

Code: [Select]
%OPTIONS%

In the main body, i tried to match best I could, but couldn't find all the fields. eg both plot (detailed  and plot summary don't seem to exist in PVD. So I reused some fields.

Code: [Select]
%HEAD%
<movie>
<title>{%value=title}</title>  <==== Imports title
    <rating>{%value=rating}</rating> <==== Imports IMDB rating
...
...
<outline>{%value=tagline}</outline>  <==== Outline uses PVD tagline
<plot>{%value=description}</plot> <==== Plot uses PVD description
{%value=tags template="tags.tpl" maxvalues="3"} <==== This calls the file tags.tpl and  limits the No of tags to 3
...
<thumb>{%value=poster}</thumb> <==== Path to poster. Found poster image had to be in same directory for xbmc to find it.
...
<id>{%value=url}</id> <==== This is the url in PVD. Needs some work to limit it to only imdb No.
<genre>{%value=genre}</genre>
<director>{%value=directors}</director>
...
{%value=actors template="actors.tpl" maxvalues="3" params="full"} <==== calls file actors.tpl and limits the No presented to 3
{%value=Credits template="credits.tpl"}  <==== This doesn't work.
</movie>

I tried best as I could to match what is exported from xbmc.
If you have other fields that need to be populated or what I am populating could be changed, let me know and I'll try to fix it up. :)
« Last Edit: September 15, 2009, 10:47:21 am by CAD »
three fingered salutation

Offline CAD

  • Older Power User
  • *****
  • Posts: 168
  • I've got my eye on you!
    • View Profile
Re: Export to XBMC
« Reply #19 on: September 15, 2009, 03:05:30 am »
Quote
Could you remind me what the problem was?

Hi nostra,
I'm not getting data returned with credits tag.

In main.ptm file I have
Code: [Select]
{%value=credits template="credits.tpl"}
Also tried
Code: [Select]
{%value=credits}
In credits.tpl i have;
Code: [Select]
%HEAD%<credits>%HEAD%
<name>{%param=writers}</name>
<role>{%param=composers}</role>
<role>{%param=producers}</role>
%FOOT%</credits>%FOOT%

It seems %value=credits is being recognised but not processed. ie. nothing gets returned.
I checked the log file. Nothing there to indicate problems.

I am using pvd version 0.9.9.14 and export plugin version 0.6.1.0

Edit removed - text - i think install corrupt - more testing needed. :)

pls pls help :)
« Last Edit: September 15, 2009, 10:46:24 am by CAD »
three fingered salutation