Tinkering with TMDB 2.1 API scraper - need help.

Need help with search functionality.
Hi guys, I've been fiddling around with the TMDB 2.1 API scraper. I can get it to parse the search results and Info results fine. What I am trying to do is narrow down the search results based on the release year of the movie by supplying the year within the search. I'm not that great with the XML layout in the scraper and can't find any details online as to how to pass the year through as part of the search.

It seems it's been dropped from the filename when I trigger a scrape.

E.g. Say I have a file name "The Karate Kid (2010).avi", all that is passed to the search is "The Karate Kid" and the first result in the list is the original from 1984. The other results are there when I do a 'Refresh' myself but when initially scraped, some movies have incorrect info associated with them.

When in the XML can I munged the filename being sent so that I can include the year? Am I just not seeing it, or is the filename fudged before it gets sent to the scraper?

Thanks in advance.
Steve

It is certainly possible for a scraper to include the year in a search as the IMDB.com scraper does this. However when I wrote my Amazon scrapers I saw the same as you in that the year was stripped off and the scraper documentation did not cover this at all. In my case for my Amazon scrapers I did not want to include the year anyway as this confuses the Amazon website.

So the best I can suggest is that you have a close look at the XML code for the IMDB.com scraper and see if you can work out how it is doing it.


Hi John, thanks for the reply. I've been tinkering with both scrapers (IMDB and TMDB) trying to figure this out. Where is the scraper documentation you speak of? I've been looking everywhere for anything related to these but can't find anything.

I'll continue fiddling and see if I get anywhere.

Cheers
Steve

The Plex Wiki does not appear to cover this, but you need to remember that Plex is originally based on XBMC and version .8 of Plex still currently uses the same scraper system as XBMC. I therefore used the documentation from the XBMC site. My Amazon scrapers actually work in both Plex and XBMC (with a very slight tweak).

See the following

http://wiki.xbmc.org/index.php?title=Scrapers
http://wiki.xbmc.org/index.php?title=HOW-TO_write_Media_Info_Scrapers_(the_complete_dummies_guide)
http://wiki.xbmc.org/index.php?title=Regular_Expression_(RegEx)_Tutorial
http://forum.xbmc.org/showthread.php?t=36422

I have not checked these for changes for a while, but when I originally looked at them they did not appear to discuss the year issue. (Don't get confused with scraping the year of a film from an already found result.)


Thanks heaps for that John. After reading the **complete dummies guide** I came across this line in the GetSearchURL section:



As you can see, Plex itself strips the year off the file and all other media related info before it even gets to the scraper so I can't do much at all with it.

I guess we just wait for Plex 0.9 then.

Thanks again for your help with this.

Cheers,
Steve


The above does not specifically say it strips the year but my experience when writing my Amazon scraper was that it did. However my experience is also that the IMDB scraper does use the year to do searches and is the whole reason why you are supposed to name files/folders with the year included. I did not spend enough time looking at the IMDB script to work out how it is doing it.

I would regard it as a bad idea, but you could in theory edit the RegEx used by Plex/XBMC to 'clean' the name before it hits your scraper and stop it there.

You could post a scraper development question in the XBMC scraper developer forum. They have been helpful to me in the past. Just don't mention Plex ;)