-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmaster.py
More file actions
40 lines (31 loc) · 810 Bytes
/
master.py
File metadata and controls
40 lines (31 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from subprocess import call
import sys
import os
from download_playlist import *
from synthesize import *
from change_audio import *
# get playlist urls
link = sys.argv[1]
urls = get_urls(link)
print(urls)
save_metadata(link)
for url in urls:
# clear old video files
dir = "media/tmp/"
files = os.listdir(dir)
for file in files:
os.remove(os.path.join(dir,file))
vid = get_id(url)
call(["php", "dl_captions.php", vid])
dl_video(url)
# temp dl replacement
# call(["cp", "media/videos/test.mp4", dir])
# find video file
files = os.listdir(dir)
for file in files:
if (".mp4" in file):
vid_file = file
break
cap_file = vid + ".json"
synthesize(dir, cap_file)
change_audio(dir, vid_file, cap_file)