-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
44 lines (34 loc) · 1017 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import wikipedia
import time as t
import pyttsx3
import pylivestream
#------------------------------------------------------
# get data from wikipedia.
def getRandom():
def requests():
for i in range(11):
ranPageName = wikipedia.random(pages= 10)
if (i == 10):
t.sleep(2)
requests()
return getData(ranPageName)
requests()
return requests()
def getData(ranPageName):
pagedata = wikipedia.summary(ranPageName)
saySumm(pagedata)
#------------------------------------------------------
# say the summary using pyttsx
def saySumm(pagedata):
engine = pyttsx3.init()
engine.say(pagedata)
engine.runAndWait()
#------------------------------------------------------
# stream the audio to youtube
def makeLive():
pylivestream.Screenshare(ini: stream.ini, youtube)
pylivestream.Screenshare.startlive()
#------------------------------------------------------
while True:
getRandom()
makeLive()