MySQL insert script (CLI scraper)

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
aTTilaz Offline
Junior Member
Posts: 32
Joined: Jul 2011
Reputation: 0
Post: #1
Hi there,

Before i went off to write my own solution I thought i would see if something like this existed already. Now that I have a central XBMC MySQL database on my server I want to have a CLI script that I can pass a filename argument (like a tv episode) have it download all the relevant data and insert in the DB (same as what the XBMC client does basically). This way no xbmc client would have to scan and retrieve a new eps data, they would just exist in the DB already.

Essentially I guess it would be a CLI scraper. Anyone aware of anything like this? Sorry if this is the wrong place to post this question.

EDIT: Thought I might do it as CPAN perl module and utilize MySQL and TVDB modules to access the db and reference thetvdb respectively.

Thanks
(This post was last modified: 2012-06-12 06:49 by aTTilaz.)
find quote
Ned Scott Offline
Team-XBMC Wiki Guy
Posts: 11,878
Joined: Jan 2011
Reputation: 130
Location: Arizona, USA
Post: #2
Not that I know of, but let us know if you give this a shot, because a lot of people would be interested in it.

You can make easy links to the XBMC wiki using double brackets around words: [[debug log]] = debug log, [[Add-on:YouTube]] = Add-on:YouTube, [[Adding videos to the library]] = Adding videos to the library, [[userdata]] = userdata, etc
find quote
aTTilaz Offline
Junior Member
Posts: 32
Joined: Jul 2011
Reputation: 0
Post: #3
Thanks for your reply mate.

Yeah definately going to do it if theres nothing else like this. I already have automatic downloading of my shows via an rss feed, then have written scripts to rename and sort new content into there appropriate directories. These scripts already pull all the show data from the TVDB via its API. Would use this existing logic to get all the ep metadata and create the relevant entries in the XBMC MySQL DB. Everything done on the server completely independent of any XBMC client. Nice and neat. Just fire up one of my XBMC machines on my network and new show content already there and ready to watch.
find quote
notyjoey Offline
Junior Member
Posts: 7
Joined: Jun 2012
Reputation: 0
Post: #4
(2012-06-13 00:11)aTTilaz Wrote:  Thanks for your reply mate.

Yeah definately going to do it if theres nothing else like this. I already have automatic downloading of my shows via an rss feed, then have written scripts to rename and sort new content into there appropriate directories. These scripts already pull all the show data from the TVDB via its API. Would use this existing logic to get all the ep metadata and create the relevant entries in the XBMC MySQL DB. Everything done on the server completely independent of any XBMC client. Nice and neat. Just fire up one of my XBMC machines on my network and new show content already there and ready to watch.

Care to share the script which does your downloading? I've been using Sickbead + SABnzbd but wouldn't mind trying something a little more lightweight.
find quote
aTTilaz Offline
Junior Member
Posts: 32
Joined: Jul 2011
Reputation: 0
Post: #5
(2012-06-13 00:15)notyjoey Wrote:  Care to share the script which does your downloading? I've been using Sickbead + SABnzbd but wouldn't mind trying something a little more lightweight.

It is a torrent based solution so probably no good for you. If you are interested though, its a web frontend for Transmission i helped develop with a friend. Have a look at the following if you like:

http://sourceforge.net/projects/auto-for-trans/

Its monitors a user specified RSS feed for matches to a specified list (inclusions and exclusions), automatically downloads and sorts. Can automatically remove torrent/data at pre-determined days of seeding and days of inactivity. Sends user activty notifications via email.
(This post was last modified: 2012-06-13 00:51 by aTTilaz.)
find quote
notyjoey Offline
Junior Member
Posts: 7
Joined: Jun 2012
Reputation: 0
Post: #6
(2012-06-13 00:46)aTTilaz Wrote:  
(2012-06-13 00:15)notyjoey Wrote:  Care to share the script which does your downloading? I've been using Sickbead + SABnzbd but wouldn't mind trying something a little more lightweight.

It is a torrent based solution so probably no good for you. If you are interested though, its a web frontend for Transmission i helped develop with a friend. Have a look at the following if you like:

http://sourceforge.net/projects/auto-for-trans/

Its monitors a user specified RSS feed for matches to a specified list (inclusions and exclusions), automatically downloads and sorts. Can automatically remove torrent/data at pre-determined days of seeding and days of inactivity. Sends user activty notifications via email.

Hey now, it would save me using news groups AND I have transmission installed on my box too! I'll definitely check it out Wink
find quote
vicbitter Offline
Donor
Posts: 239
Joined: Jan 2011
Reputation: 3
Post: #7
With the latest code from head you now create a libxbmc.so shared library that can be used to create your own CLI (or server-based) XBMC applications... Smile

Here is a sample Video Library scanner application that uses libxbmc.so to update XBMCs Video Library...

http://pastebin.com/WpEvRTws

Enjoy!
find quote
jhsrennie Offline
Team-XBMC Developer
Posts: 7,237
Joined: Nov 2008
Reputation: 117
Location: Chester, UK
Post: #8
Is this possible in Windows? I can't find any XBMC.dll in the build directories.
find quote
vicbitter Offline
Donor
Posts: 239
Joined: Jan 2011
Reputation: 3
Post: #9
(2012-06-13 11:13)jhsrennie Wrote:  Is this possible in Windows? I can't find any XBMC.dll in the build directories.

I am not sure as I use Linux but the libxbmc.so is not built by default... You need to run ./configure --enable-shared-lib

Maybe give it a try on Windows and see what gets built?
find quote
aTTilaz Offline
Junior Member
Posts: 32
Joined: Jul 2011
Reputation: 0
Post: #10
(2012-06-13 10:43)vicbitter Wrote:  With the latest code from head you now create a libxbmc.so shared library that can be used to create your own CLI (or server-based) XBMC applications... Smile

Here is a sample Video Library scanner application that uses libxbmc.so to update XBMCs Video Library...

http://pastebin.com/WpEvRTws

Enjoy!

Thanks vicbitter, is there any documentation that explains this process. Not to familar with C++
find quote
Post Reply