|
|
@ -1,8 +1,10 @@
|
|
|
|
import json
|
|
|
|
import json
|
|
|
|
|
|
|
|
import os
|
|
|
|
import traceback
|
|
|
|
import traceback
|
|
|
|
|
|
|
|
|
|
|
|
import httpx
|
|
|
|
import httpx
|
|
|
|
from loguru import logger
|
|
|
|
from loguru import logger
|
|
|
|
|
|
|
|
from retry import retry
|
|
|
|
from selenium import webdriver
|
|
|
|
from selenium import webdriver
|
|
|
|
from selenium.webdriver.common.by import By
|
|
|
|
from selenium.webdriver.common.by import By
|
|
|
|
from selenium.webdriver.support import expected_conditions as ec
|
|
|
|
from selenium.webdriver.support import expected_conditions as ec
|
|
|
@ -75,7 +77,7 @@ def login():
|
|
|
|
driver.quit()
|
|
|
|
driver.quit()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@retry(tries=3, delay=5)
|
|
|
|
def get_list(list_id):
|
|
|
|
def get_list(list_id):
|
|
|
|
logger.info(f"Check list https://x.com/i/lists/{list_id}")
|
|
|
|
logger.info(f"Check list https://x.com/i/lists/{list_id}")
|
|
|
|
with open("config.json", "r", encoding="utf-8") as f:
|
|
|
|
with open("config.json", "r", encoding="utf-8") as f:
|
|
|
@ -96,6 +98,7 @@ def get_list(list_id):
|
|
|
|
)
|
|
|
|
)
|
|
|
|
if resp.status_code != 200:
|
|
|
|
if resp.status_code != 200:
|
|
|
|
logger.error(f"Error fetching list {list_id}: {resp.status_code} {resp.text}")
|
|
|
|
logger.error(f"Error fetching list {list_id}: {resp.status_code} {resp.text}")
|
|
|
|
|
|
|
|
os.remove("headers.json")
|
|
|
|
return None
|
|
|
|
return None
|
|
|
|
logger.info(f"Checked {list_id}")
|
|
|
|
logger.info(f"Checked {list_id}")
|
|
|
|
return resp.json()
|
|
|
|
return resp.json()
|
|
|
|