-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
executable file
·67 lines (47 loc) · 1.42 KB
/
main.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env python
"""
Why do people keep photographs?
Every command is launched sequentially from here.
"""
def run():
from wdpkp import setup
from wdpkp import requests
from wdpkp.utils import log
from wdpkp.movie import image
from wdpkp.movie import selection
from wdpkp.movie import ffmpeg
from wdpkp.movie import text
from wdpkp.utils import export
# from wdpkp.movie import subtitles
# Initialise
setup.configure()
log.info('PROGRAM START.')
log.time('start')
# Get input
words = setup.get_words()
# Make requests and parse responses
data = requests.get(words)
log.results(data, 'results-full')
# Edit the movie
data = selection.loop(data)
log.results(data, 'results-selection')
# adapt images to HD size
image.resize_images(data)
# make title & credit screens
text.title_screen()
credits_path = text.credit_screen(data)
# srt file, will be read on movie editing
# subtitles.create(data)
# image > movie editing
video_paths = ffmpeg.edit(data)
# add the credits and subtitles
master = ffmpeg.merge(video_paths, credits_path)
# small = ffmpeg.merge_small(video_paths, credits_path)
# delete temporary files
setup.cleanup(data, video_paths, credits_path)
# copy video to HTTP server
export.send(master)
# export.send(small)
log.info('ALL DONE!')
log.time('end')
run()