forked from walkofpain/PyStreamRecorder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpystreamrecorder.py
27 lines (21 loc) · 1.31 KB
/
pystreamrecorder.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
import schedule
import datetime
import time
import subprocess
URL = 'https://www.twitch.tv/bratishkinoff' # stream channel link (youtube/twitch/wasd/goodgame), youtube link with "/live"
quality = 'best' # choose quality (audio_only, worst, best)
text = '''
▒█▀▀█ █░░█ ▒█▀▀▀█ ▀▀█▀▀ █▀▀█ █▀▀ █▀▀█ █▀▄▀█ ▒█▀▀█ █▀▀ █▀▀ █▀▀█ █▀▀█ █▀▀▄ █▀▀ █▀▀█
▒█▄▄█ █▄▄█ ░▀▀▀▄▄ ░░█░░ █▄▄▀ █▀▀ █▄▄█ █░▀░█ ▒█▄▄▀ █▀▀ █░░ █░░█ █▄▄▀ █░░█ █▀▀ █▄▄▀
▒█░░░ ▄▄▄█ ▒█▄▄▄█ ░░▀░░ ▀░▀▀ ▀▀▀ ▀░░▀ ▀░░░▀ ▒█░▒█ ▀▀▀ ▀▀▀ ▀▀▀▀ ▀░▀▀ ▀▀▀░ ▀▀▀ ▀░▀▀
'''
print(text)
def job_function():
now = datetime.datetime.now()
outputfile = 'stream-'+str(now.day)+'-'+str(now.month)+'-'+str(now.year)+'-'+str(now.hour)+'-'+str(now.minute)+'.mp4'
command='streamlink ' + URL + ' '+ quality + ' -o ' + outputfile
subprocess.call(command, shell=True)
schedule.every(2).seconds.do(job_function)
while True:
schedule.run_pending()
time.sleep(0)