From ba7e4dc1237ba4414c419f05481ce7cd399c081b Mon Sep 17 00:00:00 2001 From: ali Date: Fri, 9 Dec 2022 17:07:47 +0000 Subject: [PATCH 1/6] Updates docker to use python:3.10.9-slim as base image --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1f68ea0..6d090c6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/playwright +FROM python:3.10.9-slim RUN apt update RUN apt install python3-pip -y From 3a03a7d97be2b12c0b42e68ce66a58ab266a0265 Mon Sep 17 00:00:00 2001 From: LukachoLombardi <56646019+LukachoLombardi@users.noreply.github.com> Date: Sat, 10 Dec 2022 14:41:07 +0100 Subject: [PATCH 2/6] Patch 1 (#1372) * Update README.md (#1305) * Update pillow requirement from ~=9.1.1 to ~=9.3.0 Updates the requirements on [pillow](https://github.com/python-pillow/Pillow) to permit the latest version. - [Release notes](https://github.com/python-pillow/Pillow/releases) - [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst) - [Commits](https://github.com/python-pillow/Pillow/compare/9.1.1...9.3.0) --- updated-dependencies: - dependency-name: pillow dependency-type: direct:production ... Signed-off-by: dependabot[bot] * Update README.md match statement in subreddit.py (line 44) requires python 3.10 * Update README.md Signed-off-by: dependabot[bot] Co-authored-by: Jacoboleary <66446252+Jacoboleary@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jason Co-authored-by: Simon <65854503+OpenSourceSimon@users.noreply.github.com> --- README.md | 3 ++- requirements.txt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9095588..d731456 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ The only original thing being done is the editing and gathering of all materials ## Requirements -- Python 3.9+ +- Python 3.10 - Playwright (this should install automatically in installation) ## Installation 👩‍💻 @@ -70,6 +70,7 @@ In its current state, this bot does exactly what it needs to do. However, improv I have tried to simplify the code so anyone can read it and start contributing at any skill level. Don't be shy :) contribute! - [ ] Creating better documentation and adding a command line interface. +- [ ] Allowing the user to choose background music for their videos. - [x] Allowing users to choose a reddit thread instead of being randomized. - [x] Allowing users to choose a background that is picked instead of the Minecraft one. - [x] Allowing users to choose between any subreddit. diff --git a/requirements.txt b/requirements.txt index a2ccadf..e3d4336 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,6 +11,6 @@ rich==12.5.1 toml==0.10.2 translators==5.3.1 pyttsx3==2.90 -Pillow~=9.1.1 +Pillow~=9.3.0 tomlkit==0.11.4 Flask==2.2.2 From 85d0f336515701582b7e76b5cc4732280755ae31 Mon Sep 17 00:00:00 2001 From: whyisthesheep <77189741+whyisthesheep@users.noreply.github.com> Date: Sat, 10 Dec 2022 13:42:28 +0000 Subject: [PATCH 3/6] Added new gameplay video options (#1314) * Added new gameplay options Added: - minecraft-2 - multiversus - fall-guys - steep as options for background gameplay * Added new gameplay options Added: - minecraft-2 - multiversus - fall-guys - steep as options for background gameplay also CONSTANTS.py didn't seem to exist in the develop branch * Made sure all commited videos are free to use `fall-guys` and `multiversus` where changed * Deleted for backgrounds.json Deleted for backgrounds.json * Added and reformatted new gameplay into backgrounds.json Just took the new entries from the old `CONSTANTS.py` and moved them here (and changed the format so that it works!) * Added new entries and reformatted (Removed something that was commented out (in python) --- utils/.config.template.toml | 2 +- utils/backgrounds.json | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/utils/.config.template.toml b/utils/.config.template.toml index 38e454f..ee1abe5 100644 --- a/utils/.config.template.toml +++ b/utils/.config.template.toml @@ -25,7 +25,7 @@ storymode = { optional = true, type = "bool", default = false, example = false, [settings.background] -background_choice = { optional = true, default = "minecraft", example = "rocket-league", options = ["", "minecraft", "gta", "rocket-league", "motor-gta", "csgo-surf", "cluster-truck"], explanation = "Sets the background for the video based on game name" } +background_choice = { optional = true, default = "minecraft", example = "rocket-league", options = ["minecraft", "gta", "rocket-league", "motor-gta", "csgo-surf", "cluster-truck", "minecraft-2","multiversus","fall-guys","steep", ""], explanation = "Sets the background for the video based on game name" } #background_audio = { optional = true, type = "bool", default = false, example = false, options = [true, false,], explanation = "Sets a audio to play in the background (put a background.mp3 file in the assets/backgrounds directory for it to be used.)" } #background_audio_volume = { optional = true, type = "float", default = 0.3, example = 0.1, explanation="Sets the volume of the background audio. only used if the background_audio is also set to true" } diff --git a/utils/backgrounds.json b/utils/backgrounds.json index af800c5..8cb01d1 100644 --- a/utils/backgrounds.json +++ b/utils/backgrounds.json @@ -35,5 +35,29 @@ "cluster_truck.mp4", "No Copyright Gameplay", 480 + ], + "minecraft-2": [ + "https://www.youtube.com/watch?v=Pt5_GSKIWQM", + "minecraft-2.mp4", + "Itslpsn", + "center" + ], + "multiversus": [ + "https://www.youtube.com/watch?v=66oK1Mktz6g", + "multiversus.mp4", + "MKIceAndFire", + "center" + ], + "fall-guys": [ + "https://www.youtube.com/watch?v=oGSsgACIc6Q", + "fall-guys.mp4", + "Throneful", + "center" + ], + "steep": [ + "https://www.youtube.com/watch?v=EnGiQrWBrko", + "steep.mp4", + "joel", + "center" ] -} \ No newline at end of file +} From 6a155334f013594e841dedcb55da2c5f8a2465f8 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 19 Dec 2022 15:36:32 +0100 Subject: [PATCH 4/6] Fix the cleanup --- utils/cleanup.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/utils/cleanup.py b/utils/cleanup.py index f7bde35..e035980 100644 --- a/utils/cleanup.py +++ b/utils/cleanup.py @@ -12,18 +12,18 @@ def cleanup(id) -> int: Returns: int: How many files were deleted """ - if exists("./assets/temp"): + if exists(f"../assets/temp/{id}/"): count = 0 - files = [f for f in os.listdir(".") if f.endswith(".mp4") and "temp" in f.lower()] + files = [f for f in os.listdir(f"../assets/temp/{id}/") if f.endswith(".mp4")] count += len(files) for f in files: - os.remove(f) - REMOVE_DIRS = [f"./assets/temp/{id}/mp3/", f"./assets/temp/{id}/png/"] - files_to_remove = list(map(_listdir, REMOVE_DIRS)) - for directory in files_to_remove: - for file in directory: - count += 1 - os.remove(file) + os.remove(f"../assets/temp/{id}/{f}") + REMOVE_DIRS = [f"../assets/temp/{id}/mp3/", f"../assets/temp/{id}/png/"] + for d in REMOVE_DIRS: + if exists(d): + count += len(_listdir(d)) + for f in _listdir(d): + os.remove(f) + os.rmdir(d) + os.rmdir(f"../assets/temp/{id}/") return count - - return 0 From 7ff89f8234311842401c4c4098e8ccb1617849b1 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 19 Dec 2022 15:57:47 +0100 Subject: [PATCH 5/6] Fix for incorrect message --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index 02964fc..46318cf 100755 --- a/main.py +++ b/main.py @@ -64,13 +64,13 @@ def run_many(times): def shutdown(): - print_markdown("## Clearing temp files") try: redditid except NameError: print("Exiting...") exit() else: + print_markdown("## Clearing temp files") cleanup(redditid) print("Exiting...") exit() From 903dc3476fbc2fe9828ee5663ab6a1b08ee9c9c0 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 19 Dec 2022 17:20:41 +0100 Subject: [PATCH 6/6] Add Simon to the developers and maintainers section --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d731456..4997d3f 100644 --- a/README.md +++ b/README.md @@ -87,9 +87,11 @@ Elebumm (Lewis#6305) - https://github.com/elebumm (Founder) Jason (JasonLovesDoggo#1904) - https://github.com/JasonLovesDoggo (Maintainer) +Simon (OpenSourceSimon) - https://github.com/OpenSourceSimon + CallumIO (c.#6837) - https://github.com/CallumIO -Verq (Verq#2338) - https://github.com/CordlessCoder +Verq (Verq#2338) - https://github.com/CordlessCoder LukaHietala (Pix.#0001) - https://github.com/LukaHietala