Old 28th May 2014, 06:21   #1
dopelabs
Major Dude
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 531
Send a message via AIM to dopelabs
Shoutcast Stream Ripper Prevention / Title Flipper

this is a bash shell script that will get the current title from your shoutcast server, change it to the specified title, and then change it back. this will work for both v1 and v2 dnas.

many stream rippers are configured by default to create a new file when the title changes or by using silence detection. by change the song title at specified intervals, this would in-turn create a bunch of separate recordings on the rippers hard drive. the filenames would be the same as the text you set in the configuration, so this can also serve as a personal note to the people stream ripping when they see all these new files named "whatever-you-put-in.mp3, whatever-you-put-in-01.mp3, whatever-you-put-in-02.mp3, whatever-you-put-in-03.mp3" and so on. (teehee)

this script can also be used as a promotional tool by using titles such as "sunday sunday sunday!" or "new stuff out now go here and give me money" or "anything you want to 'display' to the listener".

** after looking at the docs for reference when i was writing this i apparently forgot about many things... i will be adding more functionality, such as getting the next/upcoming song title to use for the flip. (basically any function supported by the shoutcast dnas via http requests).


https://github.com/dlnetworks/sc-ripflip

code:

#!/bin/bash

#################################
## http://github.com/dlnetworks/sc-ripflip ##
#################################
## aggravates rippers by changing the title as ##
## many rippers write new files on title change ##
#################################



################
## start configuration ##
################

## DNAS version (1 or 2)
scv="2"

## stream id (DNAS V2 only)
sid="1"

## DNAS password
passwd="dnas-admin-pass"

## hostname or ip address
host="stream.domain.com"

## enter port (if you dont have a port use port="80"
port="8000"

## what to change the title to
title="station name or promo text or any text"

## seconds to wait before changing back
waittime="1"

## seconds to sleep before repeating
sleeptime="30"

#############################
## end configuration # do not edit the rest ##
#############################



sc1url="http://$host:$port"
sc2url="http://$host:$port"
tmptitle="$(echo "$title" | sed 's/ /%20/g')";

while true
do
if [ "$scv" = "1" ]
then
sc1current="$(curl -s -A "$agent" "$sc1url"/7.html | cut -d',' -f 7- | cut -d'<' -f -1)";
sc1string="$(echo "$sc1current" | sed 's/ /%20/g')";
curl -s -A 'Mozilla/sc-ripflip' "$sc1url/admin.cgi?mode=updinfo&song=$tmptitle&pass=$passwd";
echo "Title set to: $title"
sleep "$waittime"
curl -s -A 'Mozilla/sc-ripflip' "$sc1url/admin.cgi?mode=updinfo&song=$sc1string&pass=$passwd";
echo "Title returned to: $sc1current"
else
sc2current="$(curl -s -A "$agent" "$sc2url"/currentsong?sid=$sid | cut -d',' -f 7- | cut -d'<' -f -1)";
sc2string="$(echo "$sc2current" | sed 's/ /%20/g')";
curl -s -A 'Mozilla/sc-ripflip' "$sc2url/admin.cgi?sid=$sid&mode=updinfo&song=$tmptitle&pass=$passwd";
echo "Title set to: $title"
sleep "$waittime"
curl -s -A 'Mozilla/sc-ripflip' "$sc1url/admin.cgi?sid=$sid&mode=updinfo&song=$sc2string&pass=$passwd";
echo "Title returned to: $sc2current"
fi
sleep "$sleeptime"
done

dopelabs is offline   Reply With Quote
Old 28th May 2014, 18:51   #2
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 3,007
Send a message via Skype™ to thinktink
I was thinking about writing a Winamp plugin for the SHOUTcast DSP users that would do something similar except through the DSP, but then I realized it might render the W3C logs useless. I would have used it since I didn't use the W3C logs but others do. Do you have a method for cleaning the W3C logs up from the metadata mangle?
thinktink is offline   Reply With Quote
Old 28th May 2014, 18:52   #3
dopelabs
Major Dude
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 531
Send a message via AIM to dopelabs
im not sure exactly what your referring to.. metadata mangle? =]
dopelabs is offline   Reply With Quote
Old 28th May 2014, 18:56   #4
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 3,007
Send a message via Skype™ to thinktink
http://wiki.winamp.com/wiki/SHOUTcas...W3C.29_Logging
thinktink is offline   Reply With Quote
Old 28th May 2014, 19:01   #5
dopelabs
Major Dude
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 531
Send a message via AIM to dopelabs
yea i know what the w3c log is... so what about it?
dopelabs is offline   Reply With Quote
Old 28th May 2014, 19:08   #6
DrO
 
Join Date: Sep 2003
Posts: 27,873
if you keep changing the titles and all that, it effectively makes the w3c file a whole load of junk and pisses off the reporting authorities who use it. and it can also play havoc on 3rd party control panels who use such things to track listener stats, etc for you.

and yes messing around with titles may make your stream(s) less prone to being scrapped, but a constantly changing stream title from a user view point is one of the most annoying things (especially if Winamp is setup to show the notifier on title changes - i've seen some streams where it effectively prevents that from being not in view).

yes do something to try to mitigate the issue, but screwing over legitimate users is worse imho (and i've never understood some people who perpetually ban users just because they seem dodgy with no proof (and having had to deal with user complaints about it - as SHOUTcast gets the blame for such things - i'm saying that it might do good for some people's karma, but it screws over real users).
DrO is offline   Reply With Quote
Old 28th May 2014, 20:21   #7
dopelabs
Major Dude
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 531
Send a message via AIM to dopelabs
ok this should be a pretty easy one. the user agent is set with the string Mozilla/sc-ripflip

you can just run the following command to remove every line containing 'sc-ripflip' from 'sc_w3c.log'

code:

$ sed --in-place '/sc-ripflip/d' sc_w3c.log

dopelabs is offline   Reply With Quote
Old 30th May 2014, 08:20   #8
voodoohippie
Senior Member
 
Join Date: Jun 2009
Location: Elizabeth City, NC
Posts: 214
Send a message via Yahoo to voodoohippie
Instead of swapping back and forth what about waiting till 50 seconds before the song ends then change the title to something promoting your station? This was what I do and I don't go back and forth because of the royalty reporting provider I use. I'm afraid you'd have to use a piece of Radio automation software that will do this. The shoutcast script could somehow check a database for the song length and then 50 or maybe 30 seconds before its over change the title. The rippers will never rip the entire song similar to what I've talked about in the past. I'm afraid it wuld take a whole new Shoutcast DNAS if you wanted to handle it at the DNAS level.

Great Broadcasting Software Windows XP/7/8
http://nextkast.com

For Progressive Rock, Classic Rock http://thelegacy.shorturl.com
voodoohippie is offline   Reply With Quote
Old 30th May 2014, 08:31   #9
dopelabs
Major Dude
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 531
Send a message via AIM to dopelabs
some basic file info like size and bitrate is all you need to calculate the length and wait for *seconds then execute
dopelabs is offline   Reply With Quote
Old 31st May 2014, 17:04   #10
voodoohippie
Senior Member
 
Join Date: Jun 2009
Location: Elizabeth City, NC
Posts: 214
Send a message via Yahoo to voodoohippie
So if I understand you correctly your saying that changing the title 30-50 seconds before the song ends won't deter StreamRoppers as they may use an Audio fingerprint system similar to how Winamp tags songs and that the streamRipper would wait till the calculated length is over before changing the file name and disconnecting from people's Radio stations?

Well I should have thought about that one your one up on me there. What you'd have to do is 2 things and I would not recommend the first proposal I am about to bring up. Cinivia (an anti piracy method used to mute the Ps3 when you attempt to play a Pirated movie identifies that it is Pirate and mutes the sound. If you could generate tones just beyond human hearing you could damage the sing ID fingerprint reader however this would do two things. 1 screw over the users who want to use Shazam to identify songs and two cause distortion lowering your audio quality. Or you could generate a little hiss (cassette tape hiss) again lowering the audio quality. If you must do something like Cinivia (only not to mute but to screw up Audio fingerprinting I'd go with the ultrasonic method. There is a dog whistle app where you can adjust the ultra sonic frequency. Either you'd plug your Android into your mixer leaving the ultrasonic tone run 24/7 or re encode every one of your songs with the ultra sonic signal. But some stream rippers may not even depend on audio fingerprint but metadata. To bad the royalty licensing companies won't allow you to ID your songs like this?

A*C* D*C - B*A*C*k**I*N**B*L*A*C*K this would screw up the rippers ability to recognize file names by Metadata and together with the fingerprint screw up signal you would have the perfact station that could kill some rippers. The *'s could even crash them.

Great Broadcasting Software Windows XP/7/8
http://nextkast.com

For Progressive Rock, Classic Rock http://thelegacy.shorturl.com
voodoohippie is offline   Reply With Quote
Old 1st June 2014, 12:58   #11
neralex
Major Dude
 
Join Date: Mar 2011
Posts: 576
I think this way is not the best solution. Because i have a techno radio where only dj-sets are in the playlists with a la playtime bigger than 60 minutes per file. I have on the website a listing with the next and the last played files. If i would use this script it would flood my listing with wrong id3-titles and the users can't follow the listing. That would be against the whole idea of the next/last tracks in shoutcast, it would also flood the log files.

Better would be a option inside the DNAS to ban user-agents with a database of known user-agents of stream rippers. So it would be possible for shoutcast-admins to manage the database (add/delete/change).
neralex is offline   Reply With Quote
Old 3rd June 2014, 11:01   #12
dopelabs
Major Dude
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 531
Send a message via AIM to dopelabs
please note that this is and most likely will not be the 'best' solution for everyone. please understand the risks involved.

neralex: http://forums.winamp.com/showpost.ph...2&postcount=22

there is a link to a php script that will ban user agents against a list you specify
dopelabs is offline   Reply With Quote
Old 3rd June 2014, 21:21   #13
voodoohippie
Senior Member
 
Join Date: Jun 2009
Location: Elizabeth City, NC
Posts: 214
Send a message via Yahoo to voodoohippie
I'd ban all winamp 5.0 listings. Most streamrippers use 5.0 I know this from Downloading them and experimenting with them on my own station. 5.0 agents need banning immediately. What would be cook os to modify the D.N.A.S to point to an intro file that you can use a voice recorded and say "I'm sorry but older Winamp agents are NOT allowed or compatible with this station. Also be sure to ban iTunes 4.x agents as well. iTunes is now using V11.x so anything earlier than 9.x I'd ban altogether.

Great Broadcasting Software Windows XP/7/8
http://nextkast.com

For Progressive Rock, Classic Rock http://thelegacy.shorturl.com
voodoohippie is offline   Reply With Quote
Old 4th June 2014, 01:57   #14
dopelabs
Major Dude
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 531
Send a message via AIM to dopelabs
that sounds like a terrible idea.. the idea is to attract listeners and support as many players as possible. make tuning in a transparent experience for the listener. in an ideal world, one should not have to worry what version/app/etc they are using... all that should be needed is...

click... audio.
dopelabs is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Shoutcast > Shoutcast Discussions

Tags
radio tools, script, stream ripper, title change

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump