-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.py
More file actions
45 lines (41 loc) · 991 Bytes
/
cli.py
File metadata and controls
45 lines (41 loc) · 991 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
40
41
42
43
44
import argparse
def get_cli_args():
"""Parse args from cli"""
parser = argparse.ArgumentParser(
prog='streamit',
description='Stream videofiles to Youtube',
)
parser.add_argument(
'path',
type=str,
default='video',
help='folder with videofiles',
)
parser.add_argument(
'-k',
'--key',
type=str,
required=True,
help='youtube stream key',
)
parser.add_argument(
'-u',
'--url',
type=str,
default='rtmp://a.rtmp.youtube.com/live2',
help='youtube stream url',
)
parser.add_argument(
'-b',
'--break_every',
type=int,
help='Break stream every x seconds',
)
parser.add_argument(
'-t',
'--break_timeout',
type=int,
default=180,
help='Delay in seconds between streams which are created by --break_every key',
)
return parser.parse_args()