Saving subtitles found by the VLC extension "Subtitle Finder"?

6,545

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.

Share:
6,545

Related videos on Youtube

Community
Author by

Community

Updated on September 18, 2022

Comments

  • Community
    Community over 1 year

    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.

  • Admin
    Admin about 11 years
    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
  • thePanz
    thePanz about 11 years
    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
  • Admin
    Admin about 11 years
    @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/…)