diff --git a/.env.template b/.env.template index e00c242..3c63795 100644 --- a/.env.template +++ b/.env.template @@ -1,4 +1,5 @@ REDDIT_CLIENT_ID="" REDDIT_CLIENT_SECRET="" REDDIT_USERNAME="" -REDDIT_PASSWORD="" \ No newline at end of file +REDDIT_PASSWORD="" +REDDIT_SUBREDDIT="" \ No newline at end of file diff --git a/README.md b/README.md index 26d8156..c451984 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/reddit/askreddit.py b/reddit/askreddit.py index 7c7110a..5503550 100644 --- a/reddit/askreddit.py +++ b/reddit/askreddit.py @@ -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:")