This is a simple bot that downloads images from new posts in a specified subreddit at a specified time. The bot is built using Python and can be run directly or deployed using Docker.
- The bot checks a specified subreddit for new posts.
- It downloads images from those posts and saves them to a local directory.
- The bot can be configured to run at a specific time daily.
- Python 3.7 or higher
- Docker (optional, for containerized deployment)
git clone https://github.com/lordlegacy/reddit.git
cd redditCreate a .env file in the root directory and add your Reddit API credentials:
CLIENT_ID=your_client_id
CLIENT_SECRET=your_client_secret
USER_AGENT=your_user_agent
For Windows:
pip install -r requirements.txt
For Linux:
pip3 install -r requirements.txtFor Windows:
python main.py
For Linux:
python3 main.pygit clone https://github.com/lordlegacy/reddit.git
cd redditdocker build -t redditdocker run -e CLIENT_ID=your_client_id -e CLIENT_SECRET=your_client_secret -e USER_AGENT=your_user_agent -v $(pwd)/posts:/app/posts redditReplace your_client_id, your_client_secret, and your_user_agent with your actual Reddit API credentials.
You can configure the following environment variables:
SUBREDDIT: The subreddit to download images from (default: "pics")SCHEDULE_TIME: The time to run the bot daily (default: "00:00")
Set these variables in the .env file for terminal execution, or pass them as environment variables when running the Docker container.
- The bot will create a
postsdirectory where all downloaded images will be stored. - You can change the
SUBREDDITandSCHEDULE_TIMEby updating the environment variables or by passing them interactively when prompted. - Make sure to comply with Reddit's API terms of service and the rules of the subreddit you're downloading from.
If you encounter any issues, please check the following:
- Ensure your Reddit API credentials are correct.
- Check your internet connection.
- Verify that you have the necessary permissions to write to the
postsdirectory.
For any other problems, please open an issue on the GitHub repository.