-
Notifications
You must be signed in to change notification settings - Fork 11
/
short.py
37 lines (30 loc) · 1.23 KB
/
short.py
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
import argparse
from lib.video_texts import update_config_file
from lib.shortcore import final_video
parser = argparse.ArgumentParser(description='short video')
parser.add_argument('-topic', dest='topic', type=str, help='Enter video topic. Example: top 10 survival video game')
parser.add_argument('-time', dest='time', type=str, help='video time in second')
parser.add_argument('-language', dest='language', type=str, help='video language')
parser.add_argument('-multi_speaker', dest='multi_speaker', type=str, help='Use multiple speakers in video')
parser.add_argument('-pexels_api', dest='pexels_api', type=str, help='get API from www.pexels.com')
args = parser.parse_args()
if (args.topic != None):
if(args.time != None):
time = args.time
else:
time = "30"
if(args.language != None):
language = args.language
else:
language = "english"
if(args.multi_speaker != None):
multi_speaker = args.multi_speaker
update_config_file('config.txt', 'multi_speaker', multi_speaker)
else:
multi_speaker = "no"
if(args.pexels_api != None):
pexels_api = args.pexels_api
update_config_file('config.txt', 'pexels_api', pexels_api)
final_video(args.topic,time,language,multi_speaker)
else:
print('Please enter a topic with "-topic"')