From a05058fec3816380c7199e1e9d158d7164af6123 Mon Sep 17 00:00:00 2001 From: Raoul Engelbrecht <62550766+glaceorizer@users.noreply.github.com> Date: Wed, 19 Apr 2023 22:21:34 +0200 Subject: [PATCH] Change subtitle download directory Added the option to specify a directory name where the subtitle files should be stored. Replace '\\Subtitles' with '/Subtitles' if you are using Linux / MacOS. --- autosub.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/autosub.lua b/autosub.lua index f399f52..12ede99 100644 --- a/autosub.lua +++ b/autosub.lua @@ -61,6 +61,7 @@ local includes = { -- Full paths are also allowed, e.g.: -- '/home/david/Videos', } +local subfolderName = '\\Subtitles' -- Name of the subfolder; leave empty if they should be stored in the root directory --============================================================================= local utils = require 'mp.utils' @@ -98,10 +99,13 @@ function download_subs(language) a[#a + 1] = 'utf-8' end + os.execute("mkdir " .. directory .. subfolderName) -- Create system folder with the previously specified name + local savepath = directory .. subfolderName + a[#a + 1] = '-l' a[#a + 1] = language[2] a[#a + 1] = '-d' - a[#a + 1] = directory + a[#a + 1] = savepath a[#a + 1] = filename --> Subliminal command ends with the movie filename. local result = utils.subprocess(table)