-
Notifications
You must be signed in to change notification settings - Fork 159
/
info.py
36 lines (28 loc) · 878 Bytes
/
info.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
import os
import shutil
import tempfile
from sys import argv
from dotenv import load_dotenv
from utils import exec, uploader, genrepair, bit_rate, maxbit_rate, video_duration
load_dotenv()
def main():
d = tempfile.mkdtemp()
os.chdir(d)
name = 'video%s' % os.path.splitext(argv[1])[1]
shutil.copyfile(argv[1], name)
bitrate = bit_rate(name)
maxbitrate = maxbit_rate(name)
duration = video_duration(name)
repaircmd = genrepair(name, name, uploader().MAX_BYTES)
os.system('clear')
print('\n=================================')
print('file: %s' % argv[1])
print('size: %s' % os.path.getsize(name))
print('bitrate: %s' % bitrate)
print('max_bitrate: %s' % maxbitrate)
print('duration: %s' % duration)
print('genrepair: %s' % repaircmd)
print('=================================\n')
exec(['rm', '-rf', d])
if __name__ == '__main__':
main()