The problem is not with the requests
, but with the way you're accessing that specific site.
Namely, seems like http://arboleascity.com
uses User-Agent
header field to differentiate browsers from music players.
If you use a valid browser signature, it just returns the page HTML (text/html
) and closes the connection:
$ curl -vvv -A 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0' http://arboleascity.com >/dev/null
...
< Content-Type: text/html;charset=utf-8
...
100 118 0 118 0 0 297 0 --:--:-- --:--:-- --:--:-- 297
* Connection #0 to host arboleascity.com left intact
However, if you leave User-Agent
undefined (the default), the site streams binary content (audio/aacp
) at ~8kbps:
$ curl -vvv http://arboleascity.com >/dev/null
...
< Content-Type: audio/aacp
...
< icy-notice1: <BR>This stream requires <a href="http://www.winamp.com">Winamp</a><BR>
< icy-notice2: SHOUTcast DNAS/posix(linux x64) v2.5.1.724<BR>
...
100 345k 0 345k 0 0 26975 0 --:--:-- 0:00:13 --:--:-- 7118^C
Or, with requests
:
>>> headers = {'user-agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0'}
>>> r = requests.get('http://arboleascity.com', headers=headers)