diff --git a/src/__main__.py b/src/__main__.py index 7326cf1..8a8443e 100644 --- a/src/__main__.py +++ b/src/__main__.py @@ -2,10 +2,11 @@ # python -m src.__main__ # python -m src # also works because __main__ is the default module import argparse +import asyncio import os from pathlib import Path from sys import exit, stderr -import asyncio + import dotenv from loguru import logger diff --git a/src/utils/delete.py b/src/utils/delete.py index 9dd7825..e446b90 100644 --- a/src/utils/delete.py +++ b/src/utils/delete.py @@ -1,8 +1,10 @@ # This is a scriprt to undo the changes made by adblock-zerotrust.py -import requests -import httpx import asyncio + +import httpx +import requests + from . import utils diff --git a/src/utils/upload.py b/src/utils/upload.py index 1f4c092..8646c25 100644 --- a/src/utils/upload.py +++ b/src/utils/upload.py @@ -1,8 +1,8 @@ +import asyncio import pathlib -import requests -import asyncio import httpx +import requests from . import utils @@ -48,13 +48,11 @@ def split_list(blocklists): return lists -async def upload_to_cloudflare(lists, account_id: str, token: str) -> None: +async def upload_to_cloudflare(lists, account_id: str, token: str) -> None: async with httpx.AsyncClient() as client: for i, lst in enumerate(lists): list_name = f"adblock-list-{i + 1}" - url = ( - f"https://api.cloudflare.com/client/v4/accounts/{account_id}/gateway/lists" - ) + url = f"https://api.cloudflare.com/client/v4/accounts/{account_id}/gateway/lists" headers = { "Authorization": f"Bearer {token}", "Content-Type": "application/json", @@ -79,7 +77,6 @@ async def upload_to_cloudflare(lists, account_id: str, token: str) -> None: exit(1) - def create_dns_policy(lists, account_id: str, token: str) -> None: url = f"https://api.cloudflare.com/client/v4/accounts/{account_id}/gateway/rules" headers = {