import spaw import redvid import re from botsecrets2 import spawemail, spawpassword from botsecrets2 import PUT_USER_NAME_HERE, PUT_PASSWORD_HERE, PUT_CLIENT_ID_HERE, PUT_CLIENT_SECRET_HERE, PUT_USER_AGENT_HERE from botsecrets2 import mydirectory os.chdir(mydirectory) reddit = praw.Reddit(username=PUT_USER_NAME_HERE, password=PUT_PASSWORD_HERE, client_id=PUT_CLIENT_ID_HERE, client_secret=PUT_CLIENT_SECRET_HERE, user_agent=PUT_USER_AGENT_HERE) SPAW = spaw.SPAW() SPAW.auth(spawemail, spawpassword) def bot_run(): ''' Looks for mentions of the bot and then downloads the submission video, reverses the video, posts it to Streamable, and replies to the comment with the link ''' while True: # Checks every new comment posted to reddit and skips ones # made before the bot ran for comment in reddit.subreddit('all').stream.comments( skip_existing=True):
import praw import re from tinydb import TinyDB, Query import anim from collections import Counter import spaw from twisted.internet import task, reactor streamable_username = os.environ.get("streamable_username") streamable_password = os.environ.get("streamable_password") reddit_client_id = os.environ.get("reddit_client_id") reddit_client_secret = os.environ.get("reddit_client_secret") reddit_refresh_token = os.environ.get("reddit_refresh_token") _spaw = spaw.SPAW() _spaw.auth(streamable_username, streamable_password) db = TinyDB("db.json") reddit = praw.Reddit( client_id=reddit_client_id, client_secret=reddit_client_secret, refresh_token=reddit_refresh_token, user_agent="/u/objection-bot v0.1", ) User = Query() print("starting...")
from bs4 import BeautifulSoup from discord.ext import commands from imgurpython import ImgurClient # reddit initialize reddit = praw.Reddit(client_id=config.config["redditClientID"], client_secret=config.config['redditClientSecret'], password=config.config["redditPass"], user_agent='Anumubot by /u/Rayzor324', username='******') reddit.read_only = True imgurclient = ImgurClient(config.config['imgurClient'], config.config['imgurSecret']) stm = spaw.SPAW() stm.auth('*****@*****.**', config.config['streamablePass']) ######YOUTUBE # Suppress noise about console usage from errors youtube_dl.utils.bug_reports_message = lambda: '' ytdl_format_options = { 'format': 'bestaudio/best', 'outtmpl': 'musicMu/%(extractor)s-%(id)s-%(title)s.mp4', 'restrictfilenames': True, 'noplaylist': True, 'nocheckcertificate': True, 'ignoreerrors': False, 'logtostderr': False, 'quiet': True,