-
Notifications
You must be signed in to change notification settings - Fork 14
/
main.py
24 lines (20 loc) · 898 Bytes
/
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
import argparse
import sys
from manager import TwitchManager
def main():
parser = argparse.ArgumentParser()
parser.add_argument("-n", "--streams-to-log", dest="channels_amount", type=int,
help="the number of streams to log", default=100)
parser.add_argument("-f", "--log-filename", dest="log_filename",
help="the filename to log to", default=None)
parser.add_argument("-c", "--channels", dest="channels", type=str, nargs='+',
help="the specific channel names to log", default=[])
args = parser.parse_args()
manager = TwitchManager(channels_amount=args.channels_amount, channels=args.channels, log_filename=args.log_filename)
try:
manager.run_log_loop()
except KeyboardInterrupt:
print 'Exiting gracefully...'
manager.stop_bot()
if __name__ == "__main__":
main()