v16 builtin extract error (rarmanager)
#1
Exclamation 
Hello.
My addon service.subtitles.legendasdivx (LegendasDivx.com) since Jarvis is giving an error on rar extraction if the same file is extracted twice within the same kodi session, closing Kodi works again till the first usage.
When a user goes to the subtitle addon and choose the subtitle download it works as expected, opens the rar and shows the subdirs plus the files.
If you pick the wrong synced file and you do it all again the rarmanager gives you an error (log shows that).
Going into explorer (windows) or terminal (linux) you can extract the rar file without issues.
If I uncompress and compress it while leaving the kodi browser window open you can get the rar and navigate into it choosing the subtitle.
I tried changing a few code but I didn't find what is provoking this error.
My other addons don't suffer this problem till today. The rar files that have problems have in fact subdirs with subtitles inside those dirs.
Help is needed Smile

LOG: http://pastebin.com/wRRpqzvg

Thanks.

Regards.
Reply
#2
Anyone willing to help? The main thing is that I don't understand why the rar unpacks the first time you download but in the rest of the times it does not... Only after closing kodi. The files that don't open inside kodi are just fine outside kodi, Linux or Windows. The debug log shows an error on rar manager. Something must be broken there...
Reply
#3
Fixed with code.
Had to extract to a new directory inside the temp and then play around.
Here's a bit of code:

+
+ dirs = os.walk(os.path.join(__newtemp__,'.')).next()[1]
+ dircount = len(dirs)
+ if dircount == 0:
+ filelist = os.listdir(__newtemp__)
+ for subfile in filelist:
+ shutil.move(os.path.join(__newtemp__, subfile), __temp__+'/')
+ os.rmdir(__newtemp__)
+ dialog = xbmcgui.Dialog()
+ subs_file = dialog.browse(1, __language__(32024).encode('utf8'), 'files', '.srt|.sub|.aas|.ssa|.smi|.txt', False, False, __temp__+'/').decode("utf-8")
+ subtitles_list.append(subs_file)
+ break
+ else:
+ for dir in dirs:
+ shutil.move(os.path.join(__newtemp__, dir), __temp__+'/')
+ os.rmdir(__newtemp__)
dialog = xbmcgui.Dialog()


You can always give a look at github for the full code if you have the same problems as me.
Unpacking a rar file with subdirs inside to the temp directory fails after second try without closing Kodi.

Regards.

Cheers!
Reply
#4
this is because kodi maintains a cache of archives. there should probably be a flag to disable this behavior. it makes sense for the thing the code was designed for (media playback from within archives)..
Reply

Logout Mark Read Team Forum Stats Members Help
builtin extract error (rarmanager)0