From 7942a36bfc0c96eaedce99c3cd9bf575654b0ff9 Mon Sep 17 00:00:00 2001 From: Tangent Date: Sat, 20 Jan 2024 04:17:51 -0700 Subject: [PATCH] subtitle downloaded added without modification --- download-subtitles.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 download-subtitles.lua diff --git a/download-subtitles.lua b/download-subtitles.lua new file mode 100644 index 0000000..e775a76 --- /dev/null +++ b/download-subtitles.lua @@ -0,0 +1,12 @@ +local source = "URL" + +os.execute("yt-dlp --flat-playlist --print-to-file \"%(id)s\" download-list.txt --skip-download \"" .. source .. "\"") +os.execute("yt-dlp --flat-playlist --print-to-file \"%(id)s=%(title)s\" VIDEO-TITLES.txt --skip-download \"" .. source .. "\"") +os.execute("mkdir subtitles") + +for line in io.lines("download-list.txt") do + os.execute("chromium \"https://www.downloadyoutubesubtitles.com/?u=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D" .. line .. "\"") + os.execute("sleep 12") + os.execute("curl \"https://www.downloadyoutubesubtitles.com/get2.php?i=" .. line .. "&format=txt&hl=en&a=\" > \"./subtitles/" .. line .. ".txt\"") + os.execute("sleep 6") +end