opensubtitlesdev / service.subtitles.opensubtitles-com

Opensubtitles.com Kodi extension
GNU General Public License v2.0
10 stars 13 forks source link

Exception: ERROR: This is not rar file. #4

Open Sopor opened 1 year ago

Sopor commented 1 year ago

I get this error message when i try to search for subtitles:

2023-01-26 23:45:34.280 T:8588    error <general>: XFILE::CDirectory::GetDirectory - Error getting plugin://service.subtitles.opensubtitles-com/?action=search&languages=English%2cSwedish&preferredlanguage=Swedish
2023-01-26 23:45:37.806 T:11404   error <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'Exception'>
                                                   Error Contents: ERROR: This is not rar file.
                                                   Traceback (most recent call last):
                                                     File "E:\Utils\Media\Kodi 20\portable_data\addons\service.subtitles.opensubtitles-com\service.py", line 8, in <module>
                                                       SubtitleDownloader().handle_action()
                                                     File "E:\Utils\Media\Kodi 20\portable_data\addons\service.subtitles.opensubtitles-com\resources\lib\subtitle_downloader.py", line 58, in handle_action
                                                       self.search()
                                                     File "E:\Utils\Media\Kodi 20\portable_data\addons\service.subtitles.opensubtitles-com\resources\lib\subtitle_downloader.py", line 63, in search
                                                       file_data = get_file_data(get_file_path())
                                                     File "E:\Utils\Media\Kodi 20\portable_data\addons\service.subtitles.opensubtitles-com\resources\lib\file_operations.py", line 27, in get_file_data
                                                       item["file_size"], item["moviehash"] = hash_file(item["file_original_path"], item["rar"])
                                                     File "E:\Utils\Media\Kodi 20\portable_data\addons\service.subtitles.opensubtitles-com\resources\lib\file_operations.py", line 35, in hash_file
                                                       return hash_rar(file_path)
                                                     File "E:\Utils\Media\Kodi 20\portable_data\addons\service.subtitles.opensubtitles-com\resources\lib\file_operations.py", line 67, in hash_rar
                                                       raise Exception("ERROR: This is not rar file.")
                                                   Exception: ERROR: This is not rar file.
                                                   -->End of Python script error report<--

I'm playing directly from a RAR archive, so the addon will search for the subtitles using the file name.

Kodi 20 on Windows 10

roxsman commented 6 months ago

Getting the exact same error in kodi log when searching for subs using opensubtitles.com addon. Kodi 20.1 on Libreelec 11.0.1

might be obvious but just to be clear; this happens when there's RAR files in the specific media folder. If the folder only contains an MKV file or something similar, the search works as expected.
roxsman commented 2 months ago

Not judging, just curious; is this repo being maintained?

opensubtitlesdev commented 1 month ago

well you can check the close tickets to answer that question

https://github.com/opensubtitlesdev/service.subtitles.opensubtitles-com/issues?q=is%3Aissue+is%3Aclosed

We don't have a fix for these RAR files yet, but it's explained above that it works once decompressed, so don't use .rar files.