diff --git a/plugins/dpt.py b/plugins/dpt.py index ac1f02e..15b8c1b 100644 --- a/plugins/dpt.py +++ b/plugins/dpt.py @@ -1,9 +1,12 @@ depends = ["bprint", "meido"] +from time import sleep def run(l): - pages = l['meido'].instance.get_catalog("g") - for page in pages: - for thread in page["threads"]: - if not thread.get("sub"): continue - if "/dpt/" in thread["sub"]: - l["sand"].box["dpt"] = thread["no"] - l["bprint"].p(f"found /dpt/! thread no: {thread['no']}") + while True: + pages = l['meido'].instance.get_catalog("g") + for page in pages: + for thread in page["threads"]: + if not thread.get("sub"): continue + if "/dpt/" in thread["sub"]: + l["sand"].box["dpt"] = thread["no"] + l["bprint"].p(f"found /dpt/! thread no: {thread['no']}") + sleep(60) diff --git a/plugins/sandbox_web.py b/plugins/sandbox_web.py index a49df85..3ab3663 100644 --- a/plugins/sandbox_web.py +++ b/plugins/sandbox_web.py @@ -1,18 +1,26 @@ depends = ["bprint", "sand"] from http.server import BaseHTTPRequestHandler, HTTPServer +from urllib.parse import urlparse, parse_qs +import json def run(l): class MyServer(BaseHTTPRequestHandler): def do_GET(self): self.send_response(200) - self.send_header("Content-type", "text/html") + self.send_header("Content-type", "application/json") self.end_headers() - self.wfile.write(bytes("