2015-09-07, 08:22
Hi
Just wanted to share a workaround I had to apply to
the Kodi subtitle.subscene plugin
The plugin constantly failed to save the downloaded subtitles despite
having correct uid/gid on all (network) directories.
Applying the following patch resolved my issues and subtitles are now downloaded
and saved. To me, it looks like the original code mixes virtual path(s) with
os path(s). Perhaps that should work, but for me it did not
Patch:
.kodi/addons/service.subtitles.subscene/service.py
Function "download"
368c368
< local_file_handle = open(local_tmp_file, "wb")
---
> local_file_handle = xbmcvfs.File(local_tmp_file, "wb")
373,374c373,374
< myfile = open(local_tmp_file, "rb")
< myfile.seek(0)
---
> myfile = xbmcvfs.File(local_tmp_file, "rb")
> myfile.seek(0,0)
380c380
< myfile.seek(0)
---
> myfile.seek(0,0)
391c391
< os.rename(os.path.join(tempdir, "subscene.xxx"), local_tmp_file)
---
> xbmcvfs.rename(os.path.join(tempdir, "subscene.xxx"), local_tmp_file)
Patch is currently running on my
PXE booted debian / Kodi on NFS. NOT tested on
a disk based system !
Hope this can help others in the same situation
Shared as information, dont like it ? Dont use it !
/amortin
Just wanted to share a workaround I had to apply to
the Kodi subtitle.subscene plugin
The plugin constantly failed to save the downloaded subtitles despite
having correct uid/gid on all (network) directories.
Applying the following patch resolved my issues and subtitles are now downloaded
and saved. To me, it looks like the original code mixes virtual path(s) with
os path(s). Perhaps that should work, but for me it did not
Patch:
.kodi/addons/service.subtitles.subscene/service.py
Function "download"
368c368
< local_file_handle = open(local_tmp_file, "wb")
---
> local_file_handle = xbmcvfs.File(local_tmp_file, "wb")
373,374c373,374
< myfile = open(local_tmp_file, "rb")
< myfile.seek(0)
---
> myfile = xbmcvfs.File(local_tmp_file, "rb")
> myfile.seek(0,0)
380c380
< myfile.seek(0)
---
> myfile.seek(0,0)
391c391
< os.rename(os.path.join(tempdir, "subscene.xxx"), local_tmp_file)
---
> xbmcvfs.rename(os.path.join(tempdir, "subscene.xxx"), local_tmp_file)
Patch is currently running on my
PXE booted debian / Kodi on NFS. NOT tested on
a disk based system !
Hope this can help others in the same situation
Shared as information, dont like it ? Dont use it !
/amortin