No Head-Less Server needed; just a stand-alone Scraper
#1
Not trying to create any controversy; but I was thinking a while back about how nice it would be if there was a head-less version (server) of XBMC that could be run on the background on one of the storage server; so that any library update did not depend on one of the clients being up and running...
But yesterday I realized that is NOT needed (at least on a setup where the library is managed by a MYSQL database and the thumbnail and other graphic metadata is stored on a shared folder).
Under these circumstances ALL that is need is a simple mechanism to scrape the metadata (by querying the appropriate remote APIs) , add the metadata for any new (added) media to the database, and download and save the new graphic metadata (thumbnails, etc) tot eh appropriate shared folder.

In short, what would be needed is a simple, stand-alone scraper...something that is far easier to code than a head-less server.

Any takers?
#2
Sorta..... kinda.... but doesn't write to the db as far as i know.

pxXBMCscrape

Actually now that I think of it it, the above is just more of a command line media manager
#3
@helta,
Think about this: Without even looking at the actual code, I can pretty much describe the process
a) A list of media source is described in the sources.xml file

b) Additionally, each media sources is defined as either a repository of Movies, TV Shows, Music Videos, Music, etc. so that a recursive search within each media source will treat any folder/files found as one of the predefined media type

c)XBMC begins scanning each media source; based on pre-determined RegExps it will extract the media title, then query the appropriate remote API (IMDB, TMDB, etc) and grab the needed metadata (text, graphics, etc)

d)Based on the AdvancedSettings.xml it knows if it has to save this information to a central or a local Database

e)It parses the information and stores it accordingly (text metadata on database, thumbnails on shared folders, etc)

Knowing this, I see no reason a script cannot be written to do the same, using the same information as the XBMC client and performing the same task as the XMB client...
#4
There are some unofficial hacks which do just this, but there's no general support for it so builds then to brake all the time.
#5
@negge,
Do you have any links to these unofficial hacks...?
#6
Check this topic: xbmc minified as a server?
#7
Stick OpenELEC (or Raspbian/Xbian) on a headless Raspberry Pi, power it off a spare USB port, problem solved.

This solution gives you full library scanning and database update capability, plus JSON support without which database management on a headless setup is much less practical.

Sure, the Pi is slow but after the initial library creation scan (which you can run on a more powerful system) subsequent incremental updates are much faster (a few minutes tops, usually a few seconds when adding new tvshow episodes).

Using a regular XBMC build also means that keeping up to date with new releases is no longer a concern.

$35 for a Pi and SD card, or a janky database script that isn't updated as often as XBMC itself so causes version incompatibilities or worse, data corruption?

In the absence of an officialy supported headless (minified) XBMC build, for the convenience and peace of mind I'd choose the Pi option every time (or similar solution - other hardware is available etc.).

If you can't afford/justify the extra hardware and are prepared to accept the risks inherent in a solution that attempts to replicate XBMC and which must remain in lock step with your XBMC clients to avoid data corruption, then sure, a third-party db update script could work, in theory at least...

Would it be worth all the bother of developing such a script, and then the continued never ending maintenance to match each newly introduced XBMC db feature/bug fix? Probably not, IMHO.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
#8
Frankly I think the scraping functions should be ripped out of the xbmc binary and put into python scripts, like in mythtv. these often need updating as website apis change. They could also run anywhere, including your headless server.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
#9
They already are. Check out the metadata add-ons.
#10
So will they run without xbmc running?
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
#11
no, they needs lots of stuff from xbmc.
#12
Actually I found a work around for your problem. Or at least something that gives you the same basic effect. Not sure about "headless" but somebody can probably point to an equivalent tool.

I run a number of XBMC setups around the house across a variety of platforms that all talk to a centralized server. That runs MySQL for the DB and Samba to share all the files.

I add stuff via the "From local .nfo" files when adding movies and TV shows. I use TVRanamer for the tv and Media Companion for the movies. TVRenamer will generate .nfo files and grab the thumbnails and store them with the files as well as renaming them. Media Companion does the same thing with the movies (I know it does TV Shows, but I like TVRenamer and am used to it).

Anyway, this effectivly does all the scraping "offline" as XBMC then uses the .nfo files for all of the information. It still has to scan them in but it doesn't have to scrape websites or anything. That is already done by the other tools.

I'd love to find a linux command line tool that does this but I don't know of one. At any rate, the point is that you don't need anything special in XBMC to get the effect you want.
#13
You still need to run the xbmc scraper to get the downloaded .nfo and pics into the database.

filebot has a command line interface and runs on linux. It can download subtitles and artwork as well as renaming. I am not sure about other metadata like plot etc (ie the contents of the .nfo) but I just use it for renaming and let xbmc do the scraping.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
#14
The reality is that externalising the db/scanning scripts is really only one part of the solution.

What about running addons that augment artwork/metadata post scan? Or using JSON to maintain the library, artwork or addons?

I fully automate my scans, both movies and tvshows, using JSON but also using addons such as Artwork Downloader to find artwork not currently in my library (which is then saved locally, using JSON, and any remote artwork replaced with local versions).

Once you start looking at the functionality of XBMC, a regular build of XBMC running headless on low cost/low power hardware (until a fully supported "minified" build becomes available) is the only practical, dependable solution as it offers all of the standard functionality in a properly supported package.

Once you start cherry picking XBMC functionality, the list doesn't have to grow very long before you realise you may as well have stuck with a regular build of XBMC from the outset that offers all the functionality you need now and maybe tomorrow.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
#15
I just run Ubuntu 12.04 Desktop [64-bit] with XBMC installed on a virtual machine. Its the same virtual machine that hosts my MySQL and Squid servers.
Check Out My 5 User XBMC Tutorial
If i have helped you please REP+

Logout Mark Read Team Forum Stats Members Help
No Head-Less Server needed; just a stand-alone Scraper2