CaTzil / service.subtitles.napisy24pl

Napisy24.pl is Addon for searching and downloading subtitles from KODI
GNU General Public License v2.0
8 stars 9 forks source link

zip extraction on windows fails, wrong slash #28

Closed ciukacz closed 3 years ago

ciukacz commented 3 years ago

NapisyUtils.py, line 148:

flag = xbmcvfs.copy(os.path.join(zip_filepath, file), filename_dest)

here os.path.join() adds backslash instead of a forward slash and extraction fails.

filename_src = zip_filepath + '/' + file
flag = xbmcvfs.copy(filename_src, filename_dest)

works and is still platform independent

CaTzil commented 3 years ago

Thanx for reporting this, I don't have a PC :}

I will push this fix asap

CaTzil commented 3 years ago

@ciukacz can you check if the delete temp files is workings as it is?

        if xbmcvfs.exists(__temp__):
            (dirs, files) = xbmcvfs.listdir(__temp__)
            for file in files:
                xbmcvfs.delete(os.path.join(__temp__, file))
        else:
            xbmcvfs.mkdirs(__temp__)
ciukacz commented 3 years ago

yes it works here because it is a regular path, the issue with zip:// is that it requires forward slash after the archive name

CaTzil commented 3 years ago

Cool, thank you

CaTzil commented 3 years ago

https://github.com/xbmc/repo-scripts/pull/1900

CaTzil commented 3 years ago

@ciukacz , can you change the line to

flag = xbmcvfs.copy(xbmcvfs.validatePath(os.path.join(zip_filepath, file)), filename_dest)

And test the plugin 🙏🏼

ciukacz commented 3 years ago

@CaTzil it fails under windows