Kodi Community Forum
Release service.subtitles.subscene - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Subtitle Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=143)
+---- Thread: Release service.subtitles.subscene (/showthread.php?tid=184854)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43


RE: service.subtitles.subscene - Bigdrago - 2021-10-10

There are so many releasen of this now. Currently using 1.9.3 by jarmo, wuff. 1.9.3 is working grrat btw.
Is there a newer release?


RE: service.subtitles.subscene - AnonTester - 2021-10-10

1.9.5 is the latest release from me (wuff) and it's been working fine for me, so no reason for any changes or updates. If 1.9.3 works fine for you, no reason to update. The changes in 1.9.4/1.9.5 were due to a deprecated dependency for Kodi19 and an adjustment to handle windows/linux paths when extracting archives. There are only a limited amount of things that can be done with subtitle addons, so there's no need to change anything unless something breaks.

Reference to my github:
https://github.com/AnonTester/service.subtitles.subscene

And my kodi repo is here:
https://github.com/AnonTester/kodi-repo


RE: service.subtitles.subscene - HRTKING - 2021-12-22

So the addon doesnt work anymore?
Installed the both Archive Support addons too, gets Failed to download subtitle.


RE: service.subtitles.subscene - AnonTester - 2021-12-23

Working fine for me. Without full debug log I can't look into why it might not work for you, but highest probability is an issue with cloudflares ddos protection used by subscene and your country/IP/system isn't allowed to access it. Try going to the subscene website with a pc or mobile phone on the same network as your Kodi box, then try again. This might work.


RE: service.subtitles.subscene - HRTKING - 2021-12-25

Sorry I forgot to post a log.
Quote:2021-12-25 02:58:17.648 T:16192   ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'IndexError'>
                                                   Error Contents: list index out of range
                                                   Traceback (most recent call last):
                                                     File "C:\Users\HRT\AppData\Roaming\Kodi\addons\service.subtitles.subscene\service.py", line 638, in <module>
                                                       subs = download(params["link"])
                                                     File "C:\Users\HRT\AppData\Roaming\Kodi\addons\service.subtitles.subscene\service.py", line 496, in download
                                                       src = os.path.join(local_tmp_file, files[0])
                                                   IndexError: list index out of range
                                                   -->End of Python script error report<--
I am on Win 10 x64


RE: service.subtitles.subscene - AnonTester - 2021-12-25

Please post the full debug log via paste.kodi.tv (see https://forum.kodi.tv/showthread.php?tid=323719&pid=2665079#pid2665079) not just the small excerpt of the error message so that I can see details of what it's trying to download, Kodi and add-on versions, language settings etc and try to replicate the problem you're having. The error message just tells me that the download didn't work, but gives no details as to what it tried to download and where things went wrong.

Also, please confirm if you did what I suggested or not.


RE: service.subtitles.subscene - nusstu - 2021-12-25

Hi Anon,

I'm getting a similar error. And I've confirmed that I'm not using cloudflare dns.  I'm able to download the subtitle using my laptop.  It seems that during extraction of the zip file it could not copy. 

I've pasted the debug log here:
https://pastebin.com/c5MWL0KT


RE: service.subtitles.subscene - nusstu - 2021-12-25

Sorry the link should be this: https://pastebin.com/uD5SR3jG

Thanks for your help.


RE: service.subtitles.subscene - HRTKING - 2021-12-25

thanks for the complete log. I forgot to mention I tried with and without VPN, downloaded the sub successfully from the webpage.


RE: service.subtitles.subscene - AnonTester - 2021-12-26

@nusstu the link to the log is giving me an error saying it's either a private paste or pending moderation. Please either adjust permissions or upload to https://paste.kodi.tv/ instead. Also, it's not cloudflare dns that's the problem, but scenetime being hosted by cloudflare and their ddos protection kicks in at times preventing kodi from downloading in the first place. But as you said your issue is with extraction of the zip file, it's a different issue than HRTKING has.
Does your kodi have write permission to your movie/tvshow folder? and is the downloaded zip file and the extracted file still in a subfolder of the temp directory ~/.kodi/userdata/addon_data/service.subtitles.subscene/temp/ ?


@HRTKING please post your log file, then I can take a closer look.


RE: service.subtitles.subscene - nusstu - 2021-12-26

Hi @AnonTester , please find my debug logs here, I checked the subscene.zip downloaded to the temp dir and it contains the correct srt:
https://paste.kodi.tv/sedosoyano.kodi

Also, I realised that line 495 in service.py -> (dirs, files) = xbmcvfs.listdir('%s' % local_tmp_file)
In the version 1.9.5, we are passing the zip file to listdir function?  I'm not sure if that's how it works but I tried changing it to (dirs, files) = xbmcvfs.listdir('%s' % tempdir)
And added a log statement to see what local_tmp_file and files[0] are set to. 

Here's the debug logs for that after making the change:
https://paste.kodi.tv/dazukupudu.kodi

Thanks for the quick reply @AnonTester


RE: service.subtitles.subscene - nusstu - 2021-12-26

Hi @AnonTester,

I realized I haven't answered your questions.  Yes, there is a zip file in ~/.kodi/userdata/addon_data/service.subtitles.subscene/temp/<random_string>/subscene.zip
In this zip file when I extracted it manually it contains the correct srt.  But I'm not sure in service.py where it supposed to extract the zip file too. After changing the code it seems to extract it to the temp folder where kodi.log is but I think that's the wrong location.
Maybe you can look thru my logs to see what went wrong?

Thanks so much.


RE: service.subtitles.subscene - AnonTester - 2021-12-28

@nusstu Thanks for the logs, those are very helpful! As you appear to understand some Python and are technical, here's the full explanation of what's happening:

xbmcvfs is the virtual file system module that's able to work with archive files (with the help of the vfs.libarchive addon) without the need to extract them first. That's why the xbmcvfs.listdir function gets passed the archive file directly rather than a directory. It's meant to return all files and directories in the archive and then copy the first file it finds to the tempdir and proceed checking if it's a supported subtitle file.

The tempdir variable points to the directory with the random numbers that's created in the addon dir while downloading the subtitle archive. The file 'subscene.xxx' in that directory then gets renamed into 'subscene.rar' or 'subscene.zip' or 'subscene.srt' depending on what it is. If it's an archive, on Kodi 19 it uses xbmcvfs to look into the archive file (local_tmp_file variable) and copy the subtitles contained in it into tempdir (next to the archive file) for further processing. If it's Kodi older 19, it extracts the archive using XBMC.Extract (deprecated built-in Kodi function in Kodi 19) for further processing.

It appears, on Android xbmcvfs.listdir and/or vfs.libarchive work differently and listdir does not return the contents of the archive as it's supposed to. Due to this, the next step that looks for the first file in the archive in the files[0] check. As no files were returned, there is no files[0] in the files list and the error "IndexError: list index out of range" is being returned.
 
Code:
2021-12-26 01:53:25.437 T:20554 ERROR <general>: GetDirectory - Error getting /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/userdata/addon_data/service.subtitles.subscene/temp/23f37ed1-38db-496f-aadb-bbbfcc95fc03/subscene.zip
The file is there as you've confirmed, but it couldn't be opened.

Reference to bug/issue:
https://forum.kodi.tv/showthread.php?tid=323321&page=3


As per your second log where you pointed to the temp directory rather than the zip file - which doesn't work as per explanation above, this error message may hint at the problem though:
 
Code:
2021-12-26 14:08:42.356 T:7406    ERROR <general>: OnDownloadComplete - Saving of subtitle archive://%2fstorage%2femulated%2f0%2fAndroid%2fdata%2forg.xbmc.kodi%2ffiles%2f.kodi%2fuserdata%2faddon_data%2fservice.subtitles.subscene%2ftemp%2f98ae38f3-58be-4083-9bea-c71e170738de%2fsubscene.zip/ to special://temp/EP.0.v1.1640227727.720p.en failed
The encoding looks wrong with the forward slashes converted into %2f of the filesystem path.


I don't have a Kodi on Android system which makes it difficult to replicate and test though.

Can you try to test if either of these two alternatives for line 495 helps in any way:
 
Code:
                (dirs, files) = xbmcvfs.listdir('%s' % urllib.parse.quote_plus(xbmcvfs.translatePath(local_tmp_file)))
                (dirs, files) = xbmcvfs.listdir('%s' % xbmcvfs.translatePath(local_tmp_file))



RE: service.subtitles.subscene - nusstu - 2021-12-28

Hi @AnonTester ,

Thanks for the detailed explanation, yes I'm technical and I understand Python code.  Actually, I was able to resolve this by using ZipFile library's namelist() function instead. I will try your suggested fix when my time permits. Thanks once again for the quick reply.


RE: service.subtitles.subscene - AnonTester - 2021-12-28

@nusstu,
Great you found a workaround. Unfortunately using the ZipFile library wouldn't work with rar archives, so any feedback would be great when you've got some time to test. In the meantime, if you could send me your adjustment code, I could at least add a specific Android check for zip files to the add-on as a temporary partial fix and push it to my repo.