Skip to content

Instantly share code, notes, and snippets.

@ema
Created October 12, 2011 11:12
Show Gist options
  • Save ema/1280940 to your computer and use it in GitHub Desktop.
Save ema/1280940 to your computer and use it in GitHub Desktop.
Lua VLC extension to download subtitles: dirty hack to wget the subtitles file
--- /home/ema/.local/share/vlc/lua/extensions/141787-subtitles-mod.lua 2011-09-09 18:13:22.000000000 +0200
+++ 141787-subtitles-mod.lua 2011-10-12 13:06:35.470947422 +0200
@@ -430,6 +430,12 @@
end
--vlc.msg.dbg("[Subtitles] Subtitle data: "..dataBuffer)
+ local subsfilename = "/tmp/\""..vlc.input.item():name()..".srt.zip\""
+
+ -- http://www.opensubtitles.org/en/subtitleserve/sub/3476865
+ vlc.msg.info("[Subtitles] Downloading this subs from: "..url.." to "..subsfilename)
+ os.execute("wget "..url.." -O "..subsfilename)
+
return true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment