exebetche/vlsub

Unable to save subtitles on Linux

devxpy opened this issue · 86 comments

The directory and the file, both are owned by me.

I ran a chown -R dev:dev /home/dev just to make sure.

This is the absolute path to file /home/dev/Downloads/Westworld.S01E10.avi

⋊ ~> vlc --version
VLC media player 3.0.2 Vetinari (revision 3.0.2-0-gd7b653cf14)
VLC version 3.0.2 Vetinari (3.0.2-0-gd7b653cf14)
Compiled by root on builder.solus-project.com (Apr 30 2018 13:00:12)
Compiler: gcc version 7.3.0 (Solus)

image

I'm having the same issue on Arch linux (manjaro-i3).

Seems like currently the only solution is to use the latest nightly version of vlc #214

The nightly version of vlc have a different version of this same plugin.

While the latest version here is:
https://github.com/exebetche/vlsub/blob/master/vlsub.lua
local app_version = "0.10.2";

The real latest version is:
https://github.com/videolan/vlc/blob/master/share/lua/extensions/VLSub.lua
version = "0.11.0",

I tried to use the new plugin with older VLC but had some "vlc.io.names" errors, don't know how to fix, as the older uses "io.names" and just changing this won't work (VLC api changes maybe?). Didn't go further as I don't know Lua and missed where the "zip" changes from the old version.

I really wish this was built on python, not Lua

I had the same issue on ubuntu, I found out the the cache folder is missing. Creating the cache folder fixed the issue for me.
mkdir ~/.cache/vlc

I have the cache folder where it should be..

@gilelias mkdir ~/.cache/vlc this did it for me on ubuntu 18

⋊ ~> cd ~/.cache/vlc
⋊ ~/.c/vlc> ls
 art/
'Tomb.Raider.2018.720p.WEB-DL.H264.AC3-EVO (CHI).srt.gz'
 Tomb.Raider.2018.720p.WEB-DL.H264.AC3-EVO-HI.srt.gz
 Tomb.Raider.2018.720p.WEB-DL.H264.AC3-EVO.srt.gz
 Westworld.S02E08.720p.WEB.H264-DEFLATE.srt.gz
 Westworld.S02E09.720p.WEB.H264-DEFLATE.srt.gz

@gilelias worked like a charm, thanks!

canf commented

mkdir ~/.cache/vlc worked, thanks!

mkdir ~/.cache/vlc
Worked like a magic
thanks!

What about VLC snap installs? will it still makes sense to create a ~/.cache/vlc in the home folder??
I am a complete noob when it comes to snaps but for all I can see they do not follow the same installation route as regular deb packages, they seem to create its own strcture under the ~/snap folder

Try to make the .cache folder in the snap folder inside the common in the vlc folder.
mkdir ~/snap/vlc/common/.cache
@sergiotca

Hi Mostafa, I did figure that out a few weeks ago. It does work btw. Thank you anyway.

I have tried all alternatives above without susscess in Ubuntu 18.04... i'll still waiting for a definitive solution.

@gilelias This worked for me on Ubuntu 18.04

atay commented

I came here because I had issues with downloading subtitles (some of them worked, some not, gz file was downloaded, but subtitles were not found).

I found out that VLSub 0.11 assumes that opensubtitles SubFormat must be same as file extension, which is not correct for many records in opensubtitles.

I prepared a version with fix that searches for a file instead of extension and it works perfectly for me. If someone has same issue as I had, feel free to replace VLSub.luac file (located in /usr/lib/x86_64-linux-gnu/vlc/lua/extensions/VLSub.luac on ubuntu) with that one:
https://mega.nz/#F!jHIhUIBY!Dm0p-QGaUnBGhckEl9JxUw

Also lua file included in case if someone would like to check/compile that file by himself.

The same is happening to me on mac. Can someone guide on how to get it fixed there.

@rafiron try switching to Iina it works awesome on mac and has subtitle download build in with multiple providers to choose from

Ubuntu 18, Cache folder in ~/.cache/vlc did the trick for me.

@gilelias VLC downloads the .srt.gz but to ~/.config/vlc but then it hangs. Like it can't gunzip and copy.
Gentoo 2.4.1

@gilelias Thanks for this. Was annoyed by this for a while and finally stopped being lazy and looked into it.

recreating the .cache/vlc directory fixed the issue for me on arch.

how did you think to look for the cache folder? did you see it complain it was missing somewhere? wished the error for this had been more verbose.

Like @Jarshvor, I'm very interested to learn how @gilelias managed to find out this solution (which also did the trick for me).

@Jarshvor @poupougnac I was debugging vlsub code and checked where and why mess_save_fail appears.
I just realized that I have older version of vlsub. I guess b3513c5 should fix the issue.

I see.. so pretty much under the hood.
=) thanks for that and for the info. Will keep it in mind for next time I encounter something similar.

In Lubuntu 18.0.4.1 LTS, guys, for some reason I don't fully understand, creating the "cache" folder under the "root" user, VLC still wasn't loading my subtitles. Yet, when I've exited and re-created it under the user I've installed Lubuntu initially, mkdir ~/.cache/vlc worked like a charm.

@iuliandonici well, makes sense if you are running vlc from that user account no?

if you start vlc from your normal user account (which you should) then it will look for the .cache folder in your home directory. i.e: ~

Looks like this is fixed now on 3.0.4

It still displays an error, but it loads the subtitle, regardless.

Big thanks to @xpaum for the fix!

image

@gilelias mkdir ~/.cache/vlc this did it for me on ubuntu 18

Also work for me on Fedora 27, vlc 3.0.5

I'm still getting this error with Ubuntu 18.04 and VLC from Snap version 3.0.4

darkhole@devolo:~$ snap info vlc
name:      vlc
summary:   The ultimate media player
publisher: VideoLAN✓
contact:   https://www.videolan.org/support/
license:   unset
description: |
  VLC is the VideoLAN project's media player.
  
  Completely open source and privacy-friendly, it plays every multimedia file
  and streams.
  
  It notably plays MKV, MP4, MPEG, MPEG-2, MPEG-4, DivX, MOV, WMV, QuickTime,
  WebM, FLAC, MP3, Ogg/Vorbis files, BluRays, DVDs, VCDs, podcasts, and
  multimedia streams from various network sources. It supports subtitles,
  closed captions and is translated in numerous languages.
commands:
  - vlc
snap-id:      RT9mcUhVsRYrDLG8qnvGiy26NKvv6Qkd
tracking:     stable
refresh-date: 2018-09-08
channels:                                        
  stable:    3.0.4                   (555) 204MB -
  candidate: 3.0.4                   (555) 204MB -
  beta:      3.0.4-224-gffb4ac0      (694) 212MB -
  edge:      4.0.0-dev-5362-gaf740a6 (695) 247MB -
installed:   3.0.4                   (555) 204MB -

VLsub, according to the window, is version 0.11.0

+1
ubuntu desktop 18.04.1
snap VLC 3.0.4
vlsub 0.11.0
~/.cache/vlc exists and is owned by me, has rwx permissions
~/snap/vlc/common/.cache exists and is owned by me, has rwx permissions

still getting the "Error: Unable to save subtitles Click here to open the file"

EDIT:
Also, just tried the edge: 4.0.0-dev-5377-g0667915 snap and still get the same issue.

Ok will reopen this...

I´ve noticed that the problem is getting file from opensubtitles server

I also missed the cache folder. Creating it fixed the issue on Kubuntu 18.10

But....had somebody reported that upstream? It has been 7 months since the bug was reported

I reported it upstream

medjo commented

+1
ubuntu desktop 18.04.1
snap VLC 3.0.4
vlsub 0.11.0
~/.cache/vlc exists and is owned by me, has rwx permissions
~/snap/vlc/common/.cache exists and is owned by me, has rwx permissions
still getting the "Error: Unable to save subtitles Click here to open the file"
EDIT:
Also, just tried the edge: 4.0.0-dev-5377-g0667915 snap and still get the same issue.

Same as this, even with vlc 3.0.5

Same as this with vlc 3.0.6

I had the same issue on ubuntu, I found out the the cache folder is missing. Creating the cache folder fixed the issue for me.
mkdir ~/.cache/vlc

good workaround

this trick also helps on:
Distributor ID: Ubuntu
Description: Ubuntu 18.10
Release: 18.10
Codename: cosmic

I had the same issue on ubuntu, I found out the the cache folder is missing. Creating the cache folder fixed the issue for me.
mkdir ~/.cache/vlc

Thanks

In Lubuntu 18.0.4.1 LTS, guys, for some reason I don't fully understand, creating the "cache" folder under the "root" user, VLC still wasn't loading my subtitles. Yet, when I've exited and re-created it under the user I've installed Lubuntu initially, mkdir ~/.cache/vlc worked like a charm.

Worked for me!

mads2 commented

Problem persist on a fresh Raspbian install followed by apt update & apt upgrade and apt install vlc.
Raspbian 9 (stretch) 4.14.98-v7+
VLC 3.0.6 Vetinari

mkdir ~/.cache/vlc fixed it though.

For anyone still having problems
if mkdir ~/.cache/vlc did not work with you.

try mkdir ~/snap/vlc/common/.cache/vlc

That worked for me since I installed VLC via snap, alternatively try to find where your VLC folder is and create a vlc folder inside the .cache folder.

Cheers

The directory is present and I can see some .gz files there... but it seems they fail to be extracted and, hence, it still gets stuck

Happens with VLC 3.0.6 on Ubuntu 19.04

The workaround mkdir ~/.cache/vlc works! Thank you!

For people who still have the issue, just goto home/snap/vlc/common/.cache folder and delete the vlc folder there and then make a new folder name it vlc. I hope that'll work. :)

Thanks works fine with: mkdir ~/snap/vlc/common/.cache/vlc

First i try this on my ubuntu 18.04 but didn't work.
mkdir ~/.cache/vlc did not work with you

Thanks works fine with: mkdir ~/snap/vlc/common/.cache/vlc

First i try this on my ubuntu 18.04 but didn't work.
mkdir ~/.cache/vlc did not work with you

So ... I guess you're running VLC as / from a snap package ... ?

@sanderjo yes i checked and it is from snap package

For anyone still having problems
if mkdir ~/.cache/vlc did not work with you.

try mkdir ~/snap/vlc/common/.cache/vlc

That worked for me since I installed VLC via snap, alternatively try to find where your VLC folder is and create a vlc folder inside the .cache folder.

Cheers

Worked for me, the missing part was to create vlc directory inside .cache

For anyone still having problems
if mkdir ~/.cache/vlc did not work with you.

try mkdir ~/snap/vlc/common/.cache/vlc

That worked for me since I installed VLC via snap, alternatively try to find where your VLC folder is and create a vlc folder inside the .cache folder.

Cheers

This worked for me!

For anyone still having problems
if mkdir ~/.cache/vlc did not work with you.
try mkdir ~/snap/vlc/common/.cache/vlc
That worked for me since I installed VLC via snap, alternatively try to find where your VLC folder is and create a vlc folder inside the .cache folder.
Cheers

Worked for me, the missing part was to create vlc directory inside .cache

Ubuntu 18.04, vlc 3.0.6 - deleting and recreating worked for me.

mkdir ~/snap/vlc/common/.cache/vlc

Worked for me on Ubuntu 19.04

So, over a year later, and still somehow adding a couple lines of code for the add-on to check for existence of the cache folder and create if necessary is still only a dream.

Or better yet, not even require an intermediate cache, and just decompress the stream in memory. Not a Lua developer, so not sure if that is trivial or not, but that would be the preferred way to accomplish it in every other language I am familiar with. The need for a cache on disk for a subtitle seems kinda like redundant.

i would like a possibility to save subtitle same directory where video file is.

i would like a possibility to save subtitle same directory where video file is.

That is already how it works, the cache is just a step in the middle.

mkdir ~/snap/vlc/common/.cache/vlc

Worked for me on Ubuntu 19.04

The only solution that worked for me, thanks.

Ensuring the existence ~/.cache/vlc (or ~/snap/vlc/common/.cache/vlc with snap) will fix the issue, though I discovered using cleaner tools such as Bleachbit will delete the cache, so make sure to add that folder to the whitelist.

Still think using the .cache folder is not the best solution. If temporarily storing intermediate files on disk is unavoidable for some reason, the /tmp or /var/tmp directory would be far more appropriate, as they are "temporary" files, and not being used for caching. Would also eliminate this issue.

mkdir ~/.cache/vlc didn't work for me at first in Manjaro KDE 18.1.Then i deleted the cache folder using rmdir ~/.cache/vlc and again run mkdir ~/.cache/vlc ,this worked for me.

For anyone still having problems
if mkdir ~/.cache/vlc did not work with you.
try mkdir ~/snap/vlc/common/.cache/vlc
That worked for me since I installed VLC via snap, alternatively try to find where your VLC folder is and create a vlc folder inside the .cache folder.
Cheers

Worked for me, the missing part was to create vlc directory inside .cache

For me also the missing part was vlc inside .cache 😆
I'm running vlc 3.0.7 on ubuntu 19.04
IMO @devxpy can close this issue

for some of you who already had VLC folder in .cache , try deleting the vlc folder and recreating it with mkdir ~/.cache/vlc and then restart vlc. this is what worked for me (and is somewhat alluded to in previous comments)

@gilelias the mkdir ~/.cache/vlc worked for me too!!!

still an issue.. Devs can this folder please be created as part of the install(s)

@gilelias's solution mkdir ~/.cache/vlc worked for me too on 19.10 😄

mkdir ~/.cache/vlc worked for me too

Fedora 31
vlc-3.0.9-22.fc31.x86_64

Same here
Arch 4.19.85-1-lts x86_64
vlc 3.0.8-6

The command mkdir ~/.cache/vlc worked for me.
Thanks gilelias
Xubuntu 19.10
VLC 3.0.8 Vetinari

mkdir ~/.cache/vlc seems to have worked for most folks. some had to delete an existing vlc folder in the ~/.cache directory, recreate it with mkdir and then restart vlc.

mkdir ~/snap/vlc/common/.cache/vlc in case you are using the snap.
Restart VLC is necessary here.

mkdir ~/.cache/vlc seems to have worked for most folks. some had to delete an existing vlc folder in the ~/.cache directory, recreate it with mkdir and then restart vlc.

mkdir ~/snap/vlc/common/.cache/vlc in case you are using the snap.
Restart VLC is necessary here.

It didn't work for me, either of them. I'm using Raspbian, a Debian based OS for raspberry pi.
I will investigate the subject but I'll accept any help or guidance you can give.

For anyone still having problems
if mkdir ~/.cache/vlc did not work with you.

try mkdir ~/snap/vlc/common/.cache/vlc

That worked for me since I installed VLC via snap, alternatively try to find where your VLC folder is and create a vlc folder inside the .cache folder.

Cheers

This worked for me! It seems that if you have installed vlc using snap then you need to create the
mkdir ~/snap/vlc/common/.cache/vlc while @gilelias answer mkdir ~/.cache/vlc works if you installed vlc with a regular package manager like apt or apt-get on Ubuntu. If you are using another distro, probably the mkdir ~/.cache/vlc would be the correct place.

Try to make the .cache folder in the snap folder inside the common in the vlc folder.
mkdir ~/snap/vlc/common/.cache
@sergiotca

The correct command is:
mkdir ~/snap/vlc/common/.cache/vlc

The command mkdir ~/.cache/vlc worked for me.
Thanks gilelias
Xubuntu 19.10
VLC 3.0.8 Vetinari

Same here!

So, over a year later, and still somehow adding a couple lines of code for the add-on to check for existence of the cache folder and create if necessary is still only a dream.

Or better yet, not even require an intermediate cache, and just decompress the stream in memory. Not a Lua developer, so not sure if that is trivial or not, but that would be the preferred way to accomplish it in every other language I am familiar with. The need for a cache on disk for a subtitle seems kinda like redundant.

Why is it still not fixed in a proper way in master branch? The solution is found, yet it's not incorporated in the code, and it is not the optimal one on top of that.

Also still a problem on Ubuntu 20.04, with VLC Vetinari 3.0.8. Annoying.
And the mkdir ~/.cache/vlc solved it for me.

So the Debian / Ubuntu packagers don't want to or can't solve this? I thought the correct lua script was already available? Is it a matter of principle that nobody solves this?

Clear Linux. flapack of VLC Vetinari 3.0.8. Same issue
mkdir ~/.cache/vlc did not work
please advise

Hello to everyone interested in this bug. A few years ago VLSub was incorporated directly into VLC. That's why I think this bug has been ignored here. I have created a bug report with the VLC team at their tracker. If you think you can add any useful information to help the developers fix it please chip in!

The ticket has been closed with: "Already fixed in 3.0.9.1 "
Now, if I could find a way to install a newer version...

Clear Linux. flapack of VLC Vetinari 3.0.8. Same issue
mkdir ~/.cache/vlc did not work
please advise

flathub/org.videolan.VLC#70

e5pe commented

For anyone still having problems
if mkdir ~/.cache/vlc did not work with you.

try mkdir ~/snap/vlc/common/.cache/vlc

That worked for me since I installed VLC via snap, alternatively try to find where your VLC folder is and create a vlc folder inside the .cache folder.

Cheers

Worked for me in Ubuntu budgie 20.04, thanks :)

Holy cow... its year 2020, and i still have to execute mkdir ~/.cache/vlc, in every linux distro i install. How hard it is to fix this? how many years until this can be done automatically by the install process?

Holy cow... its year 2020, and i still have to execute mkdir ~/.cache/vlc, in every linux distro i install. How hard it is to fix this? how many years until this can be done automatically by the install process?

Cuz the last commit was 3 years ago :-:

I had the same issue on ubuntu, I found out the the cache folder is missing. Creating the cache folder fixed the issue for me.
mkdir ~/.cache/vlc

this worked for me as well ... thank you... (linuxmint 19.1 Cinnamon)

jadia commented

I forgot that I installed VLC using snap. mkdir ~/.cache/vlc did not help me.

mkdir ~/snap/vlc/common/.cache/vlc worked like a charm on Ubuntu 20.04.

My OS: Raspbian GNU/Linux 10 (buster)
Kernel: Linux 5.10.11-v7+
VLC Ver: 3.0.12 Vetinan

The following steps worked for me:

  1. While VLC is open, delete the vlc directory
    sudo rm -r ~/.cache/vlc/

  2. Create the vlc directory:
    mkdir ~/.cache/vlc

  3. Close VLC

  4. Open VLC

When you download a subtitle, it still gives the error "Unable to save subtitles in folder, using config folder", but it works.