Advertisement
Guest User

subs2file

a guest
Jun 25th, 2018
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.55 KB | None | 0 0
  1. function write_file(video, timestamp, subs)
  2.   file = io.open("C:\\users\\desu\\desktop\\subs.txt", "a")
  3.   file:write("##########################################\n")
  4.   file:write(video .. "|" .. timestamp .."\n".. subs .. "\n")
  5.   file:close()
  6. end
  7.  
  8. function subs2file()
  9.   local subtext = mp.get_property("sub-text","")
  10.   local timestamp = mp.get_property("time-pos")
  11.   local video = mp.get_property('filename')
  12.   write_file(video, timestamp, subtext)
  13.   mp.osd_message("Copied subs to file ", 2)
  14. end
  15.  
  16. mp.add_key_binding("a", "subs2file", subs2file)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement