garbb Posted December 10, 2013 Share Posted December 10, 2013 (edited) If I visit this (http://www.torrentday.com/torrents/rss?u=1) url in a browser it will appear as an XML rss feed. But if I download it with InetGet() like this: InetGet('http://www.torrentday.com/torrents/rss?u=1',@TempDir & "\file.txt") And then open up the file with a text editor it does not look like an xml file: I have tried this with other rss feeds and the files are all ok (the downloaded file is a normal xml document and is viewable in a text editor) Anyone have any idea what is going on? Maybe the server is using some different encoding for this file and the browser is "translating" it but autoit's InetGet() function is not? Ok, so i basically solved my own problem but I figured I would leave this here in case someone else has the same issue. The response from the server was gzip encoded which InetGet() can't deflate so I am using the following function instead: Func get_url($url) $RequestURL = $url; Global $oHTTP = ObjCreate("Msxml2.XMLHTTP.4.0") ; $oHTTP.Open("GET", $RequestURL, False) $oHTTP.Send() if $oHTTP.status == 200 Then Return $oHTTP.ResponseText Else Return SetError(1,0,$oHTTP.status) EndIf EndFunc Because Msxml2.XMLHTTP.4.0 can handle gzip encoding. Edited December 10, 2013 by garbb Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now