mirror of
https://github.com/TangentFoxy/.lua-files.git
synced 2024-11-20 21:34:23 +00:00
organization of command options
This commit is contained in:
parent
72a474e7cf
commit
15013d02fe
12
video-dl.lua
12
video-dl.lua
@ -37,18 +37,22 @@ else
|
|||||||
-- "--file" is handled just before execution
|
-- "--file" is handled just before execution
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local core_command = "yt-dlp --retries 100 "
|
||||||
|
local metadata_options = "--write-sub --write-auto-sub --sub-lang \"en.*\" --write-thumbnail --write-description "
|
||||||
|
local quality_ceiling_720 = "-f \"bestvideo[height<=720]+bestaudio/best[height<=720]\" "
|
||||||
|
|
||||||
local execute = {
|
local execute = {
|
||||||
backup = function(url)
|
backup = function(url)
|
||||||
os.execute("yt-dlp --retries 100 --write-sub --write-auto-sub --sub-lang \"en.*\" --write-thumbnail --write-description -f \"bestvideo[height<=720]+bestaudio/best[height<=720]\" \"" .. url .."\"")
|
os.execute(core_command .. metadata_options .. quality_ceiling_720 .. url:enquote())
|
||||||
end,
|
end,
|
||||||
music = function(url)
|
music = function(url)
|
||||||
os.execute("yt-dlp --retries 100 -x --audio-quality 0 \"" .. url .."\"")
|
os.execute(core_command .. "-x --audio-quality 0 " .. url:enquote())
|
||||||
end,
|
end,
|
||||||
metadata = function(url)
|
metadata = function(url)
|
||||||
os.execute("yt-dlp --retries 100 --write-sub --write-auto-sub --sub-lang \"en.*\" --write-thumbnail --write-description --skip-download \"" .. url .."\"")
|
os.execute(core_command .. metadata_options .. "--skip-download " .. url:enquote())
|
||||||
end,
|
end,
|
||||||
video = function(url)
|
video = function(url)
|
||||||
os.execute("yt-dlp --retries 100 -f \"bestvideo[height<=720]+bestaudio/best[height<=720]\" \"" .. url .. "\"")
|
os.execute(core_command .. quality_ceiling_720 .. url:enquote())
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
execute.clone = execute.backup
|
execute.clone = execute.backup
|
||||||
|
Loading…
Reference in New Issue
Block a user