# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
steps:
- name:Checkout repository
uses:actions/checkout@v3
# Initializes the CodeQL tools for scanning.
- name:Initialize CodeQL
uses:github/codeql-action/init@v2
with:
languages:${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name:Autobuild
uses:github/codeql-action/autobuild@v2
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
@ -6,18 +6,24 @@ All types of contributions are encouraged and valued. See the [Table of Contents
> And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about:
> And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about:
>
>
> - ⭐ Star the project
> - ⭐ Star the project
> - 📣 Tweet about it
> - 📣 Tweet about it
> - 🌲 Refer this project in your project's readme
> - 🌲 Refer this project in your project's readme
## Table of Contents
## Table of Contents
- [I Have a Question](#i-have-a-question)
- [Contributing to Reddit Video Maker Bot 🎥](#contributing-to-reddit-video-maker-bot-)
- [How Do I Submit a Good Enhancement Suggestion?](#how-do-i-submit-a-good-enhancement-suggestion)
- [Your First Code Contribution](#your-first-code-contribution)
- [Your environment](#your-environment)
- [Making your first PR](#making-your-first-pr)
- [Improving The Documentation](#improving-the-documentation)
## I Have a Question
## I Have a Question
@ -39,7 +45,7 @@ Additionally, there is a [Discord Server](https://discord.gg/swqtb7AsNQ) for any
### Reporting Bugs
### Reporting Bugs
#### Before Submitting a Bug Report
<details><summary><h4>Before Submitting a Bug Report</h4></summary>
A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible.
A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible.
@ -68,12 +74,13 @@ Once it's filed:
- The project team will label the issue accordingly.
- The project team will label the issue accordingly.
- A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no obvious way to reproduce the issue, the team will try to support you as best as they can, but you may not receive an instant.
- A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no obvious way to reproduce the issue, the team will try to support you as best as they can, but you may not receive an instant.
- If the team discovers that this is an issue it will be marked `bug` or `error`, as well as possibly other tags relating to the nature of the error), and the issue will be left to be [implemented by someone](#your-first-code-contribution).
- If the team discovers that this is an issue it will be marked `bug` or `error`, as well as possibly other tags relating to the nature of the error), and the issue will be left to be [implemented by someone](#your-first-code-contribution).
</details>
### Suggesting Enhancements
### Suggesting Enhancements
This section guides you through submitting an enhancement suggestion for Reddit Video Maker Bot, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions.
This section guides you through submitting an enhancement suggestion for Reddit Video Maker Bot, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions.
#### Before Submitting an Enhancement
<details><summary><h4>Before Submitting an Enhancement</h4></summary>
- Make sure that you are using the latest version.
- Make sure that you are using the latest version.
- Read the [documentation](https://luka-hietala.gitbook.io/documentation-for-the-reddit-bot/) carefully and find out if the functionality is already covered, maybe by an individual configuration.
- Read the [documentation](https://luka-hietala.gitbook.io/documentation-for-the-reddit-bot/) carefully and find out if the functionality is already covered, maybe by an individual configuration.
@ -90,6 +97,8 @@ Enhancement suggestions are tracked as [GitHub issues](https://github.com/elebum
- You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux. <!-- this should only be included if the project has a GUI -->
- You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux. <!-- this should only be included if the project has a GUI -->
- **Explain why this enhancement would be useful** to most users. You may also want to point out the other projects that solved it better and which could serve as inspiration.
- **Explain why this enhancement would be useful** to most users. You may also want to point out the other projects that solved it better and which could serve as inspiration.
These videos on TikTok, YouTube and Instagram get MILLIONS of views across all platforms and require very little effort. The only original thing being done is the editing and gathering of all materials...
These videos on TikTok, YouTube and Instagram get MILLIONS of views across all platforms and require very little effort.
The only original thing being done is the editing and gathering of all materials...
... but what if we can automate that process? 🤔
... but what if we can automate that process? 🤔
## Disclaimers 🚨
## Disclaimers 🚨
- This is purely for fun purposes.
- **At the moment**, this repository won't attempt to upload this content through this bot. It will give you a file that
-**At the moment**, this repository won't attempt to upload this content through this bot. It will give you a file that you will then have to upload manually. This is for the sake of avoiding any sort of community guideline issues.
you will then have to upload manually. This is for the sake of avoiding any sort of community guideline issues.
## Requirements
## Requirements
- Python 3.6+
- Python 3.6+
- Playwright (this should install automatically during installation)
- Playwright (this should install automatically in installation)
- Sox
## Installation 👩💻
## Installation 👩💻
1. Clone this repository
1. Clone this repository
2. 2a **Automatic Install**: Run `python3 main.py` and type 'yes' to activate the setup assistant.
2b **Manual Install**: 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` file, along with whether your account uses two-factor authentication.
3. Run `playwright install` and `playwright install-deps`.
4.
4.
5. Run `pip3 install -r requirements.txt`
4a **Automatic Install**: Run `python3 main.py` and type 'yes' to activate the setup assistant.
4b **Manual Install**: 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` file, along with whether your account uses two-factor authentication.
6. Run `playwright install` and `playwright install-deps`.
5. Run `python3 main.py` (unless you chose automatic install, then the installer will automatically run main.py)
7. Run `python3 main.py` (unless you chose automatic install, then the installer will automatically run main.py)
7. Enjoy 😎
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` file, along with whether your account uses two-factor authentication.
8. Enjoy 😎
## Video
If you want to see more detailed guide, please refer to the official [documentation](https://luka-hietala.gitbook.io/documentation-for-the-reddit-bot/).
"### Thanks for using this tool! [Feel free to contribute to this project on GitHub!](https://lewismenelaws.com) If you have any questions, feel free to reach out to me on Twitter or submit a GitHub issue."
"### Thanks for using this tool! [Feel free to contribute to this project on GitHub!](https://lewismenelaws.com) If you have any questions, feel free to reach out to me on Twitter or submit a GitHub issue. You can find solutions to many common problems in the [Documentation](https://luka-hietala.gitbook.io/documentation-for-the-reddit-bot/)"
console.log("[red]Setup was already completed! Please make sure you have to run this script again. If you have to, please delete the file .setup-done-before")
message:str="",
exit()
check_type=False,
match:str="",
err_message:str="",
nmin=None,
nmax=None,
oob_error="",
):
match=re.compile(match+"$")
whileTrue:
user_input=input(message+"\n> ").strip()
ifre.match(match,user_input)isnotNone:
ifcheck_typeisnotFalse:
try:
user_input=check_type(user_input)
ifnminisnotNoneanduser_input<nmin:
console.log("[red]"+oob_error)# Input too low failstate
continue
ifnmaxisnotNoneanduser_input>nmax:
console.log("[red]"+oob_error)# Input too high
continue
break# Successful type conversion and number in bounds
exceptValueError:
console.log("[red]"+err_message)# Type conversion failed
continue
if(
nminisnotNoneandlen(user_input)<nmin
):# Check if string is long enough
console.log("[red]"+oob_error)
continue
if(
nmaxisnotNoneandlen(user_input)>nmax
):# Check if string is not too long
console.log("[red]"+oob_error)
continue
break
console.log("[red]"+err_message)
returnuser_input
ifos.path.isfile(".setup-done-before"):
console.log(
"[red]Setup was already completed! Please make sure you have to run this script again. If that is such, delete the file .setup-done-before"
)
exit()
# These lines ensure the user:
# These lines ensure the user:
# - knows they are in setup mode
# - knows they are in setup mode
# - knows that they are about to erase any other setup files/data.
# - knows that they are about to erase any other setup files/data.
print_step("Setup Assistant")
print_step("Setup Assistant")
print_markdown(
print_markdown(
"### You're in the setup wizard. Ensure you're supposed to be here, then type yes to continue. If you're not sure, type no to quit."
"### You're in the setup wizard. Ensure you're supposed to be here, then type yes to continue. If you're not sure, type no to quit."
)
)
# This Input is used to ensure the user is sure they want to continue.
# This Input is used to ensure the user is sure they want to continue.
ensureSetupIsRequired=input("Are you sure you want to continue? > ").casefold()
ifinput("Are you sure you want to continue? > ").strip().casefold()!="yes":
ifensureSetupIsRequired!="yes":
console.print("[red]Exiting...")
console.print("[red]Exiting...")
exit()
time.sleep(0.5)
# This code is inaccessible if the prior check fails, and thus an else statement is unnecessary
exit()
else:
# Again, let them know they are about to erase all other setup data.
console.print("[bold red] This will overwrite your current settings. Are you sure you want to continue? [bold green]yes/no")
overwriteSettings=input("Are you sure you want to continue? > ").casefold()
ifoverwriteSettings!="yes":
console.print("[red]Abort mission! Exiting...")
time.sleep(0.5)
exit()
else:
# Once they confirm, move on with the script.
console.print("[bold green]Alright! Let's get started!")
time.sleep(1)
# Again, let them know they are about to erase all other setup data.
console.print(
"[bold red] This will overwrite your current settings. Are you sure you want to continue? [bold green]yes/no"
)
ifinput("Are you sure you want to continue? > ").strip().casefold()!="yes":
console.print("[red]Abort mission! Exiting...")
exit()
# This is once again inaccessible if the prior checks fail
# Once they confirm, move on with the script.
console.print("[bold green]Alright! Let's get started!")
print()
console.log("Ensure you have the following ready to enter:")
console.log("Ensure you have the following ready to enter:")
console.log("[bold green]Reddit Client ID")
console.log("[bold green]Reddit Client ID")
console.log("[bold green]Reddit Client Secret")
console.log("[bold green]Reddit Client Secret")
@ -59,64 +102,108 @@ console.log("[bold green]Reddit 2FA (yes or no)")
console.log("[bold green]Opacity (range of 0-1, decimals are OK)")
console.log("[bold green]Opacity (range of 0-1, decimals are OK)")
console.log("[bold green]Subreddit (without r/ or /r/)")
console.log("[bold green]Subreddit (without r/ or /r/)")
console.log("[bold green]Theme (light or dark)")
console.log("[bold green]Theme (light or dark)")
time.sleep(0.5)
console.print(
console.print("[green]If you don't have these, please follow the instructions in the README.md file to set them up.")
"[green]If you don't have these, please follow the instructions in the README.md file to set them up."
console.print("[green]If you do have these, type yes to continue. If you dont, go ahead and grab those quickly and come back.")
)
confirmUserHasCredentials=input("Are you sure you have the credentials? > ").casefold()
console.print(
ifconfirmUserHasCredentials!="yes":
"[green]If you do have these, type yes to continue. If you dont, go ahead and grab those quickly and come back."
console.print("[red]I don't understand that.")
)
console.print("[red]Exiting...")
print()
exit()
else:
console.print("[bold green]Alright! Let's get started!")
time.sleep(1)
"""
Beginthesetupprocess.
ifinput("Are you sure you have the credentials? > ").strip().casefold()!="yes":
console.print("[red]I don't understand that.")
console.print("[red]Exiting...")
exit()
"""
console.print("[bold green]Alright! Let's get started!")
# Begin the setup process.
console.log("Enter your credentials now.")
console.log("Enter your credentials now.")
cliID=input("Client ID > ")
client_id=handle_input(
cliSec=input("Client Secret > ")
"Client ID > ",
user=input("Username > ")
False,
passw=input("Password > ")
"[-a-zA-Z0-9._~+/]+=*",
twofactor=input("2fa Enabled? (yes/no) > ")
"That is somehow not a correct ID, try again.",
opacity=input("Opacity? (range of 0-1) > ")
12,
subreddit=input("Subreddit (without r/) > ")
30,
theme=input("Theme? (light or dark) > ")
"The ID should be over 12 and under 30 characters, double check your input.",
console.log("Attempting to save your credentials...")