Http download - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +--- Thread: Http download (/showthread.php?tid=10820) |
- dchurch24 - 2005-03-21 hi, i'm currently writing a script that downloads a specific file each time xbmc is started (listing.xml of course!!. however, the ftp code i have written only works peridically, and i would prefer to use http anyway as i have a web server constently up and running on my lan. can someone point me in the right direction for http file downloading with python please? ps. also, how do i return the current time into a string? - pike - 2005-03-21 i don't know anything about this, but... can't you look at how all the other retrieval scripts do it - dchurch24 - 2005-03-21 like the web radio? of course, good idea. - MarcoFre - 2005-03-25 the code to read a page from html is: siteurl = urllib.urlopen(url) page = siteurl.read() bye - Asteron - 2005-03-26 if you dont need to parse urllib.urlretrieve(url, filename) - Bernd - 2005-03-26 check the good ol aqtbrowser.py script. it has a neat http download function fetchhtmlpage. it returns the html contents in a string and supports a timeout, so your script won't hang in case the webserver doesn't respond. bernd - Mouton - 2005-03-27 here's a better function to download a file: Quote:import urllib2, socket - ofer_shm - 2011-07-12 sorry for jumping a very old post but i search the forum and i found it i am using the function "download_file" that post here and now i need to save the data variable and save it in the skin folder how can i do that ? thank you |