INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Custom Video Scraper  (Read 3832 times)

smitchell6879

  • Member
  • *
  • Posts: 4
Custom Video Scraper
« on: March 22, 2021, 03:10:31 am »

I would like to create a scraper that searches a custom url, other then tmdb or etc. Where would I need to look to get started? I am pretty good with python and using api's I see that you have mcws but I don't see where I can actually edit any tags as I was hoping.

To be honest I have created my own webserver that I am hosting locally as I am tired of thetvdb changing episode names and orders. With that when I do a auto import I need to hit my localhost:port api so that I can feed a controlled metadata back to the jriver.

From reading it seem my only option would be to update the sidecar and trigger a update from them but honestly I dont want all the extra files be side my videos. So what are my options?
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Custom Video Scrapper
« Reply #1 on: March 22, 2021, 04:04:05 am »

I wrote ZRatings to fetch Movie info from TMDb and OpenMovieDb (only supports movies). It's C#, open source. It uses MediaCenter's COM API, not MCWS, but it's also possible to use MCWS to do all that. COM API is now deprecated.
https://yabb.jriver.com/interact/index.php/topic,125575.0.html

There are other tools developed by other users here using MCWS, mostly in Python. MCUtils includes PScriptor.pl, which is a tool/framework to talk to MC, including updating of tags - all you need is to fetch them from wherever source you like, then use MCUtils to write to MC:
https://yabb.jriver.com/interact/index.php/topic,100449.0.html

SwagOfTools is another one, written with AutoHotKey of all things :)
https://yabb.jriver.com/interact/index.php/topic,106802.0.html

You can use all those to see how to use MCWS, and MCWS documentation is available via MC itself. /File/SetInfo is used to write tags to a given MC db entry:
http://localhost:52199/MCWS/v1/

Search the Wiki and the Third Party Plugins topic for more options.
Logged

smitchell6879

  • Member
  • *
  • Posts: 4
Re: Custom Video Scrapper
« Reply #2 on: March 22, 2021, 05:01:01 am »

Thanks I had ran across the swag of tool but was sure if it was up to date or not. I will check out the others as well thanks.
Logged

smitchell6879

  • Member
  • *
  • Posts: 4
Re: Custom Video Scrapper
« Reply #3 on: March 22, 2021, 05:46:01 am »

So after playing with it really quickly I figured out how to get the library items and I can narrow it down by key. For a test I tried to update the description using setinfo but I got error the field does not exists. so then I thought I might have to add the field but that is not what I want either as I still am unsure how to set the value you .

Could you or anyone else out there give me a example of how to set the value as one i get the key and or file name?
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Custom Video Scraper
« Reply #4 on: March 22, 2021, 06:07:59 am »

http://localhost:52199/MCWS/v1/File/SetInfo?File=12345&Field=Description&Value=sample%20description%20text

You can see the file Keys in MC by adding an expression column with expression "FileKey()".
In code, there are several ways. For instance, you can get the currently selected file(s):
http://localhost:52199/MCWS/v1/Files/Current?Action=JSON

There are APIs to get all playlists or just a single one, then to get all files in a given playlist. There are APIs to search for files as well. All these can provide the FileKeys needed for other calls. Explore the API documentation for details.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72444
  • Where did I put my teeth?
Re: Custom Video Scraper
« Reply #5 on: March 22, 2021, 06:19:40 am »

I think you mean scraper, not scrapper.  I changed your original title.
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Custom Video Scraper
« Reply #6 on: March 22, 2021, 06:37:07 am »

Well there's an API for that too ;)
/MCWS/v1/File/Delete?File=-1
Logged

smitchell6879

  • Member
  • *
  • Posts: 4
Re: Custom Video Scraper
« Reply #7 on: March 22, 2021, 06:35:00 pm »

Thanks this is what I needed I was missing the value part of the request. I will test it out a little later tonight just to verify everything on my end. I appreciate your quick responses as well.


I have verified that it all work this is exactly what I was looking for thanks.
Logged

lepa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2033
Re: Custom Video Scraper
« Reply #8 on: March 23, 2021, 04:54:13 am »

There is also Python wrapper for MCWS API here
https://yabb.jriver.com/interact/index.php/topic,123397.0.html
Logged
Pages: [1]   Go Up