[Release] Simple downloader

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
TobiasTheCommie Offline
Skilled Python Coder
Posts: 621
Joined: Apr 2008
Reputation: 3
Post: #11
Pull requests have been sent for 0.9.1.

The updated version should land in the Eden repository soonish.
find quote
stacked Offline
Skilled Python Coder
Posts: 787
Joined: Jun 2007
Reputation: 16
Post: #12
Hey, thanks again for all your hard work on this. When using 0.9.0 I didn't have any problems. After updating to 0.9.1, the downloads no longer worked.

When using downloader.downloadVideo:
Code:
18:08:05 T:2228   ERROR: Error Contents: SimpleDownloader instance has no attribute 'downloadVideo'
18:08:05 T:2228   ERROR: Traceback (most recent call last):
                                              File "C:\Program Files (x86)\XBMC-Eden\portable_data\addons\plugin.video.g4tv\default.py", line 190, in <module>
                                                play_video(name, url, plot, thumb)
                                              File "C:\Program Files (x86)\XBMC-Eden\portable_data\addons\plugin.video.g4tv\default.py", line 139, in play_video
                                                downloader.downloadVideo("myvideo.mp4", params)
                                            AttributeError: SimpleDownloader instance has no attribute 'downloadVideo'


When using downloader.download:

Code:
        url = 'http://videos.revision3.com/revision3/web/tekzilla/0290/tekzilla--0290--dual-firewalls--hd720p30.h264.mp4'
        path = 'C:\\'
        name = 'tekzilla'
        params = { "url": url, "download_path": path, "Title": name }
                downloader.download("myvideo.mp4", params) }

Code:
18:03:17 T:2104   ERROR: Exception in thread Thread-1:
                                            Traceback (most recent call last):
                                              File "C:\Program Files (x86)\XBMC-Eden\system\python\Lib\threading.py", line 532, in __bootstrap_inner
                                                self.run()
                                              File "C:\Program Files (x86)\XBMC-Eden\system\python\Lib\threading.py", line 484, in run
                                                self.__target(*self.__args, **self.__kwargs)
                                              File "C:\Program Files (x86)\XBMC-Eden\portable_data\addons\script.module.simple.downloader\lib\SimpleDownloader.p​y", line 125, in _startDownload
                                                self._processQueue()
                                              File "C:\Program Files (x86)\XBMC-Eden\portable_data\addons\script.module.simple.downloader\lib\SimpleDownloader.p​y", line 167, in _processQueue
                                                status = self._downloadURL(filename, item)
                                              File "C:\Program Files (x86)\XBMC-Eden\portable_data\addons\script.module.simple.downloader\lib\SimpleDownloader.p​y", line 413, in _downloadURL
                                                self._updateProgress(filename, item, params)
                                              File "C:\Program Files (x86)\XBMC-Eden\portable_data\addons\script.module.simple.downloader\lib\SimpleDownloader.p​y", line 485, in _updateProgress
                                                speed = int((get("bytes_so_far") / 1024) / (new_mark - get("mark")))
                                            ZeroDivisionError: float division
18:03:18 T:2264    INFO: Python script stopped
(This post was last modified: 2012-01-29 04:12 by stacked.)
find quote
Fisslefink Offline
Junior Member
Posts: 3
Joined: Dec 2010
Reputation: 20
Post: #13
I am having the same error, consistently. It crashes XBMC. Please fix.

mythtv@beagle:~$ grep downloader *.log
xbmc_crashlog-20120128_231056.log:23:10:52 T:2832202608 ERROR: ADDON: extension 'downloader/' is not currently supported for service addon
xbmc_crashlog-20120129_100704.log:23:34:01 T:3019052864 ERROR: ADDON: extension 'downloader/' is not currently supported for service addon
xbmc_crashlog-20120129_100704.log:10:06:59 T:2715347824 ERROR: ADDON: extension 'downloader/' is not currently supported for service addon

A representative error log is here: http://pastebin.com/9vJmjrBN
find quote
TobiasTheCommie Offline
Skilled Python Coder
Posts: 621
Joined: Apr 2008
Reputation: 3
Post: #14
stacked Wrote:Hey, thanks again for all your hard work on this. When using 0.9.0 I didn't have any problems. After updating to 0.9.1, the downloads no longer worked.

When using downloader.downloadVideo:
Code:
18:08:05 T:2228   ERROR: Error Contents: SimpleDownloader instance has no attribute 'downloadVideo'
18:08:05 T:2228   ERROR: Traceback (most recent call last):
                                              File "C:\Program Files (x86)\XBMC-Eden\portable_data\addons\plugin.video.g4tv\default.py", line 190, in <module>
                                                play_video(name, url, plot, thumb)
                                              File "C:\Program Files (x86)\XBMC-Eden\portable_data\addons\plugin.video.g4tv\default.py", line 139, in play_video
                                                downloader.downloadVideo("myvideo.mp4", params)
                                            AttributeError: SimpleDownloader instance has no attribute 'downloadVideo'


When using downloader.download:

Code:
        url = 'http://videos.revision3.com/revision3/web/tekzilla/0290/tekzilla--0290--dual-firewalls--hd720p30.h264.mp4'
        path = 'C:\\'
        name = 'tekzilla'
        params = { "url": url, "download_path": path, "Title": name }
                downloader.download("myvideo.mp4", params) }

Code:
18:03:17 T:2104   ERROR: Exception in thread Thread-1:
                                            Traceback (most recent call last):
                                              File "C:\Program Files (x86)\XBMC-Eden\system\python\Lib\threading.py", line 532, in __bootstrap_inner
                                                self.run()
                                              File "C:\Program Files (x86)\XBMC-Eden\system\python\Lib\threading.py", line 484, in run
                                                self.__target(*self.__args, **self.__kwargs)
                                              File "C:\Program Files (x86)\XBMC-Eden\portable_data\addons\script.module.simple.downloader\lib\SimpleDownloader.p​y", line 125, in _startDownload
                                                self._processQueue()
                                              File "C:\Program Files (x86)\XBMC-Eden\portable_data\addons\script.module.simple.downloader\lib\SimpleDownloader.p​y", line 167, in _processQueue
                                                status = self._downloadURL(filename, item)
                                              File "C:\Program Files (x86)\XBMC-Eden\portable_data\addons\script.module.simple.downloader\lib\SimpleDownloader.p​y", line 413, in _downloadURL
                                                self._updateProgress(filename, item, params)
                                              File "C:\Program Files (x86)\XBMC-Eden\portable_data\addons\script.module.simple.downloader\lib\SimpleDownloader.p​y", line 485, in _updateProgress
                                                speed = int((get("bytes_so_far") / 1024) / (new_mark - get("mark")))
                                            ZeroDivisionError: float division
18:03:18 T:2264    INFO: Python script stopped

This has been reported a few times, i can not reproduce this.

Full debug log please.

ETA:

downloadVideo has been deprecated, I've updated the wiki. Normal download() should just work.
(This post was last modified: 2012-01-30 00:12 by TobiasTheCommie.)
find quote
TobiasTheCommie Offline
Skilled Python Coder
Posts: 621
Joined: Apr 2008
Reputation: 3
Post: #15
Fisslefink Wrote:I am having the same error, consistently. It crashes XBMC. Please fix.

mythtv@beagle:~$ grep downloader *.log
xbmc_crashlog-20120128_231056.log:23:10:52 T:2832202608 ERROR: ADDON: extension 'downloader/' is not currently supported for service addon
xbmc_crashlog-20120129_100704.log:23:34:01 T:3019052864 ERROR: ADDON: extension 'downloader/' is not currently supported for service addon
xbmc_crashlog-20120129_100704.log:10:06:59 T:2715347824 ERROR: ADDON: extension 'downloader/' is not currently supported for service addon

A representative error log is here: http://pastebin.com/9vJmjrBN

Those error messages are annoying, but not harmful.

I don't see anything related to the downloader in the pastebin, and honestly, nothing i makes should be able to crash XBMC. It is a bug in XBMC if the downloader can bring it down.

Please provide a full debug log if you want me to look at this further.
find quote
stacked Offline
Skilled Python Coder
Posts: 787
Joined: Jun 2007
Reputation: 16
Post: #16
Full Debug log for ZeroDivisionError http://pastebin.com/KygxEyBy

I was able to fix this ZeroDivisionError.

The problem happens in:
script.module.simple.downloader\lib\SimpleDownloader.py", line 485, in _updateProgress
Code:
speed = int((get("bytes_so_far") / 1024) / (new_mark - get("mark")))

When a download starts, new_mark will sometimes equal get("mark"). This causes the denominator in the equation to be zero and python errors out. I'm not sure if this is the best fix, but replacing line 485 with the code below prevents a zero denominator.

Code:
if new_mark == get("mark"):
            speed = 0
        else:
            speed = int((get("bytes_so_far") / 1024) / (new_mark - get("mark")))

I've test this and it works fine.
(This post was last modified: 2012-01-30 03:17 by stacked.)
find quote
TobiasTheCommie Offline
Skilled Python Coder
Posts: 621
Joined: Apr 2008
Reputation: 3
Post: #17
Ah yes, that makes perfect sense.

thanks Smile
find quote
virtualxtc Offline
Junior Member
Posts: 1
Joined: Jan 2012
Reputation: 0
Post: #18
I've been having the same issue for the past several days. Is there a binary patch available or do I need to manually fix this and recompile?

thanks.
find quote
TobiasTheCommie Offline
Skilled Python Coder
Posts: 621
Joined: Apr 2008
Reputation: 3
Post: #19
No recompile needed. I need to push a new update.

This was a stupid bug that i never hit myself :/
find quote
sphere Offline
Posting Freak
Posts: 782
Joined: Jul 2009
Reputation: 33
Location: Germany
Post: #20
TobiasTheCommie Wrote:No recompile needed. I need to push a new update.

any updates on this?

Im thinking about using your module in my addons - but at the moment it is unusable Wink

regards,
sphere
find quote
Post Reply