Old 8th May 2017, 18:48   #1
Yuchen
Junior Member
 
Join Date: May 2017
Posts: 3
How to fetch station from ID?

Hi,
I want to update the current playing title for a now playing station, but I didn't found how to fetch the detail of a station based on its id. I got the station from fetching the list for a given genre(http://api.shoutcast.com/station/advancedsearch?mt=audio/mpeg&genre_id={0}&&limit={1}). And i found there is a "Get Stations by Keyword Search", is to search the station name the only way?

Could anyone tell me the api to get a single station's current title?
Yuchen is offline   Reply With Quote
Old 8th May 2017, 19:41   #2
neralex
Senior Member
 
Join Date: Mar 2011
Posts: 495
* edit: missunderstood
neralex is offline   Reply With Quote
Old 8th May 2017, 20:05   #3
djSpinnerCee
Forum King
 
djSpinnerCee's Avatar
 
Join Date: Aug 2004
Location: Hollis, Queens/The Bronx, NYC
Posts: 3,424
Send a message via ICQ to djSpinnerCee Send a message via AIM to djSpinnerCee
the yp.shoutcast.com/sbin/tunein-station.pls?id=NNNNN will return a .pls file containng the server URL(s) where you can get the now playing text with /currentsong?sid=N

NNNNN is the directory id, N is the stream id - if the stream id is not 1, you'll have to read more, like /statistics to find the correct sid from the streampath provided by the .pls - the directory id for a station can also change, so keep that in mind.
djSpinnerCee is online now   Reply With Quote
Old 9th May 2017, 19:36   #4
Yuchen
Junior Member
 
Join Date: May 2017
Posts: 3
Not working

Quote:
Originally Posted by djSpinnerCee View Post
the yp.shoutcast.com/sbin/tunein-station.pls?id=NNNNN will return a .pls file containng the server URL(s) where you can get the now playing text with /currentsong?sid=N

NNNNN is the directory id, N is the stream id - if the stream id is not 1, you'll have to read more, like /statistics to find the correct sid from the streampath provided by the .pls - the directory id for a station can also change, so keep that in mind.
Thanks, yes a few times I found the current song as you said. But most of time
1. there is 404/invalid source/redirect too many times, when I try to access /currentsong and /statistics (e.g http://radioscoop.hu:80/live.mp3/statistics where did = 988599)

2. Is there a similar way for the current listener count as well?
Yuchen is offline   Reply With Quote
Old 9th May 2017, 20:55   #5
djSpinnerCee
Forum King
 
djSpinnerCee's Avatar
 
Join Date: Aug 2004
Location: Hollis, Queens/The Bronx, NYC
Posts: 3,424
Send a message via ICQ to djSpinnerCee Send a message via AIM to djSpinnerCee
you have to strip everything after host : port -- can't just add /stats to the stream mountpoint (streampath) -- ie: radioscoop.hu:80/stats....

btw: you probably realized that the station name is in the pls.

also, shoutcast/radionomy hosted stations don't have /stats and /statistics links - they should all share a common host : port combo.
djSpinnerCee is online now   Reply With Quote
Old 10th May 2017, 21:54   #6
Yuchen
Junior Member
 
Join Date: May 2017
Posts: 3
Still now working

Quote:
Originally Posted by djSpinnerCee View Post
you have to strip everything after host : port -- can't just add /stats to the stream mountpoint (streampath) -- ie: radioscoop.hu:80/stats....

btw: you probably realized that the station name is in the pls.

also, shoutcast/radionomy hosted stations don't have /stats and /statistics links - they should all share a common host : port combo.
I tried with the host:port/stats, but it seems still not working.
For example, the station of (http://yp.shoutcast.com/sbin/tunein-....pls?id=988599) has steampath (http://radioscoop.hu:80/live.mp3). And I tried http://radioscoop.hu:80/stats and http://radioscoop.hu:80/currentsong, all have 404 not found.

Another case is that radionomy you mentioned, http://listen.radionomy.com/ABC-Lounge (with id 709809), what should I do to get its current title? what do you mean by "common host:port combo"?

Also, how to get the current listener count? only from /stats?

Thanks a lot for help
Yuchen is offline   Reply With Quote
Old 10th May 2017, 22:34   #7
djSpinnerCee
Forum King
 
djSpinnerCee's Avatar
 
Join Date: Aug 2004
Location: Hollis, Queens/The Bronx, NYC
Posts: 3,424
Send a message via ICQ to djSpinnerCee Send a message via AIM to djSpinnerCee
radioscoop is a webserver, not a dnas - maybe you're using the station's website address.

from the pls -- FileN: is the entry you want (the stream server).

with your browser get / - if it's not a dnas status page, you have the wrong address (host/port) - hint: very few dnas servers run on port 80.

edit 1: did some digging - the radioscoop /live.mp3 url in the pls is an http redirect to this: 79.172.194.189:8060/live.mp3 -- so, you can use 79.172.194.189:8060/statistics or /stats here.

this makes things more difficult because you have to follow the redirect responses. this is because the rmo will allow you to put any url as a stream url, even one that does not point directly to a dnas. in the past, the directory would only generate .pls files with dnas urls.

edit 2: ok, sending me down a rabbit hole here --79.172.194.189:8060 is an icecast server, how you get info from those, i can't tell you.

Last edited by djSpinnerCee; 10th May 2017 at 23:57. Reason: new info
djSpinnerCee is online now   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast 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