Menu

#223 SR_ERROR_CANT_RESOLVE_HOSTNAME

open
nobody
None
5
2017-09-22
2017-09-21
No

Party Vibe Psychedelic Trance Radio Station cannot be used with streamripper:

$ streamripper -v
Streamripper 1.64.6
$ streamripper http://107.182.233.214:8010/ -u "Mozilla/5.0+(Windows+NT+5.1;+WOW64;+x64;+rv:52.0)+Gecko/20100101+Firefox/52.0"
Connecting...

error -6 [SR_ERROR_CANT_RESOLVE_HOSTNAME]
bye..
shutting down

Adding --debug didn't output anything extra.

Discussion

  • Eugene Adell

    Eugene Adell - 2017-09-22

    It's working with an empty User-Agent ( -u " " )
    It means there is some kind of server limitation to redirect to an HTML page when the User-Agent is a browser

    I agree the error should not be SR_ERROR_CANT_RESOLVE_HOSTNAME

     
    • David Hedlund

      David Hedlund - 2017-09-23

      Good work you too Eugene, I wouldn't figure that out by myself.

       
  • Björn Voigt

    Björn Voigt - 2017-09-22

    This problem is caused by the user-agent. If you use for instance VLC ("VLC/2.2.6 LibVLC/2.2.6"), the stream works:

    streamripper http://107.182.233.214:8010/ -u "VLC/2.2.6 LibVLC/2.2.6"
    

    Even if the problem can be solved here with changing the user-agent, I found that the misleading error message "error -6 [SR_ERROR_CANT_RESOLVE_HOSTNAME]" comes from the following sequence:

    • Streamripper tries to connect to http://107.182.233.214:8010/ with the wrong user-agent
    • the server disallows the Streamripper client because of it's user-agent and issues a HTTP redirect
    • the redirect only consists of a relative URL (Location:index.html)
    • Streamripper tries to parse "index.html" as an absolute URL
    • Streamripper does not find the host name in "index.html" and prints the error message

    The following code in http.c, function http_sc_connect should handle redirects more intelligently:

    if (*info->http_location) {
        /* RECURSIVE CASE */
        debug_printf ("Redirecting: %s\n", info->http_location);
        url = info->http_location;
        return http_sc_connect (rmi, sock, info->http_location, 
                    proxyurl, info, useragent, if_name);
    } else {
        break;
    }
    
     
    👍
    1
    • David Hedlund

      David Hedlund - 2017-09-23

      Thank you very much.

       

      Last edit: David Hedlund 2017-09-24
    • David Hedlund

      David Hedlund - 2017-09-24

      Note that you don't need a specific user agent as pointed out by Eugene Adell , you can use: streamripper http://107.182.233.214:8010/ -u " "

       

      Last edit: David Hedlund 2017-09-24

Log in to post a comment.

MongoDB Logo MongoDB