Error downloading subtitle
#1
Hi,

What could be the reason of getting this error when downloading subtitle?
Code:
CGUIDialogSubtitles::OnDownloadComplete - Saving of subtitle <source_path/sub_name.format> to <special://temp/sub_name.format> failed
Reply
#2
(2023-03-31, 01:19)burekas Wrote: What could be the reason of getting this error when downloading subtitle?

One single incomplete line entry from the log... This must be the new Weekend Puzzle. :-)

In general, Kodi has no write access to wherever location your video resides, to save/store the subtitle next to its video. So whatever device and/or network storage you have Kodi or your media on (be it a PC computer, Android box or Smart Air Fryer), there is no writing of files allowed.
Reply
#3
@Klojum 
But this is strange.

My subtitles addon builds the subtitle list from multiple sources.
On two of them the subtitles are downloaded and activated, while with the other two I'm getting this error.
The subtitle file on the first two are basically extracted from a zip file, while the other two are generated as a new text file from the http response.
But if I restart my PC the error is gone, but returns after fet download actions.

The subtitles storage location is "Next to the video"

In addition I give kodi write permissions, the Application Control settings are enabled, the "Allow file renaming and deletion" is enable. And I run as an administrator.
So I don't think it is permission issue.
Also other subtitles addons does download and activate with the same video file.


General question, after downloading/creating the subtitle file, what actually done? It copied it to the cache folse (special://temp), or put it directly in the video directory (As set in the Settings?)
Because sometime I see it there and sometimes not.
Reply
#4
So far you've given the most minimal amount of redacted log information on your Kodi setup possible : a single line.

The default action for all subtitle add-ons AFAIK is to store the subtitle file next to the video file to have consistency.

"Allow file renaming and deletion" has nothing to do with the Windows OS file permissions. So double check them.
Reply
#5
I will try to produce a clean log with the error.
As I said, after I restart my PC, the error is gone, but after few download actions it start on specific subtitles from specific providers.

From the log I don't see anthing special except the error I posted.
Reply
#6
But if there was a permissions issue, non of the subtitles were downloaded, so this is not the case here.
Maybe it is a strange cache issue that start on specific condition.
Reply
#7
(2023-03-31, 16:46)burekas Wrote: so this is not the case here.

Okay.
Reply
#8
@Klojum 

Ok I found the reason, it's python issue and I don't know why.

Some of the subtitles are downloaded as zip file and extracted with this code:
python:
with contextlib.closing(ZipFile(archive_file , "r")) as z:
    z.extractall(MySubFolder)

Some of the subtitles are built as a new text file with this code for example:
python:
local_file = open(MySubFolder, "w" + "b")
d = zlib.decompressobj(16+zlib.MAX_WBITS)
data = d.decompress(base64.b64decode(result["data"][0]["data"]))
local_file.write(data)
local_file.close()

Even though I'm running this code before:
python:

try:
    shutil.rmtree(MySubFolder)
except:
    pass
xbmcvfs.mkdirs(MySubFolder)

For unknown reason when the sub is build with the second code after a sub was build previously with the first code, Kosi raises the error I mentioned.
When I put a different path in the second code the error doesn't exist.
Reply
#9
Any news on this?
It looks like I'm having the same or similar problem.
I recently changed the addon from opensubtitles.org to .com and it stopped working.
Ubuntu 20.04 and the latest kodi available.
Reply
#10
Yeah, same here. org worked, com doesn't. This is with Android so it doesn't seem to be platform dependent.
Reply
#11
opensubtitles.com is the new site, and they have a new api now for that domain, read there docs.
But I think it's not relates to the issue here.
Any way I did a workaround here and I'm using two different pathes to avoid this error.
Reply
#12
Yeah. Opensubtitles.com addon fails with this exact same error. It downloads the sub correctly to temp folder but can't move it to location.
Reply
#13
(2024-01-04, 09:46)Zuikkis Wrote: Yeah. Opensubtitles.com addon fails with this exact same error. It downloads the sub correctly to temp folder but can't move it to location.
I think the error is misleading, it doesn't download the subtitle but the API gives error 400 when it tries to connect to the site.
Reply
#14
In my case it was an error in the username, once corrected it started working.
Probably a clearer error message would help.
Reply
#15
Thanks for the info, I tested it again, looks like the wen site accepts either email or username to log in but the API works only with username.
I changed the login to the username and it worked.
Reply

Logout Mark Read Team Forum Stats Members Help
Error downloading subtitle0