select the subreddit from the env file

pull/5/head
Fabian Diaz 3 years ago
parent 5b3989611f
commit d27024660d

@ -1,4 +1,5 @@
REDDIT_CLIENT_ID=""
REDDIT_CLIENT_SECRET=""
REDDIT_USERNAME=""
REDDIT_PASSWORD=""
REDDIT_PASSWORD=""
REDDIT_SUBREDDIT=""

@ -33,6 +33,7 @@ These videos on TikTok, YouTube and Instagram get MILLIONS of views across all p
1. Clone this repository
2. Rename `.env.template` to `.env` and replace all values with the appropriate fields. To get Reddit keys (**required**), visit [the Reddit Apps page.](https://www.reddit.com/prefs/apps) TL;DR set up an app that is a "script". Copy your keys into the `.env` files.
3. Run `pip3 install -r requirements.txt`
4. Run `playwright install`
4. Run `python3 main.py`
5. ...
6. Enjoy 😎
@ -45,6 +46,6 @@ I have tried to simplify the code so anyone can read it and start contibuting at
- [ ] Allowing users to choose a reddit thread instead of being randomized.
- [ ] Allowing users to choose a background that is picked instead of the Minecraft one.
- [ ] Allowing users to choose between any subreddit.
- [] Allowing users to choose between any subreddit.
- [ ] Allowing users to change voice.
- [ ] Creating better documentation and adding a command line interface.

@ -21,7 +21,7 @@ def get_askreddit_threads():
username=os.getenv("REDDIT_USERNAME"),
password=os.getenv("REDDIT_PASSWORD"),
)
askreddit = reddit.subreddit("askreddit")
askreddit = reddit.subreddit(os.getenv("REDDIT_SUBREDDIT"))
threads = askreddit.hot(limit=25)
submission = list(threads)[random.randrange(0, 25)]
print_substep(f"Video will be: {submission.title} :thumbsup:")

Loading…
Cancel
Save