diff --git a/cogs/extremism.py b/cogs/extremism.py index 26ac35d..a3df2fc 100644 --- a/cogs/extremism.py +++ b/cogs/extremism.py @@ -40,7 +40,7 @@ def overlay_logo(img: PIL.Image.Image) -> PIL.Image.Image: logo.load() logo = logo.resize((1024, 1024)) img = img.resize((1024, 1024)) - + img = _overlay_images(img, logo, blend_modes.lighten_only, 1) return img diff --git a/cogs/other.py b/cogs/other.py index 417d736..2270523 100644 --- a/cogs/other.py +++ b/cogs/other.py @@ -875,15 +875,6 @@ class OtherCog(commands.Cog): ): """Downloads a video using youtube-dl""" cookies = io.StringIO() - if cookies_txt is None: - p = (Path(__file__).parent.parent / "cookies.txt") - if p.exists(): - with p.open("r") as f: - cookies.write(f.read()) - else: - cookies.write("# No cookies.txt file found.") - else: - cookies.write(await cookies_txt.read()) cookies.seek(0) await ctx.defer() @@ -907,6 +898,14 @@ class OtherCog(commands.Cog): stdout = tempdir / "stdout.txt" stderr = tempdir / "stderr.txt" + default_cookies_txt = (Path.cwd() / "jimmy-cookies.txt") + real_cookies_txt = tempdir / "cookies.txt" + if cookies_txt is not None: + await cookies_txt.save(fp=real_cookies_txt) + else: + default_cookies_txt.touch() + shutil.copy(default_cookies_txt, real_cookies_txt) + class Logger: def __init__(self): self.stdout = open(stdout, "w+") @@ -966,7 +965,7 @@ class OtherCog(commands.Cog): ], "merge_output_format": "webm/mp4/mov/flv/avi/ogg/m4a/wav/mp3/opus/mka/mkv", "source_address": "0.0.0.0", - "cookiesfile": cookies + "cookiesfile": real_cookies_txt } if extract_audio: args["postprocessors"] = [