- removed redundant initialization of 'blockdict'
- removed local variable 'csrf'
if config.get("bot_enabled") and len(blockdict) > 0:
network.send_bot_post(blocker, blockdict)
- blockdict = []
-
# DEBUG: print("DEBUG: EXIT!")
def fetch_cs(args: argparse.Namespace):
tag = meta.find("meta", attrs={"name": "csrf-token"})
# DEBUG: print(f"DEBUG: tag={tag}")
- csrf = tag["content"]
- # DEBUG: print(f"DEBUG: Adding CSRF token='{csrf}' for domain='{domain}'")
- reqheaders["X-CSRF-Token"] = csrf
+ # DEBUG: print(f"DEBUG: Adding CSRF token='{tag['content']}' for domain='{domain}'")
+ reqheaders["X-CSRF-Token"] = tag["content"]
except BaseException as exception:
# DEBUG: print(f"DEBUG: No CSRF token found, using normal headers: domain='{domain}',exception[{type(exception)}]={exception}")