Jump to content

Creating a custom metadata-retrieving plugin


Recommended Posts

DanielFrank
Posted (edited)

Hi there

So, I've built this website where I can map my entire collection of VHS. Each item on the website contains the exact information that is written on the cover of the VHS, making it searchable, and of course a complete scan of the cover. The website is called https://flixy.dk/

Now, I own a lot of cartoons, and many of them are almost impossible to get hold of on DVD etc, with the Danish dubbing from the good old days. Therefore, I'm digitizing all my cartoons, not only to watch them, but also to preserve my copy because, you know, VHS tapes don't last forever. Of course, I keep all my videos within Emby.

image.thumb.png.2b4543bdf3024b219aeabc084b627c58.png

Here's the thing!

As of now, I submit the item to Flixy.dk. Then I digitize the same item and store it in Emby. Then I have to manually add the cover of the item as well as the description etc. in the item within Emby.

This is a duplication of effort, and I would like to streamline my work a bit, by creating a plugin for Emby, which makes it possible for me to just have a text field within an item in Emby, where I can paste a URL (like: https://flixy.dk/emne/2311) and then Emby would get the cover and metadata like title, description and year automatically from the item on Flixy.dk. Also, there are often links to IMDb and Rotten Tomatoes within the items on Flixy.dk, so, if they could be used somehow it could be awesome.

The mentioned text field should be somewhere on this page in Emby:

image.thumb.png.2eec8ce4bcbc9e999ad907ab1e84e430.png

Can anyone advise me how this could be achieved?

DISCLAIMER: I own a physical copy of each and every item that I have within my Emby. Also, this post is not made as an advert for my website, but in order to get a proper response, someone with the answer to my question might find it necessary to know what information is available, and where.

Thanks for any feedback and thoughts.

Edited by DanielFrank
Cheesegeezer
Posted

Does flixy.dk provide an API, if so it would be easy to set up a metadatProvider plugin.
 

If not it can still be achieved by scraping but you would also have to check the terms of use as Emby never disrespects these and enforce the honouring for their terms of service and usage. 

DanielFrank
Posted
24 minutes ago, Cheesegeezer said:

Does flixy.dk provide an API, if so it would be easy to set up a metadatProvider plugin.
 

If not it can still be achieved by scraping but you would also have to check the terms of use as Emby never disrespects these and enforce the honouring for their terms of service and usage. 

It does not have an API, but I could easily make one.

crusher11
Posted
31 minutes ago, Cheesegeezer said:

Does flixy.dk provide an API, if so it would be easy to set up a metadatProvider plugin.
 

If not it can still be achieved by scraping but you would also have to check the terms of use as Emby never disrespects these and enforce the honouring for their terms of service and usage. 

flixy.dk is built/owned/run by the OP.

Cheesegeezer
Posted
4 minutes ago, DanielFrank said:

It does not have an API, but I could easily make one.

That would be cool. 

with reference to imdb and RT, you would not be able to access that information. Imdb api is very expensive and RT’s api is closed off to the general public now and only available to companies.

Do you need help setting up a plugin? I haven’t written a MetadataProvider plugin before but I’m pretty sure it’s extremely easy compared to some stuff i’ve made in the past. As its just based on retrieving info into a model and populating itemDTO.

DanielFrank
Posted
1 minute ago, crusher11 said:

flixy.dk is built/owned/run by the OP.

Yep. So, everything is possible.

DanielFrank
Posted
Just now, Cheesegeezer said:

That would be cool. 

with reference to imdb and RT, you would not be able to access that information. Imdb api is very expensive and RT’s api is closed off to the general public now and only available to companies.

Do you need help setting up a plugin? I haven’t written a MetadataProvider plugin before but I’m pretty sure it’s extremely easy compared to some stuff i’ve made in the past. As its just based on retrieving info into a model and populating itemDTO.

By all means, if you have any input or can (and will) help with anything, it would be much appreciated. First, I'd need to understand what the API should provide, so I can make it possible. That's not the hard part. It's more the Emby part I would need help with.

Cheesegeezer
Posted

Yeah i see now that you built it 😂 i should learn to read better! 

You just need C#, JS and html for plugin development.

javascript and html you certainly have covered

cheers

DanielFrank
Posted
2 minutes ago, Cheesegeezer said:

Yeah i see now that you built it 😂 i should learn to read better! 

You just need C#, JS and html for plugin development.

javascript and html you certainly have covered

cheers

The website is in fact built in ASP.NET and C#, which I understand, so that's a help!

Though I know how to build a web application, I'm unsure how to develop a plugin for Emby.

  • Agree 1
Cheesegeezer
Posted
1 minute ago, DanielFrank said:

By all means, if you have any input or can (and will) help with anything, it would be much appreciated. First, I'd need to understand what the API should provide, so I can make it possible. That's not the hard part. It's more the Emby part I would need help with.

today is Mrs.Cheeses Birthday.

i need to do some testing with updated code to VantagePoint plugin.

i also have another release to push for mediaInfo plugin which should be quick for a couple of formats that have been identified in the closed test group

And finally I’m just about to release sub-killer plugin, just finessing it at the moment, but its about 98% there.

so i can help you out with your plugin after that. What do you want to call it.

DanielFrank
Posted
1 minute ago, Cheesegeezer said:

today is Mrs.Cheeses Birthday.

i need to do some testing with updated code to VantagePoint plugin.

i also have another release to push for mediaInfo plugin which should be quick for a couple of formats that have been identified in the closed test group

And finally I’m just about to release sub-killer plugin, just finessing it at the moment, but its about 98% there.

so i can help you out with your plugin after that. What do you want to call it.

Happy Birthday to Mrs. Cheese!

This is really not an acute thing, so whenever you'd have the time we could take a look at everything.

Since the data on Flixy.dk is very specific, I think it would make sense just to call the plugin something like "Flixy.dk"

The data on the items on the website is not the generic description etc that you would look up on IMDb for instance. The data would only apply the specific item on the website - like, the physical copy. The information on the copy is not always the same on other releases.

Cheesegeezer
Posted
2 minutes ago, DanielFrank said:

Happy Birthday to Mrs. Cheese!

This is really not an acute thing, so whenever you'd have the time we could take a look at everything.

Since the data on Flixy.dk is very specific, I think it would make sense just to call the plugin something like "Flixy.dk"

The data on the items on the website is not the generic description etc that you would look up on IMDb for instance. The data would only apply the specific item on the website - like, the physical copy. The information on the copy is not always the same on other releases.

Can you provide some examples of the info that apears on the website.

i would imagine that you have set up fields such as title, synopsis, year, rating, etc these could be accessed to populate the model in the plugin and then used to create a new emby item utilising that model info. 
 

Even if you can output a json for the stored data we can convert that to model in C# very easily.
 

i will also need to check that by using the metadata Provider interface in the plugin that this then allows the user to select that provider in Emby metadata fetchers for a library. 
 

brain is just thinking about structure at the moment. I think it’s an easy one. 

DanielFrank
Posted (edited)
8 minutes ago, Cheesegeezer said:

Can you provide some examples of the info that apears on the website.

i would imagine that you have set up fields such as title, synopsis, year, rating, etc these could be accessed to populate the model in the plugin and then used to create a new emby item utilising that model info. 
 

Even if you can output a json for the stored data we can convert that to model in C# very easily.
 

i will also need to check that by using the metadata Provider interface in the plugin that this then allows the user to select that provider in Emby metadata fetchers for a library. 
 

brain is just thinking about structure at the moment. I think it’s an easy one. 

image.thumb.png.5c24ee8759feff759de8a367734bcc48.png

Fields (translated):

  • EAN-number
  • Title (Danish title)
  • Original title
  • Description (Synopsis)
  • Release year (the year the physical copy was released)
  • Playtime / length (minutes)
  • Language (spoken language)
  • Media (VHS, LaserDisc, Blu-Ray etc)
  • Genre
  • Publisher (distributor of the physical copy)

Then there's the images. There are a filepath, filename and image ID.

Also, YouTube URL, IMDb URL and Rotten Tomatoes URL.

Result: https://flixy.dk/emne/2311

The item of course gets an ID. In this case it's 2311.

Edited by DanielFrank
Cheesegeezer
Posted

Perfect, we have the majority of info. 
 

identification i think should use the imdbID between the plugin and website, so you you can add a field fir that “tt123456”.

ill get the plugin up and working and we can go from there. 

DanielFrank
Posted
5 minutes ago, Cheesegeezer said:

Perfect, we have the majority of info. 
 

identification i think should use the imdbID between the plugin and website, so you you can add a field fir that “tt123456”.

ill get the plugin up and working and we can go from there. 

That's really kind of you. Let me know if you need anything.

  • Like 1
Cheesegeezer
Posted
17 minutes ago, DanielFrank said:

That's really kind of you. Let me know if you need anything.

Really i need a url to use that identifies an item. So something like

https://api.flixy.dk/movies/{imdbID}


this would return a json for that item with all your wonderful information in.
or it could be done also by title instead of imdbID as a fallback.

Where in Denmark are you, i worked alot over there from 2010 to 2019 out of Esbjerg, but stayed in Ribe sometimes and around Billund.

 

 

DanielFrank
Posted (edited)
10 minutes ago, Cheesegeezer said:

Really i need a url to use that identifies an item. So something like

https://api.flixy.dk/movies/{imdbID}


this would return a json for that item with all your wonderful information in.
or it could be done also by title instead of imdbID as a fallback.

Where in Denmark are you, i worked alot over there from 2010 to 2019 out of Esbjerg, but stayed in Ribe sometimes and around Billund.

 

 

We can't really rely on either title or IMDb link, because the item could be added multiple times in different releases. Like these:

https://flixy.dk/emne/29
https://flixy.dk/emne/30

This is the same movie, but it's actually two different releases / distributions.

If we were to rely on the IMDb URL, we wouldn't always get the correct cover for an item within Emby, I think.

So, it would be best to ask for the item ID and get the correct item each time.

It's no problem to provide a json with the information for each item, if you need that. Then you just need to parse that in the plugin.

BTW: I live in Brædstrup, not far away from Billund 🙂

Edited by DanielFrank
Cheesegeezer
Posted
8 minutes ago, DanielFrank said:

We can't really rely on either title or IMDb link, because the item could be added multiple times in different releases. Like these:

https://flixy.dk/emne/29
https://flixy.dk/emne/30

This is the same movie, but it's actually two different releases / distributions.

If we were to rely on the IMDb URL, we wouldn't always get the correct cover for an item within Emby, I think.

So, it would be best to ask for the item ID and get the correct item each time.

the imdbid is purely to identify the item, If you can add the release version bool into to url query or if that info is returned in the json, then we know how to handle it in the plugin. All artwork will come from your site as well as the item info.

8 minutes ago, DanielFrank said:

It's no problem to provide a json with the information for each item, if you need that. Then you just need to parse that in the plugin

excellent 

8 minutes ago, DanielFrank said:

BTW: I live in Brædstrup, not far away from Billund 🙂

Not been there 

 

anyways I’m sure once the plugin gets underway that we will figure out what needs to be done. 👍👍

DanielFrank
Posted
1 hour ago, Cheesegeezer said:

the imdbid is purely to identify the item, If you can add the release version bool into to url query or if that info is returned in the json, then we know how to handle it in the plugin. All artwork will come from your site as well as the item info.

excellent 

Not been there 

 

anyways I’m sure once the plugin gets underway that we will figure out what needs to be done. 👍👍

Can you use this?

https://flixy.dk/api/item/imdb/tt2374051

(It's in XML, which I barely learned how to generate. Haven't yet learned how to work with json.)

This returns all the items where there's an IMDb url that has tt2374051 included.

There are also URLs to the right covers for each item. The first image on the list (for each item) is ALWAYS the "primary" image / cover image.

Cheesegeezer
Posted

I think in your c# side for the site you can use

using System.Text.Json

and the you can serialise the c# object .

i use this when deserialising streams. Its really super simple and i do it one line of code.

var mediaInfo = JsonSerializer.Deserialize<MediaInfoModel>(json);

the xml you provided isn’t true xml structure as it should have nodes detailing what each attribute is and its value inside.

DanielFrank
Posted
51 minutes ago, Cheesegeezer said:

I think in your c# side for the site you can use

using System.Text.Json

and the you can serialise the c# object .

i use this when deserialising streams. Its really super simple and i do it one line of code.

var mediaInfo = JsonSerializer.Deserialize<MediaInfoModel>(json);

the xml you provided isn’t true xml structure as it should have nodes detailing what each attribute is and its value inside.

Could I trouble you to examine my code and perhaps advise what I should do to return the information in json? I've installed the library System.Text.Json but all the examples I can find is mostly for .NET Core, which is haven't learned. I'm stuck at ASP.NET 4.8 for now.

Here's my code:
https://pastebin.com/jz0Hkxt7

Cheesegeezer
Posted
16 minutes ago, DanielFrank said:

Could I trouble you to examine my code and perhaps advise what I should do to return the information in json? I've installed the library System.Text.Json but all the examples I can find is mostly for .NET Core, which is haven't learned. I'm stuck at ASP.NET 4.8 for now.

Here's my code:
https://pastebin.com/jz0Hkxt7

To be honest the structure looks the same as .NET core which is what Emby uses. I’ve never played with ASP, however i can find out any differences. So you have a data table which we can access no problems. 

let me get the plugin basics up on GitHub. Do you have a GitHub account? 
 

im off out now for a lovely meal and some dancing with the Birthday girl

but i should get something up tomorrow 

DanielFrank
Posted
9 minutes ago, Cheesegeezer said:

To be honest the structure looks the same as .NET core which is what Emby uses. I’ve never played with ASP, however i can find out any differences. So you have a data table which we can access no problems. 

let me get the plugin basics up on GitHub. Do you have a GitHub account? 
 

im off out now for a lovely meal and some dancing with the Birthday girl

but i should get something up tomorrow 

Sure, it's https://github.com/DanielFrankDK

Y'all enjoy your evening. We'll talk later 🙂

  • Thanks 1
  • 1 month later...
Posted

Great, I was thinking of making just this or something similar...

My main problem with Plex and Emby is all my media is embedded with all metadata and all servers show this without be explicit or collect data with errors from imdb.

I'm from Helsingør but was some years in Tønder 🤗

DanielFrank
Posted

Hej dansker!

Yes, this is why I want to pull data from my own database, instead of some generic data from IMDb og any other database for that matter. If I pull data from my own website, I'm sure to get the exact data for the exact copies, that I own in my VHS collection.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...