Create zipfile using xbmc addon (python)

168 views Asked by At

I am trying to create a zip file using xbmc/kodi, but I got an empty zip file. Please help. Thanks in advance. Here are the codes that I've used:

def zip_folder():
  zf = zipfile.ZipFile(xbmc.translatePath(os.path.join(home, 'plugin.video.1addon.zip')), "w")
  for dirname, subdirs, files in os.walk("plugin.video.1addon"):
    zf.write(dirname)
    for filename in files:
      zf.write(os.path.join(dirname, filename))
  zf.close()
0

There are 0 answers