-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
42 lines (29 loc) · 899 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
import praw
import numpy as np
import random
import video
import upl
import time
from better_profanity import profanity
profanity.load_censor_words()
def reddit():
reddit = praw.Reddit(client_id='T0cozH9DKJuwOyl-vPPm9A',
client_secret='C8OIu_6OS2Uu-r1WlU7jdUEVjXx4cw', user_agent='python-script')
subreddit = reddit.subreddit('lifeprotip+Thetruthishere+Trueofmychest')
posts = subreddit.top(time_filter="all")
data = []
for post in posts:
data.append({
'title': profanity.censor(post.title) ,
'content': profanity.censor(post.selftext)
})
random.shuffle(data)
return data[0]
while True:
try:
reply = reddit()
video.create_video(reply['title'],reply['content'])
upl.upload()
time.sleep(43200)
except:
pass