Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change subtitle download directory #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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