need help with getting TV fanart to my scraper - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Scrapers (https://forum.kodi.tv/forumdisplay.php?fid=60) +--- Thread: need help with getting TV fanart to my scraper (/showthread.php?tid=158232) |
need help with getting TV fanart to my scraper - meathook2 - 2013-03-03 I want to get Fanart backgrounds for TV shows I scrape with my custom scraper in <GetDetails>. I have the IMDB title ID. Can someone post a regexp code that will do the job? RE: need help with getting TV fanart to my scraper - scudlee - 2013-03-03 You could probably do via two functions. First, use the IMDb ID to have a custom function fetch GetSeriesByRemoteID from tvdb. e.g. Code: <url function="GetTVDBid">http://www.thetvdb.com/api/GetSeriesByRemoteID.php?imdbid=tt0411008</url> e.g. Code: <details><url function="GetFanart">http://www.thetvdb.com/api/1D62F2F90030C444/series/73739/banners.xml</url></details> RE: need help with getting TV fanart to my scraper - meathook2 - 2013-03-04 Ok, so what should the final xml look like in order for the background to appear in XBMC? like this? <Banner> <id>89141</id> <BannerPath>fanart/original/73739-34.jpg</BannerPath> <BannerType>fanart</BannerType> <BannerType2>1920x1080</BannerType2> <Colors>|148,149,153|13,23,22|165,159,137|</Colors> <Language>en</Language> <Rating>7.5758</Rating> <RatingCount>33</RatingCount> <SeriesName>false</SeriesName> <ThumbnailPath>_cache/fanart/original/73739-34.jpg</ThumbnailPath> <VignettePath>fanart/vignette/73739-34.jpg</VignettePath> </Banner> RE: need help with getting TV fanart to my scraper - scudlee - 2013-03-04 You need it to look like: Code: <details> RE: need help with getting TV fanart to my scraper - meathook2 - 2013-03-04 Thanks! RE: need help with getting TV fanart to my scraper - meathook2 - 2013-03-04 I'm having trouble getting the TVDB ID into: <details><url function="GetFanart">http://www.thetvdb.com/api/1D62F2F90030C444/series/$$20/banners.xml</url></details> I'm trying to populate buffer 20 before with the "GetTVDBid" function but the buffer is empty for some reason. In xbmc.log I see the "GetFanart" function call but not the "GetTVDBid". Here's the relevant xml code I'm using: http://pastebin.com/TQKLsaXL RE: need help with getting TV fanart to my scraper - scudlee - 2013-03-05 You have to remember the order in which the functions are processed, compared to when the buffers are substituted in. GetTVDBid (and GetFanart) won't be run until after GetDetails has returned, so of course $$20 will be empty because it hasn't been filled yet. What I was suggesting above was to have GetTVDBid return the call to GetFanart. And remember each function as a whole needs to return a <details>...</details> block, you don't need to wrap each call to a function in them. (The reason I put them around the call to GetFanart was because it was meant to be the complete output of GetTVDBid.) RE: need help with getting TV fanart to my scraper - meathook2 - 2013-03-05 Well, now in xbmc.log, I see the call to the chain function "GetThumb" but i don't get the output from it after that. I also tried to put the input directly without an expression: <GetFanart dest="17" clearbuffers="no"> <RegExp input="$$17" output="<details><fanart url="http://thetvdb.com/banners/">\1</fanart></details>" dest="17"> <RegExp input="$$1" output="<details><chain function="GetThumb"><Banner><id>888699</id><BannerPath>fanart/original/253463-2.jpg</BannerPath><BannerType>fanart</BannerType><BannerType2>1920x1080</BannerType2><Colors/><Language>en</Language><Rating>8.1667</Rating> <RatingCount>6</RatingCount><SeriesName>false</SeriesName><ThumbnailPath>_cache/fanart/original/253463-2.jpg</ThumbnailPath><VignettePath>fanart/vignette/253463-2.jpg</VignettePath></Banner></chain></details>" dest="17"> <expression noclean="1"/> <!--<expression noclean="1"><banner>(.|\r|\n)*?</banner></expression>--> </RegExp> <expression noclean="1"/> </RegExp> </GetFanart> by the way, with this expression in "GetFanart": <expression noclean="1"><banner>(.|\r|\n)*?</banner></expression> I don't get any results although it does match the contents of "http://www.thetvdb.com/api/1D62F2F90030C444/series/253463/banners.xml" when I search it in Notepad ++. Why is that? RE: need help with getting TV fanart to my scraper - scudlee - 2013-03-05 You're making this more complicated than it needs to be. 1. In GetDetails: Code: <RegExp input="$$1" output="<url cache="TVDBid-\1.xml" function="GetTVDBid">http://www.thetvdb.com/api/GetSeriesByRemoteID.php?imdbid=\1</url>" dest="4+"> 2. GetTVDBid: Code: <GetTVDBid dest="4"> 3. GetFanart: Code: <GetFanart dest="4"> (Disclaimer: Not actually tested.) RE: need help with getting TV fanart to my scraper - meathook2 - 2013-03-05 Thanks! worked. |