Kodi Community Forum
[Release] Simple downloader - 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: [Release] Simple downloader (/showthread.php?tid=116500)

Pages: 1 2 3 4 5 6


[Release] Simple downloader - TobiasTheCommie - 2011-12-08

This is version 0.9.1 of a simple downloader for XBMC.

This service will go to Final 1.0, with YouTube 3.0.

This addon provides a simple http/rtmp downloader.

A single queue is used across all plugins.

The rtmp downloader uses the rtmpdump binary, and thus only streams supported by the installed rtmpdump will work.

We have endeavoured to make the downloader as unintrusive for the user as possible, it is thus very simple.

Implementation details can be found on the wiki.

http://wiki.xbmc.org/index.php?title=Add-on:Simple_downloader_for_xbmc_plugins

This is a dependency used by our other plugins, and we perform constant integration and unittesting during development

http://tc.tobiasussing.dk/jenkins/view/Simple%20Downloader/

Questions, requests, suggestions are welcome.

Note: Before the 1.0 final we do not promise the interface will stay locked.
After the 1.0 version there will be "DeprecatedFunction" warnings on changes for a limited time.

TheCollective


- Popeye - 2011-12-09

Excellent!

Would you mind adding all possible params to the wiki? I Was thinking about how to set the "live" parameter.
The rtmpdump binary have to be manually downloaded or?


- TobiasTheCommie - 2011-12-09

Sure, this is still a WIP, so we're bound to miss something.

As for the rtmp binary, we can't bundle it with the plugin, so it looks for the systemwide binary.

On linux it should Just Work™.

Sadly there isn't currently a better way to do it.

ETA: Updated the wiki with live RTMP stream examples.


- Popeye - 2011-12-09

Thanks for the information. Would it be possible to extend the api with a Boolean to know whether rtmpdump is supported or not?
This addon + svtplay = true IMHO


- TobiasTheCommie - 2011-12-10

That is doable.

Might even help me solve another problem i'm having. Smile


- TobiasTheCommie - 2012-01-03

Finally got around to adding isRTMPInstalled.


- Popeye - 2012-01-03

TobiasTheCommie Wrote:Finally got around to adding isRTMPInstalled.

Great, then I have some work todo.... Big Grin


- TobiasTheCommie - 2012-01-03

It hasn't been pushed yet, if you want the trunk it is here http://hg.tobiasussing.dk/hgweb.cgi/downloadxbmc/


- divingmule - 2012-01-04

Hi, I'm getting an AttributeError, any idea what I'm missing?

Code:
Error Type: <type 'exceptions.AttributeError'>
Error Contents: 'module' object has no attribute 'common'
Traceback (most recent call last):
          File "C:\Users\divingmule\Desktop\xbmc-pvr\XBMC\portable_data\addons\plugin.program.piratebay\default.py", line 16, in <module>
                                                downloader = downloader.SimpleDownloader()
          File "C:\Users\divingmule\Desktop\xbmc-pvr\XBMC\portable_data\addons\script.module.simple.downloader\lib\SimpleDownloader.py", line 30, in __init__
                                                if sys.modules[ "__main__" ].common:
                                            AttributeError: 'module' object has no attribute 'common'



- TobiasTheCommie - 2012-01-04

Oh crap, yeah, you are gonna need this too http://hg.tobiasussing.dk/hgweb.cgi/commonxbmc/


- TobiasTheCommie - 2012-01-27

Pull requests have been sent for 0.9.1.

The updated version should land in the Eden repository soonish.


- stacked - 2012-01-29

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.py", line 125, in _startDownload
                                                self._processQueue()
                                              File "C:\Program Files (x86)\XBMC-Eden\portable_data\addons\script.module.simple.downloader\lib\SimpleDownloader.py", 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.py", 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.py", 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



Multiple errors from version 0.9.1 - Fisslefink - 2012-01-29

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


- TobiasTheCommie - 2012-01-30

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.py", line 125, in _startDownload
                                                self._processQueue()
                                              File "C:\Program Files (x86)\XBMC-Eden\portable_data\addons\script.module.simple.downloader\lib\SimpleDownloader.py", 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.py", 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.py", 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.


- TobiasTheCommie - 2012-01-30

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.