ReceiveHTTPFile with SpecChar @

Just starting out? Need help? Post your questions and find answers here.
Rapido
New User
New User
Posts: 8
Joined: Fri Aug 31, 2012 2:04 pm

ReceiveHTTPFile with SpecChar @

Post by Rapido »

;NOT WORK

Code: Select all

InitNetwork() 
URL$="http://mt1.google.com/vt/lyrs=h@186000000&hl=ru&x=76593&y=44202&z=17" 
;URL$="http://cs304105.userapi.com/u7086891/-14/y_d55be0c9.jpg" 
Debug ReceiveHTTPFile(URL$,"C:\out.png")
;WORK

Code: Select all

 URL$="http://mt1.google.com/vt/lyrs=h@186000000&hl=ru&x=76593&y=44202&z=17" 
 URLDownloadToFile_(0,URL$,"C:\out.png",0,0) 
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: ReceiveHTTPFile with SpecChar @

Post by MachineCode »

The failed one doesn't work with "Star Downloader" (third-party downloading tool) either. It says "Bad request" when I try.
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
jassing
Addict
Addict
Posts: 1885
Joined: Wed Feb 17, 2010 12:00 am

Re: ReceiveHTTPFile with SpecChar @

Post by jassing »

I don't think it has anything to do with '@' -- if you sniff while you try to download the flie in PB -- you get:

Regardless of using '@' or %40, the download fails.
HTTP/1.1 403 Forbidden
and
... but your computer or network may be sending automated queries. To protect our users, we can't process your request right now.
Perhaps it has something to do with the client browser is identified as (or lack thereof of one...)

The url is not a url to an image -- it's a url that is processed by the server and then image data is sent back. Since no browser is identified in the stream, google's servers may be declining the request (just a guess, who really knows what google does?)

ANyway; if you 'hand code it' and include a browser declaration ,I bet it will work. (FWIW: wget fetches the file fine, wget is available on most platforms)
Post Reply