Go Back   Winamp Forums > SHOUTcast > SHOUTcast Technical Support

Reply
Thread Tools Search this Thread Display Modes
Old 13th July 2009, 08:08   #1
toretto
Junior Member
 
Join Date: Jun 2009
Posts: 14
Geo looking

Hello to all,

I'm studying to make a geo look listeners in shoutcast to a determinate country but how I configure the file conf? I not know how work.

Thank you.
toretto is offline   Reply With Quote
Old 13th July 2009, 08:25   #2
Sawg
Forum King
 
Join Date: Jun 2000
Location: Phoenix, AZ
Posts: 7,451
Send a message via ICQ to Sawg Send a message via AIM to Sawg Send a message via Yahoo to Sawg
SHOTUcast doesn't support such feature, so there is nothing in the conf file to configure.

| Brought to you by ^V ^C |
Sawg is offline   Reply With Quote
Old 13th July 2009, 14:44   #3
toretto
Junior Member
 
Join Date: Jun 2009
Posts: 14
How this services provide this feature? I need to geo look to a determine country my listeners.

Thank you.
toretto is offline   Reply With Quote
Old 13th July 2009, 16:49   #4
dotme
Moderator
 
dotme's Avatar
 
Join Date: Feb 2005
Location: USA
Posts: 3,994
Shoutcast doesn't have any pre-emptive capability to Geo-Lock. Best you can do is write a PHP script of some kind that periodically downloads the XML file, parses the IPs connected, looks them up, and then kicks the ones that are not in the location you want to stream to. It's a lot of work.

There are, however, some stream hosting companies that have done the legwork on this already. If spending a little on hosting isn't a problem, you might find solutions there and that would save a lot of coding etc.
dotme is offline   Reply With Quote
Old 13th July 2009, 16:56   #5
toretto
Junior Member
 
Join Date: Jun 2009
Posts: 14
So dotme you think about a script that "kick" the listeners out of the defined country? But it not appear the same into the log?
toretto is offline   Reply With Quote
Old 13th July 2009, 17:04   #6
dotme
Moderator
 
dotme's Avatar
 
Join Date: Feb 2005
Location: USA
Posts: 3,994
MaxMind has a free GeoLocation tool

http://www.maxmind.com/app/geolitecountry

That's a good place to get a DB of IP blocks and countries they are associated with.

Then you could write a chron job/script that pulls the file from server/admin.cgi?mode=viewxml

Parse the XML, get each IP, look it up, see if it should be connected. If not, kick and/or ban it.

This can all be automated, but like I said, it's a fair amount of work depending on your skill set. If you're a small station then it's going to be easier to pay a host that already has something like this in place.

If you're offering a service yourself though, then it might be worth the work...
dotme is offline   Reply With Quote
Old 13th July 2009, 18:41   #7
kdh
Member
 
Join Date: Nov 2008
Posts: 55
Send a message via AIM to kdh
I thought I'd chime in..

I use some perl scripts that I wrote.. I use the website hostip.info to get most of my info, if I don't have that, I also use the perl plugin Net::Whois::IANA

Then we turn that information into Google Maps friendly API.

all runs via cron.

I have my code some where on the forum for all to share and use.
kdh is offline   Reply With Quote
Old 13th July 2009, 18:56   #8
toretto
Junior Member
 
Join Date: Jun 2009
Posts: 14
kdh can u insert the link here?
toretto is offline   Reply With Quote
Old 13th July 2009, 21:04   #9
kdh
Member
 
Join Date: Nov 2008
Posts: 55
Send a message via AIM to kdh
Here is the link... I've have updated my perl code so its a little out of date, but this version is still a pretty good example as to how I'm doing it. Please don't laugh at the code..

http://forums.winamp.com/showthread....highlight=perl
kdh is offline   Reply With Quote
Old 13th July 2009, 21:31   #10
toretto
Junior Member
 
Join Date: Jun 2009
Posts: 14
But this script is to show where listeners are connected or to geo look only listeners from a determinated location/country?
toretto is offline   Reply With Quote
Old 13th July 2009, 21:58   #11
wolle-2009
Junior Member
 
Join Date: Apr 2009
Posts: 7
Hello this is live status script from radio tools
with demo http://www.radio-tools.com/stats/index.php
wolle-2009 is offline   Reply With Quote
Old 14th July 2009, 07:46   #12
toretto
Junior Member
 
Join Date: Jun 2009
Posts: 14
Guys, I not need a script to show from where listeners are listening, I need a script that block the listeners of determinated country for licensing problem.
toretto is offline   Reply With Quote
Old 14th July 2009, 11:49   #13
Nick@ss
Moderator
 
Nick@ss's Avatar
 
Join Date: Nov 2004
Location: Streamsolutions Headquarters
Posts: 11,966
These scripts are not posted around these parts from what i have seen in my time here.

you would need to write it or have it written for you.

you would also need to make sure the geo database is always up to speed or you will find people are listening that are not supposed to be.

See dotmes post above for what you need to be looking for,
Nick@ss is offline   Reply With Quote
Old 14th July 2009, 15:51   #14
toretto
Junior Member
 
Join Date: Jun 2009
Posts: 14
Hi Nick@ass,

I understand that I must develop from my side, but what I must do? I mean what procedure I must use to geo look listeners? I must make a cron job to kick users?
toretto is offline   Reply With Quote
Old 14th July 2009, 16:27   #15
Nick@ss
Moderator
 
Nick@ss's Avatar
 
Join Date: Nov 2004
Location: Streamsolutions Headquarters
Posts: 11,966
I have seen it done a few ways.

1 is to use a port 80 stream and firewall the ips that are not allowed to listen and as far as i know this is how its done by some people and i think this is an element of cast control these days as well.

another way would be to use icecast and enable the authentcication which shoutcast does not offer by default but icecast does.

You can then have the geo ip database referenced for allowed connections by the ip.

if you allow the users to connect then kick them they will still show in the logs and you will not be solving the problem.

to be honest its a lot of work for someone doing it themselves as this kind of thing really isnt catered for.

you will have to pay to keep the database updated aswell so it is current.
Nick@ss is offline   Reply With Quote
Old 14th July 2009, 21:12   #16
toretto
Junior Member
 
Join Date: Jun 2009
Posts: 14
But port 80 stream not show "localhost"? About license can be is a problem this?
toretto is offline   Reply With Quote
Old 16th July 2009, 05:13   #17
kdh
Member
 
Join Date: Nov 2008
Posts: 55
Send a message via AIM to kdh
Quote:
Originally posted by toretto
Guys, I not need a script to show from where listeners are listening, I need a script that block the listeners of determinated country for licensing problem.
you'll have to write it all yourself. You can use some of the code in my script to help figure out where people are coming from, but then you'd need to add those ip addresses to the ban file and then refresh the sc_tran pid to make it take effect. It would most likely run every minute from cron. hope that helps.
kdh is offline   Reply With Quote
Reply
Go Back   Winamp Forums > SHOUTcast > SHOUTcast Technical Support

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