LinuxMCE Forums
May 20, 2013, 06:37:42 pm GMT-1 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Rule #1 - Be Patient - Rule #2 - Don't ask when, if you don't contribute - Rule #3 - You have coding skills - LinuxMCE's small brother is available: http://www.agocontrol.com
 
   Home   Help Search Chat Login Register  
Pages: [1]
  Print  
Author Topic: Shoutcast4LMCE - Perl script to import Shoutcast streams into LMCE  (Read 669 times)
jeangot
Guru
****
Posts: 233


View Profile
« on: February 17, 2009, 07:01:51 am »

Hello,

as promissed I made a little perl script to import Shoutcast Streams for Playback in LMCE.

WARNING!
This is one big hack, and writes directly into your LMCE Database. It is poorly tested and poorly coded, hence will possibly mess up your system. If you are not prepared to mess up your system, don't try this. Please don't ask me how to fix your database if it's broken. You have been warned!

Features:
Import Shoutcast streams by shoutcast genre, with the ability to import multiple Shoutcast genres into one LMCE genre and removing duplicates within each shoutcast genre, keeping only the highest bitrate stream for each duplicate station. Also has the ability to add generic album and performer tags for better sorting of the Shoutcast streams in the LMCE Media file browser.

Other warning:
Shoutcast does not permit the continuous querying of a large number of playlist files and will quickly block your IP address if you do so.
You should try to limit yourself to a few interesting categories, limit the number of streams per category to something reasonable and don't run the script more than once per week

The perl script needs to run on the Core. It requires the following perl packages:

XML::DOM
LWP::Simple
Mysql
List::Util

To install them, run on your core:
perl -e shell -MCPAN
Then "install nameofpackage" using the package names above including the double colon.

At the beginning of the script are a few options, including the part where you customize the Genres you want to import.

Note that shoutcast seems to limit the number of queries you can do in a given time from your IP, so when you run the script, it will stop every once in a while (when shoutcast blocks you) and then resume. So if you see it stop, just wait for a while...

Enjoy!

Jean
« Last Edit: February 19, 2009, 08:09:37 am by jeangot » Logged
posde
Administrator
LinuxMCE God
*****
Posts: 2621


Wastes Life On LinuxMCE Since 2007


View Profile WWW
« Reply #1 on: February 17, 2009, 11:58:34 am »

Line 154 looks wrong and all the other lines with tablename PK_FileFormat
Logged

jeangot
Guru
****
Posts: 233


View Profile
« Reply #2 on: February 18, 2009, 04:45:50 am »

Posde,
what do you think is wrong there? I don't see anything obvious.
Jean
Logged
posde
Administrator
LinuxMCE God
*****
Posts: 2621


Wastes Life On LinuxMCE Since 2007


View Profile WWW
« Reply #3 on: February 18, 2009, 11:28:12 am »

Are you sure, the name of the table is PK_FileFormat? Wink
Logged

jeangot
Guru
****
Posts: 233


View Profile
« Reply #4 on: February 19, 2009, 08:10:30 am »

Posde,
thanks. I corrected it and updated the script attached to my initial post.
That was precisely the part that was never tested since I had done these changes manually on my DB :-)

Jean
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!