I'm facing another problem
For now, I can pass the parameter and make it download the files that i want (Thanks to Bstrdmkr!)
However, there were a bug that my plugin can only download the file once at a time.
I need to restart XBMC to make it can download again, so I go check the log files and see this
Code:
21:43:02 T:5820 ERROR: C:\Users\me\AppData\Roaming\XBMC\addons\script.module.simple.downloader\lib\DialogDownloadProgress.py:136: DeprecationWarning: object.__init__() takes no parameters
xbmcgui.WindowXMLDialog.__init__(self, *args, **kwargs)
21:43:02 T:3504 ERROR: CLocalizeStrings::ClearBlock: Trying to clear non existent block C:\Users\ITTIPRATEEP\AppData\Roaming\XBMC\addons\script.module.simple.downloader
21:43:03 T:5820 ERROR: Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Program Files (x86)\XBMC\system\python\Lib\threading.py", line 532, in __bootstrap_inner
self.run()
File "C:\Program Files (x86)\XBMC\system\python\Lib\threading.py", line 484, in run
self.__target(*self.__args, **self.__kwargs)
File "C:\Users\me\AppData\Roaming\XBMC\addons\script.module.simple.downloader\lib\SimpleDownloader.py", line 125, in _startDownload
self._processQueue()
File "C:\Users\me\AppData\Roaming\XBMC\addons\script.module.simple.downloader\lib\SimpleDownloader.py", line 162, in _processQueue
self._setPaths(filename, item)
File "C:\Users\me\AppData\Roaming\XBMC\addons\script.module.simple.downloader\lib\SimpleDownloader.py", line 134, in _setPaths
params["path_incomplete"] = os.path.join(self.temporary_path.decode("utf-8"), self.common.makeUTF8(filename))
TypeError: 'str' object does not support item assignment
I think I'm implement the SimpleDownloader by following the patterns which shown on XBMC's wiki like this
Code:
def download_material(filename,url):
local_path = __settings__.getSetting('download_location')
params = {'url' : url, 'download_path' : local_path}
sd.download(filename,params)
Anyone can give me another idea to solve this bug ?