Old 7th November 2003, 15:00   #1
Rothgar
Senior Member
 
Join Date: Jun 2001
Location: Victoria, B.C. Canada
Posts: 124
Send a message via ICQ to Rothgar Send a message via AIM to Rothgar
Remote Kicksource function

I would like to implement a kicksource function in a dll I am making, yet I can't seem to find the correct data to send the dnas. you hit the server at ip:port/admin.cgi?pass=password&mode=kicksrc
You have to send headers to it. so I sent the request:
"GET /admin.cgi?pass=password&mode=kicksrc HTTP/1.1\nUser-Agent:WEBcast Media Mozilla\nHost: ip\nConnection: Close\n\n"
I received Error 403 Forbidden, I realize however if I type the url in my browser it brings up the login box but kicks the source anyway... Yet after checking the server after the forbidden message it failed to kick the source. Any insight on what I need to send the server to kick source.. Or maybe a library to specify login name/password?
Thanks
~Rothgar

Dawgclan Network
Genre: Rap/Hip-Hop
http://www.dawgclan.net
Rothgar is offline   Reply With Quote
Old 8th November 2003, 00:47   #2
Rothgar
Senior Member
 
Join Date: Jun 2001
Location: Victoria, B.C. Canada
Posts: 124
Send a message via ICQ to Rothgar Send a message via AIM to Rothgar
I need a solution, am I in the right forum? It said technical...
~Rothgar

Dawgclan Network
Genre: Rap/Hip-Hop
http://www.dawgclan.net
Rothgar is offline   Reply With Quote
Old 8th November 2003, 00:56   #3
FesterHead
Alumni
 
FesterHead's Avatar
 
Join Date: Sep 2001
Location: Maui, Hawaii
Posts: 14,108
Looks okay. Are you using the correct DNAS password?

For PHP, use:
code:

<?php
$fp = fopen("your DNAS ip", portBase);
if ($fp)
{
fputs("GET /admin.cgi?pass=yourpass&mode=kicksrc HTTP/1.0\r\nUser-Agent: Mozilla\r\n\r\n");
fclose($fp);
}
?>



Just change whatever fopen and fputs translates to your dll calls.

*****************************

This is not a Technical Support Ondemand forum.

Sometimes questions may not get answered right away. Please exercise patience and understanding.

FesterHead is offline   Reply With Quote
Old 8th November 2003, 03:59   #4
Rothgar
Senior Member
 
Join Date: Jun 2001
Location: Victoria, B.C. Canada
Posts: 124
Send a message via ICQ to Rothgar Send a message via AIM to Rothgar
That is not working, I am still getting Error 403 Forbidden.
I am specifying the right password because I am manually setting it, not variable. I am using the new SC dnas 1.9.2.
Any help on this would be great.
~Rothgar

Dawgclan Network
Genre: Rap/Hip-Hop
http://www.dawgclan.net
Rothgar is offline   Reply With Quote
Old 8th November 2003, 04:37   #5
DJHotIce
Forum Loser
(Forum King)
 
DJHotIce's Avatar
 
Join Date: Jan 2003
Location: That place I can't remember the name.
Posts: 4,617
Send a message via AIM to DJHotIce Send a message via Yahoo to DJHotIce
try these changes...
PHP Code:
<?php
$fp 
fopen("your DNAS ip""portBase");
if (
$fp)
{
fputs("GET /admin.cgi?pass=yourpass&mode=kicksrc HTTP/1.0\r\nUser-Agent: Mozilla\r\n\r\n");
fclose($fp);
}
?>
Make sure you put in a real IP address and port value

-DJHotIce
Bounce Multimedia - Professional Web Design
DJHotIce is offline   Reply With Quote
Old 8th November 2003, 14:27   #6
Rothgar
Senior Member
 
Join Date: Jun 2001
Location: Victoria, B.C. Canada
Posts: 124
Send a message via ICQ to Rothgar Send a message via AIM to Rothgar
What is the difference exactly? They look exactly the same and my IP and port are fine, I'm not using php I'm using C++, but I am sending those headers. The headers you just posted look 100% the same as the above post.
~Rothgar

Dawgclan Network
Genre: Rap/Hip-Hop
http://www.dawgclan.net
Rothgar is offline   Reply With Quote
Old 9th November 2003, 18:37   #7
FesterHead
Alumni
 
FesterHead's Avatar
 
Join Date: Sep 2001
Location: Maui, Hawaii
Posts: 14,108
Are you using \n (original post) or \r\n pairs (replies)?

Have you tried a direct http connection?
http://admin:password@ip:port/admin.cgi?mode=kicksrc

FesterHead is offline   Reply With Quote
Old 10th November 2003, 10:54   #8
Rothgar
Senior Member
 
Join Date: Jun 2001
Location: Victoria, B.C. Canada
Posts: 124
Send a message via ICQ to Rothgar Send a message via AIM to Rothgar
Well fester your direct connect worked well when I put it in my browser... however how do you have a tutorial site on how to send the username:pass via C++ winsock? Thanks
~Rothgar

Dawgclan Network
Genre: Rap/Hip-Hop
http://www.dawgclan.net
Rothgar is offline   Reply With Quote
Old 10th November 2003, 14:04   #9
Vchat20
Major Dude
 
Vchat20's Avatar
 
Join Date: Aug 2002
Posts: 1,273
dont know whether this is what your wanting or not. but you can make an html file which has the refresh header linked to the kick source url. this will essentially (when the page is left open) kick the source continuously depending on the refresh rate you specify. i did this myself one day when my dj's auto broadcast went awol when he was off. i just had the html file kick his source continuously.
Vchat20 is offline   Reply With Quote
Old 10th November 2003, 16:15   #10
DJHotIce
Forum Loser
(Forum King)
 
DJHotIce's Avatar
 
Join Date: Jan 2003
Location: That place I can't remember the name.
Posts: 4,617
Send a message via AIM to DJHotIce Send a message via Yahoo to DJHotIce
Its PHP, Not C++ so some of the code more than likely won't convert.

-DJHotIce
Bounce Multimedia - Professional Web Design
DJHotIce is offline   Reply With Quote
Old 12th November 2003, 08:02   #11
Rothgar
Senior Member
 
Join Date: Jun 2001
Location: Victoria, B.C. Canada
Posts: 124
Send a message via ICQ to Rothgar Send a message via AIM to Rothgar
Heh, I'd rather do the source kick through my dll. Thanks for the input though.
~Rothgar

Dawgclan Network
Genre: Rap/Hip-Hop
http://www.dawgclan.net
Rothgar is offline   Reply With Quote
Old 12th November 2003, 13:22   #12
Jay
Moderator Alumni
 
Jay's Avatar
 
Join Date: May 2000
Location: Next Door
Posts: 8,942
Error 403 Forbidden is not an error you should recieve from SHOUTcast

Are you sure you are connecting to shoutcast, could you paste the entire error, headers and all?
Jay is offline   Reply With Quote
Old 12th November 2003, 20:05   #13
Rothgar
Senior Member
 
Join Date: Jun 2001
Location: Victoria, B.C. Canada
Posts: 124
Send a message via ICQ to Rothgar Send a message via AIM to Rothgar
Sure here they are:
strcpy(HitBuffer,"GET /admin.cgi?pass=mypassword&mode=kicksrc HTTP/1.0\nUser-Agent: Mozilla\nConnection: Close\n\n");

Error is: 403 forbidden.
You don't have permission to access /admin.cgi on this server.
~Rothgar

Dawgclan Network
Genre: Rap/Hip-Hop
http://www.dawgclan.net
Rothgar is offline   Reply With Quote
Old 12th November 2003, 22:18   #14
Jay
Moderator Alumni
 
Jay's Avatar
 
Join Date: May 2000
Location: Next Door
Posts: 8,942
yup, that's not shoutcast, I am not sure what to tell you but whatever it is that you are connecting to, it's not a SHOUTcast server.

Maybe if you had the headers that came with that error as well we could pinpoint exactly what it is you are connecting to. Also post the ip and port that you are using in your plugin.

BTW just to give you a little insight, the only error code returned by SHOUTcast would be:

code:
HTTP/1.0 401 Unauthorized
Server: Shoutcast DNAS
WWW-authenticate: basic realm="Shoutcast Server"
Content-type: text/html

<HTML><HEAD>Unauthorized<title>SHOUTcast Administrator</title></HEAD></HTML>



or

code:
ICY 404 Resource Not Found
icy-notice1:<BR>SHOUTcast Distributed Network Audio Server/Linux v1.9.2<BR>
icy-notice2:The resource requested was not found<BR>



typically when trying to do what you are doing.
Jay is offline   Reply With Quote
Old 12th November 2003, 23:23   #15
DJHotIce
Forum Loser
(Forum King)
 
DJHotIce's Avatar
 
Join Date: Jan 2003
Location: That place I can't remember the name.
Posts: 4,617
Send a message via AIM to DJHotIce Send a message via Yahoo to DJHotIce
Jay, Sounds more like a header from a HTTP Server if you ask me.

-DJHotIce
Bounce Multimedia - Professional Web Design
DJHotIce is offline   Reply With Quote
Old 13th November 2003, 13:12   #16
Rothgar
Senior Member
 
Join Date: Jun 2001
Location: Victoria, B.C. Canada
Posts: 124
Send a message via ICQ to Rothgar Send a message via AIM to Rothgar
It is a HTTP Server but I am not authorized. I will try out another method A.S.A.P been a bit busy hopfully get to it tommorow.
Thanks for the feedback though.
~Rothgar

Dawgclan Network
Genre: Rap/Hip-Hop
http://www.dawgclan.net
Rothgar is offline   Reply With Quote
Old 15th November 2003, 13:58   #17
Rothgar
Senior Member
 
Join Date: Jun 2001
Location: Victoria, B.C. Canada
Posts: 124
Send a message via ICQ to Rothgar Send a message via AIM to Rothgar
Ok I just converted my socket http requests to wininet requests. maybe I'm doing something wrong looking into the ports. I am receiving a reply from the server verifying the dnas and version. However my request for /admin.cgi and even /index.html both failed telling me the resource requested was not found. My question here is are there any headers I "have" to send to the server? Perhaps I need to send it some specific headers.
Thanks,
~Rothgar

Dawgclan Network
Genre: Rap/Hip-Hop
http://www.dawgclan.net
Rothgar is offline   Reply With Quote
Old 15th November 2003, 18:05   #18
Jay
Moderator Alumni
 
Jay's Avatar
 
Join Date: May 2000
Location: Next Door
Posts: 8,942
you have to send "Mozilla" in a user-agent header, that's all. Turn on your www log in SHOUTcast and use that to see what all you are hitting and what User-Agent with.
Jay is offline   Reply With Quote
Old 15th November 2003, 23:17   #19
Rothgar
Senior Member
 
Join Date: Jun 2001
Location: Victoria, B.C. Canada
Posts: 124
Send a message via ICQ to Rothgar Send a message via AIM to Rothgar
Thanks for that but I'm unsure...
Ok from using IE I get a log for:
[http:150.101.113.184] REQ:"/" (Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1))

And through the dll I get:
[dest: 150.101.113.184] Invalid resource request(/index.html)
<11/15/03@18:27:20> [dest: 150.101.113.184] Invalid resource request(/index.html)

I'm looking at it and it doesn't make sense to me. one says http: and one is dest:
~Rothgar

Dawgclan Network
Genre: Rap/Hip-Hop
http://www.dawgclan.net
Rothgar is offline   Reply With Quote
Old 16th November 2003, 00:41   #20
Rothgar
Senior Member
 
Join Date: Jun 2001
Location: Victoria, B.C. Canada
Posts: 124
Send a message via ICQ to Rothgar Send a message via AIM to Rothgar
Scratch that, it's all working now thanks for everyones help, it was the User-Agent. Unfortunetely I didn't read the documentation well enough and so I was adding two User-Agents :|
~Rothgar

Dawgclan Network
Genre: Rap/Hip-Hop
http://www.dawgclan.net
Rothgar is offline   Reply With Quote
Old 7th April 2004, 23:44   #21
drjoc
Junior Member
 
Join Date: Apr 2004
Posts: 2
Sorry but I can run this script... You can help me?
Example my server is rx.pl:1234
admin pass: 223344

i create:

<?php
$fp = fopen("rx.pl", "1234");
if ($fp)
{
fputs("GET /admin.cgi?pass=223344&mode=kicksrc HTTP/1.0\r\nUser-Agent: Mozilla\r\n\r\n");
fclose($fp);
}
?>

Dont work... I dont undestand PHP but I think my correction on script is good. Why dont work? Please Help me!
drjoc is offline   Reply With Quote
Old 6th August 2005, 10:22   #22
Skoen
Junior Member
 
Join Date: May 2002
Location: Stavanger, Norway
Posts: 25
Well, this solution isn't working. Especially not with 1.9.2. All I get when I type the url manually in that script, I get the login-box to login. And the script itself produces this error: http://www.nordicradio.no/kickdj.php

http://pastebin.com/330546 <- my fields.
Try it, and you will get the same error:
Warning: fopen(158.37.36.102): failed to open stream: Success in /home/nordic/public_html/kickdj.php on line 6

I hope you will attempt to fix this error.

Webmaster for Radio 3 Norway
Skoen is offline   Reply With Quote
Old 6th August 2005, 10:25   #23
Nick@ss
Moderator
 
Nick@ss's Avatar
 
Join Date: Nov 2004
Location: Streamsolutions Headquarters
Posts: 11,953
check out the open msn link in my sig as that will kick source to the server amongst other things,

it may give you a simple solution to what you are doing
Nick@ss is offline   Reply With Quote
Old 6th August 2005, 13:07   #24
Jay
Moderator Alumni
 
Jay's Avatar
 
Join Date: May 2000
Location: Next Door
Posts: 8,942
the reason you see the login box is because after a kicksrc the server redirects you back to the admin page.

With php I recommend using fsockopen over fopen as you have more control over the headers which as said before MUST represent a Mozilla agent.
Jay is offline   Reply With Quote
Old 5th October 2005, 20:10   #25
bgdawg0385
Junior Member
 
Join Date: Sep 2004
Posts: 6
Hello, I was searching on how to kick the source of the shoutcast server remotely (through php), and came across this forum. I haven't written the php file yet, but I was trying to do it with a link:

http://admin:password@radio.amnt.net...i?mode=kicksrc

And I get:

Invalid syntax error

The page cannot be displayed

The page you are looking for might have been removed or had its name changed.

Believe me, I know the subdomain works.. Any ideas why I may be getting this?

Andrew
bgdawg0385 is offline   Reply With Quote
Old 22nd February 2007, 05:10   #26
iccle
Junior Member
 
Join Date: Nov 2006
Posts: 7
I too am having problems writing a dll (for use with mirc) to kick the source.

Can you paste the section of code you used?

I have no problems downloading the xml stats using URLDownloadToFile, but cannot find the correct syntax to access the admin.cgi?mode=kicksrc, or admin.cgi?mode=resetxml links.

I'm using the wininet API as opposed to winsock.

If anyone has any ideas on how to code this in C/C++ using windows API functions please let me know.
iccle is offline   Reply With Quote
Old 24th June 2014, 17:57   #27
NufSaid
Junior Member
 
Join Date: Jun 2014
Posts: 2
I have a script for mirc to kick the source if anyone needs Email ferrellhodges@yahoo.com
and ALSO I have a script I put in pal that works with sams broadcaster Just start up sams and it kicks the source and start a encoder all in one script works with sams broadcast contact if anyone is interested

Last edited by NufSaid; 24th June 2014 at 18:06. Reason: fixing
NufSaid is offline   Reply With Quote
Old 30th October 2015, 21:43   #28
NufSaid
Junior Member
 
Join Date: Jun 2014
Posts: 2
I have a script for mirc to kick the source if anyone needs Email ferrellhodges@yahoo.com
and ALSO I have a script I put in pal that works with sams broadcaster Just start up sams and it kicks the source and start a encoder all in one script works with sams broadcast contact if anyone is interested

--------------------------------------------------------------------------------
NufSaid is offline   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