The program scraps through a given subreddit and finds the top rated comments for each of them then renders a video using the screenshots (5 comments per video).
- .NET core 3.1 (C#)
- Newtonsoft JSON library for C# (Newtonsoft.Json)
- Microsoft T2S library for C# (System.Speech)
- FFMPEG
- pyhton3 (Selenium, Pillow, BeautifulSoup4)
- Chrome Webdriver
- Clone the repository.
- Download the FFMPEG library executables and copy the files into the
Resources/ffmpeg
folder. - Download a ChromeDriver that is comaptible with your Chrome browser and copy the file into the
Resources/py
folder. - Download
pyhton3
. - Navigate to the
Resources/py
folder and run thepip install -r requirements.txt
command. - Set up the
Resources/settings.json
andResources/cursewords.json
to satisfy your needs. - Compile the code and run the compiled executeable.
- You will find the videos that are rendered in the
done
folder.
You can find three objects in the json file:
- backgroundVideoPath: the relative path to the video that you want the background to be.
Note: this video has to be somewhat long due to the bot can not loop a short video. The start time is randomly selected.
- subredditUrlOrFileName: The link to the subreddit that you want videos from. Or download the RSS file and copy it to the root folder.
Note: if you are using an RSS file leave the .rss extension. Also you can use subreddit sorting such as
/top/
.
- numberOfVidsPerPost: Number of vids per subreddit.
{
"backgroundVideoPath": "background/minecraftParkourVideo.mp4",
"subredditUrlOrFileName": "https://reddit.com/r/askreddit/top/",
"numberOfVidsPerPost": 3
}
With this example the bot will render 3 videos from the current top posts from the AskReddit subreddit with a randomly selected clip from the background/minecraftParkourVideo.mp4
.
You can also choose the words that you want censored out. There is a cursewords.json
file in the Resources
folder. The name of the json object is the word that you want to replace and the value is the word that you want it to be replaced with.
{
"cat": "meow",
"dog": "bark",
"food": "drink"
}
With this example the bot will replace every "cat" with "meow", every "dog" with "bark" and every "food" with "drink" in the titles and in the comments.
- There is a
clear.bat
int theResources
folder. Recommended to use after the bot rendered a full subreddit and you want to make videos from the same one but with another sorting becouse the files may interfere with eachother. For compilation I would recommend Mono. An open source implementation of Microsoft's .NET Framework.- For compilation with the new commit I would recommend importing the project to Visual Studio. But you can still use Mono if you want.
- If you downloaded the NuGet packages (.nupkg) for the .dll files you have to decompress them and find the suitable for the .NET 3.1 core. Any other versions may result in unintended behaviour.