diff --git a/app/YARS/src/yars/yars.py b/app/YARS/src/yars/yars.py index 6e24423..a017e2f 100644 --- a/app/YARS/src/yars/yars.py +++ b/app/YARS/src/yars/yars.py @@ -33,6 +33,11 @@ class YARS: if proxy: self.session.proxies.update({"http": proxy, "https": proxy}) + # this monthly cookie generated by visiting the website in a browser + # will need to figure out how to generate and update this + self.session.headers.update({ + "Cookie": "loid=00000000252z4gni1x.2.1767064423377.Z0FBQUFBQnBVME5uYldSOGZmRnBLTXloRE0tdG1LNVBqLXFsOUIzb21nUS1RUHIwS0dEUHpIVTdHWFN6VkpsRlY2UlFQd2l2ZkdidF9rRW1kUnhONi1IM1QxTmNLVFYyWFlmeHAyZFJMWHU2WGlOdGVqS0JNX1lnV191Ymw0R3ZpVTd1dEgtWnJCN2Y" + }) def handle_search(self,url, params, after=None, before=None): if after: params["after"] = after diff --git a/app/delete_posts.py b/app/delete_posts.py index c2467a3..5272d9e 100644 --- a/app/delete_posts.py +++ b/app/delete_posts.py @@ -59,7 +59,7 @@ def run(): for file in extra_files: print(f"Removing {file}") os.remove(file) - empty_dirs = subprocess.run(["find", "/reddit/media", "-type", "d", "-empty"], capture_output=True, text=True) + empty_dirs = subprocess.run(["find", "/reddit/media", "-mindepth", "1", "-type", "d", "-empty"], capture_output=True, text=True) empty_dirs = set(empty_dirs.stdout.splitlines()) print("Deleting empty directories") for dir in empty_dirs: @@ -67,4 +67,5 @@ def run(): os.rmdir(dir) print("Done") -run() \ No newline at end of file +if __name__ == "__main__": + run() diff --git a/app/templates/admin.html b/app/templates/admin.html index af89cb9..30af5f1 100755 --- a/app/templates/admin.html +++ b/app/templates/admin.html @@ -37,7 +37,7 @@ -
+ /r/