This script collects data from the PublicFreakout subreddit of Reddit. Specifically, it retrieves information about the top videos that were posted in the last 24 hours and contain video content. The videos are sorted by most upvoted.
- requests
- json
- datetime
- ffmpeg
To get video from another subreddit, change URL
to the subreddit you want to get videos from. For example, to get videos from r/entitledparents, change the URL to https://www.reddit.com/r/entitledparents/top.json?sort=top&t=day&limit=100
This script is intended for educational and non-commercial use only. The authors of this script are not responsible for any misuse or illegal use of this script. The authors do not encourage or condone any activity that violates the terms of service of Reddit. By using this script, you agree to comply with the terms of service of Reddit.
- Install dependencies by running
pip install -r requirements.txt
- Run the script by typing
python reddit.py
- The script will retrieve information about the top PublicFreakout videos from Reddit and store it in a JSON file called
reddit.json
- The script will print the time the data was collected and the total number of videos collected
- If any error occurs during the process, the script will return an error message.
If you want get video from another subrredit, just change the name of the subrredit in config.ini file.
[REDDIT]
subreddit = PublicFreakout
- Add functionality to automatically post all collected videos to YouTube with a timeline and description for each video. You will need to have a YouTube account, create a new project in the Google Developers Console, and obtain a
client_secret.json
file to authenticate with YouTube's API. - Customize the description of the videos to include information from the original Reddit post, such as the title, upvotes, and post link.
- Use
ffmpeg
to download and convert the video format to comply with YouTube's upload requirements. - Schedule the script to run automatically on a regular basis using a task scheduler, such as cron (on Linux/Mac) or Task Scheduler (on Windows).
This script is licensed under the MIT License.