Stuck on Streamripper

Events happening in the community are now at Drupal community events on www.drupal.org.
skyl1ne's picture

I have read the documentation, but it is still not clear to me how, or if it is even possible, to install Streamripper on a shared hosting service e.g. Dreamhost.com If so, can someone point me to a step-by-step install procedure. Thank you.

Comments

I think you'll have a hard

drewish's picture

I think you'll have a hard time of that. You'd need to figure out what platform they're running on and then locate a precompiled binary or compile it yourself.

Does Streamripper have to be complied on the server?

skyl1ne's picture

Dreamhost.com runs on Linux. I was thinking I could compile the tar ball om my local machine and then upload it to the server. Do you think that might work? If I cannot access user/local/bin/ , what about uploading it into another directory that I have permissions i.e. inside or outside www?

you'd have to put it in your

drewish's picture

you'd have to put it in your home directory or some other place where you have write access. it should work. it all depends on if you're able to compile it on a similar enough machine.

I keep at it, but cannot get past this 404 error

skyl1ne's picture

[catalina]$ php /home/.irons/skyline/republicnetwork/modules/station/archive/scripts/ripper.php

Status: 404
X-Powered-By: PHP/4.4.4
Content-type: text/html

No input file specified.

I compiled streamripper on the server in my home directory outside of the Drupal install and made the changes to the ripper.inc file as per the Install file.

Any help would be appreciated.

Station/Streamripper Install revisited

skyl1ne's picture

For those having problems installing the station module, take a look at:

http://drewish.com/node/29

It took awhile, with a lot of trial and error, but it was a big help in getting the module operational.

yeah, i posted that in this

drewish's picture

yeah, i posted that in this group a while back: http://groups.drupal.org/node/1822

I had trouble compiling

wrybread's picture

I had trouble compiling Streamripper from source on Dreamweaver, but got it solved, thought I'd post how I did it since this discussion was all I found when I googled it:

downloading an older version of Streamripper, since the new one

errored out saying glib was too old

wget http://downloads.sourceforge.net/streamripper/streamripper-1.62.3.tar.gz

gunzip stream*
tar -xvvf stream*
cd stream*

Adding this prefix line got rid of some write errors I was getting.

The folder lib is in my path. Obviously, I'm not root, I'm user "jaqueshaas".

./configure --prefix=/home/jaqueshaas/lib

make
make install

chmod 755 streamripper

Modifying station.module for remote ripping audio files

mattrock's picture

WSUM.NET is hosted at Dreamhost. When I was initially setting up the site, I did successfully compile and run streamripper on my Dreamhost account [which is running Debian]. I opened up a ticket with Dreamhost to make sure that I wasn't putting unnecessary load on the shared server. They responded by saying that if the streamrip process took up too much CPU time, the process would get throttled. While my initial trial was successful and I ran everything @ Dreamhost for several days, I didn't like the idea of getting the process throttled because a neighbor account on the same server all of a sudden got slammed.
Mr. Drewish has built the module so that a second install of Drupal in a different location can do all of the archiving and pull the schedule info via XML-RPC from the public install. This is how he has KPSU and KPSU's Archive set up. This involves maintaining two separate sites with the same theme because a client actually browses the archive on the second install.
WSUM.NET is set up a little different. Since Dreamhost offers a lot of file space, I am ripping the files on the secondary install of Drupal in the station, but then I post the ripped file to an import folder at Dreamhost at the end of the hour. It then get's imported by Drupal cron and lives on the Dreamhost site. This prevents us from being at the mercy of the other sites on the shared server. Plus, this takes all ongoing traffic with respect to the archive files off of our station net connection, which is limited.
I achieved this by modifying the ripper.php and ripper.inc files in the station.module on the Drupal install at the station. Since I use CVS to update the Drupal and module code, my changes are preserved with every update to the module. The changes involve taking the fresh ripped file and uploading it to dreamhost before the archiving install of Drupal imports the file into it's own environment. Here is the patch file for the ripper.php file:

--- ripper.php  2007-02-01 09:29:27.000000000 -0600
+++ ripper.mod.php      2007-02-01 09:32:23.000000000 -0600
@@ -50,6 +50,24 @@ $length = ($endTime - time()) + (int) $s
$stream_url = $settings['stream_url'];
exec("{$streamripper} {$stream_url} -s -d {$import_dir} -A -l {$length} -a {$startTime}.mp3 --quiet");

+//  Modified by MattRock 9/22/06
+//  Add function to copy the audio file up to the wsum.net ISP
+
+$REMOTE_site = $settings['REMOTE_site'];
+$REMOTE_user = $settings['REMOTE_user'];
+$REMOTE_pass = $settings['REMOTE_pass'];
+$REMOTE_folder = $settings['REMOTE_folder'];
+
+$REMOTE_connect = ftp_ssl_connect($REMOTE_site);
+
+ftp_login($REMOTE_connect, $REMOTE_user, $REMOTE_pass);
+ftp_put($REMOTE_connect,"$REMOTE_folder/{$startTime}.cue","{$import_dir}/{$startTime}.cue", FTP_BINARY);
+ftp_put($REMOTE_connect,"$REMOTE_folder/{$startTime}.mp3","{$import_dir}/{$startTime}.mp3", FTP_BINARY);
+ftp_delete($REMOTE_connect,"$REMOTE_folder/{$startTime}.cue");
+ftp_close($REMOTE_connect);
+
+// End MattRock mods
+
// stream ripper creates the .cue file. we'll use its absence as a signal
// to the module that it's safe to import a file.
$cuefile = "{$import_dir}/{$startTime}.cue";

Once that is done, you will need to modify the ripper.inc file to put in all of your locations and such. Here is what I added to the end of the ripper.inc file;
// Added by MattRock to post to remote site

REMOTE_site = "wsum.net"
REMOTE_folder = "sites/wsum.net/import"
REMOTE_user = "[dreamhost login]"
REMOTE_pass = "[dreamhost pass]"

On the drupal install at dreamhost, I have drupal installed in a root folder in my home directory and then I have the sites directory moved out of the drupal folder to the root folder since there is so much work done in the sites folder. Next, set the archive folder in the /admin/settings/station/archive config page to the folder you are posting to, and voila! The Dreamhost site will now import the file as soon as the .cue file has been deleted. I set wsum.net to run cron at 25 minutes after the hour which usually gives our limited uplink enough time to get the file up.
Back on the station install of Drupal, I have a much longer retention rate (8 weeks) than what is legally allowed on the public site (2 weeks). This site is restricted to intranet IP's only for access, and additionally, the final directory where Drupal stores the renamed and archived files is shared via SMB to the station file system. This makes getting access to archived show files a lot easier in house.
I happen to have the station install of Drupal running on the same machine which is encoding and sourcing the webstreams. This machine has Icecast2, Darkice installed to rip our analog output from the Orban Optimod. This machine uses an M-Audio Delta 1010 to convert the analog audio to digital. Darkice then creates the .mp3 streams for Icecast2. We do use separate relay machines with just Icecast2 installed to serve the streams. This is all in an effort to minimize the local net traffic due to our precious uplink bandwidth.

Incidentally, Dreamhost provides free hosting to non-profits. It's not their lowest level of offerings, either.

Hey Matt, I couldn't talk

drewish's picture

Hey Matt, I couldn't talk you into writting that up as a handbook page under the station module handbook could I?

No problem. Do you think

mattrock's picture

No problem. Do you think the mods should be incorporated into the module permanently? The first issue I think that may come up is how to make the password for the SCP connection secure, and then it may be tweaked to allow switching between SCP and FTP posting method.

Separate script maybe

drewish's picture

I'd be into adding it as a separate script because it really targets a different audience. But yeah, some way of obscuring the password would be good. Can it use private keys for authentication?

Radio

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: