Download snipet
#1
firstly i want some code which can download a file from a webpage.

at them moment i use something like
Quote:tmpweb = urllib.urlopener()
tmpweb.retrieve(str(http://www.google.com.au/intl/en_au/images/logo.gif", q:\\temp\\img.gif), "q:\\temp\temp.gif"))

first i want/need a way of showing a progress bar while a file download

second i want to be able to set the referering url?
for extra info the referer is the site which link or sent you to another.

i have noticed something with the urllib2. here is a example from the python site. i haven't yet tested this to see if it can get avi's or gif's yet.
Quote:import urllib, urllib2
req = urllib2.request("http://google.com.au/")
req.add_header("referer", "http://google.com")
webdata = urllib2.urlopen(req)
the only thing is getting the result from the open and writing them file. in the urlopener the retive comand does this for you.

then using webdata.read() i need to be able to write a file. any ideas?. if there is a function like retrive( req, filename) that would be good too.


and help would be greatly appericateted.
** Team XBMC Tester** XBMC 4 ever

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply

Logout Mark Read Team Forum Stats Members Help
Download snipet0