wget command (from Linux) download support?
#1
Question 
how big of a deal would it be to implement the linux command wget? It would be nice to be able to download data files with a system call with multi threads. Also be able to see speed and % completion of downloads. I dont think there is a way to do that with python. Someone please correct me if i am wrong.
Reply
#2
just a guess... but I'd imagine that since XBMC is not based on Linux the wget code will not work.
I'm not an expert but I play one at work.
Reply
#3
you are completely wrong.

porting wget would just be silly
Reply
#4
There is an httpapi command FileDownloadFromInternet
http://www.xboxmediacenter.com/wiki/inde...e_Commands
Reply
#5
Mayve when someone add a shell to XBMC (i'm interested on it but i don't know how to atach to a TCP port) would implement a fake wget. Until that... there's no option.
Reply
#6
The ftp server has a shell like interface. You can execute builtin commands via SITE operations. I just don't see much of a point for it all. Scripts are the way to go.
Reply
#7
I didnt mean the actual wget command. Something similar. But as Asteron pointed it out to me there is a http api to do this. Thanks alot. This is pretty close to what i need accept is there anyway to get file download status? Such as speed and completion percentage?
Reply
#8
Also to be able to download from a location that has http authentication.
Reply
#9
For something more complex you will have to go the python route. t3ch downloader has a progress dialog with a real download completion percentage on a single download. Heres the excerpt, notice the callback function passed to url retrieve. _(*) is just a string

Code:
def _fetch_current_build( self, url, file_path ):
        try:
            self.dialog = xbmcgui.DialogProgress()
            self.dialog.create( _( 0 ), _( 503 ), file_path )
            urllib.urlretrieve( url , file_path, self._report_hook )
            self.dialog.close()
            self._extract_rar( file_path )
        except:
            traceback.print_exc()
            self.dialog.close()
            ok = xbmcgui.Dialog().ok( _( 0 ), _( 303 ) )

    def _report_hook( self, count, blocksize, totalsize ):
        percent = int( float( count * blocksize * 100) / totalsize )
        self.dialog.update( percent )
        if ( self.dialog.iscanceled() ): raise

EDIT Post number 800!
Reply
#10
excuse my ignorance but where did you get the t3ch downloader from? Is there any other nifty python classes out there designed for xbmc?

Also is there any way to actually run a python script in the background? Kinda of like another thread? I would like to be able to set multiple files downloading and then go back to the dashboard while the files are downloading. Thanks for the reply!

This is my first stab at python. Be kind!Wink
Reply
#11
I replied to your PM. The t3ch script is not ready for general availability I think. Python is perfectly capable of running in the background and even at startup. Just don't popup a window from the xbmcgui module. My sig has links and there are always scripters hanging out at irc://irc.freenode.net/xbmc-scripting
Reply

Logout Mark Read Team Forum Stats Members Help
wget command (from Linux) download support?0