5

I found a VLC script called 'Subtitle finder' (here) that downloads and displays video subtitles 'on-the-fly': they are downloaded and displayed during playback, and it works great, but does not saves subtitle file for the future: the whole procedure has to be restarted each time. (See this answer.)

enter image description here

enter image description here

enter image description here

While the script says ‘Download subtitles’, I imagine they are downloaded and saved temporarily during playback: where are they downloaded? can I manually save them for future use?

Maybe someone could find the answer by taking a look at the script.

5

It looks like it stays in memory to me. A similar plugin that just downloads the subtitles file from opensubtitles is probably going to be your answer by using some of that code and modifying around line:

--vlc.msg.dbg("[Subtitles] File found in the archive: " .. srturl .. extension)  

The one line edit below is BAD, but gets it not broken for unix-like OS-es only. For the script to be cross platform it needs OS detection logic:

if(item ~= nil) then
  local name = item:uri()
  vlc.msg.info("NAME: "..name)
  name = vlc.strings.decode_uri(string.gsub(name, "file:///", ""))      
  name = "/"..name
  vlc.msg.info(""..name.."."..language.."."..extension)
  vlc.msg.info("[Subtitle-download] saving subtitle to: "..name.."."..language.."."..extension)
  local fsout = assert(io.open(name.."."..language.."."..extension, "w"))
  fsout:write(dataBuffer)
  assert(fsout:close())
end

If someone running Windows VLC is interested in testing a patch that gets saving working on both Linux and Windows, check this pull request.

Evidently someone has tacked on some enhancements including the patch here.


This version here works in Linux (as well as in Windows) to save subtitles.

  • your patch added to mederi's, so this works in Linux/Ubuntu (forum.videolan.org/…). may be added to answer, for it looks like the best form for the moment. i've tested it and works fine, except when different versions of the script are installed at the same time – user47206 Apr 1 '13 at 23:12
  • 1
    I?m the developer of VLC-Subtitles-Finder git repository, thanks to Ciprus's efforts I've updated the VLC script with Linux support. could you check the new online script? Thanks – thePanz Apr 4 '13 at 8:54
  • @thePanz - have tested the new modified version in both Windows and Linux and it works as expected. The script can be also found uploaded here (docs.google.com/file/d/0B35PbjeIaccqcFhRRDVkdmhzTXc/…) – user47206 Apr 5 '13 at 17:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy