XBMC Community Forum
Implementing XBMC scrapers into my C++ project - Printable Version

+- XBMC Community Forum (http://forum.xbmc.org)
+--- Thread: Implementing XBMC scrapers into my C++ project (/showthread.php?tid=98135)

Implementing XBMC scrapers into my C++ project - SM_Sith_Lord - 2011-03-30 21:41

I am making a multiplayer 3D media browser that launches moves, games, and anything else. It is designed to utilize the player's local XBMC library, if it exists, to find artwork images and information about media items.

I would like to add data scrapers so that my program can find URLs to artwork and stuff automatically. I want it to be able to use the exact same XML scrapers that XBMC uses.

This is important for the users of my program who do NOT have an established media library due to XBMC.

My program already has libcurl implemented and uses it to download the artwork. I am not a very experienced programmer, and figuring out where to start on these types of things seems to be the biggest draw back from being inexperienced.

I've been looking at the source code on github for addon/scrapers.cpp, and it is pretty intimidating.

Do you guys have any general suggestions on how I should go about making my program use XBMC scrapers?

I know it's not going to be easy, but not having to manually specify the artwork for EVERY media item is going to make my program a lot more enjoyable.

I'm currently working on the 2nd version of it, but the SINGLEPLAYER-ONLY beta 1 version is available at http://www.smarcade.net


- jmarshall - 2011-03-31 00:25

Basically you'd have to rip out only the bits in Scraper.cpp that do the actual scraping (eg the pieces that grab common scraper functions and assemble the final XML that defines the full scraper), plus ScraperUrl.cpp and any dependencies it has (it'll depend on tinyxml, stdstring.h, CFileCurl and CRegExp - all of which could be replaced without much effort with whatever xml, string, http and regexp libraries you are using).

Then, the high-level routines are in VideoInfoLoader.cpp and MusicInfoScraper.cpp etc.

Again, you won't need all of these files - just follow it through and you'll see they just make calls into CScraper(Url).

EDIT: Remember that if you use any XBMC source code then you must follow the GPLv2+.


- SM_Sith_Lord - 2011-03-31 18:33

Hmmm, alright. Thank you for the guidance. Looks like I am not going to be disappointed at how hard it is going to be to scrap info off of the internet.

On a side-note (concerning the use of XBMC code), I have written a C++ equivalent to the C# function given at: http://wiki.xbmc.org/index.php?title=Thumbnails#Sample_Code

This was required in order to produce the same hashes as XBMC does (which is needed to locate artwork inside of XBMC's library folders). So far, this is the only XBMC-related code I have included in my project. I just want to make sure that this alone would not lock me into using the GPLv2+ license.

- spiff - 2011-03-31 18:35

it's your code, doing something general that we did not invent. it's fine.