Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion autosub.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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)
Expand Down