Fix AA extension parsing (#275)

Fix #274
This commit is contained in:
CaliBrain
2025-09-07 13:57:43 -04:00
committed by GitHub
parent 4e5c9b788f
commit f5de2ab143
2 changed files with 19 additions and 6 deletions
+15 -2
View File
@@ -169,8 +169,21 @@ def _parse_book_info_page(soup: BeautifulSoup, book_id: str) -> BookInfo:
data = soup.find_all("div", {"class": "main-inner"})[0].find_next("div")
divs = list(data.children)
format = divs[13].text.split(" · ")[-6].strip().lower()
size = divs[13].text.split(" · ")[-5].strip().lower()
_details = divs[13].text.strip().lower().split(" · ")
format = ""
size = ""
for f in _details:
if format == "" and f.strip().lower() in SUPPORTED_FORMATS:
format = f.strip().lower()
if size == "" and any(u in f.strip().lower() for u in ["mb", "kb", "gb"]):
size = f.strip().lower()
if format == "" or size == "":
for f in _details:
if f == "" and not " " in f.strip().lower():
format = f.strip().lower()
if size == "" and "." in f.strip().lower():
size = f.strip().lower()
every_url = soup.find_all("a")
slow_urls_no_waitlist = set()
+4 -4
View File
@@ -125,16 +125,16 @@ fi
env | grep -v -E "(AA_DONATOR_KEY)" | sort > "$LOG_DIR/environment.txt"
echo "--- HTTPBin ---" > $LOG_DIR/network_info.txt
pyrequests https://httpbin.org/get >> $LOG_DIR/network_info.txt
curl -s https://httpbin.org/get >> $LOG_DIR/network_info.txt
ehco ""
echo "--- HowsMySSL ---" >> $LOG_DIR/network_info.txt
pyrequests https://www.howsmyssl.com/a/check >> $LOG_DIR/network_info.txt
curl -s https://www.howsmyssl.com/a/check >> $LOG_DIR/network_info.txt
ehco ""
echo "--- IPInfo ---" >> $LOG_DIR/network_info.txt
pyrequests https://ipinfo.io >> $LOG_DIR/network_info.txt
curl -s https://ipinfo.io >> $LOG_DIR/network_info.txt
ehco ""
echo "--- Cloudflare Trace ---" >> $LOG_DIR/network_info.txt
pyrequests https://1.1.1.1/cdn-cgi/trace >> $LOG_DIR/network_info.txt
curl -s https://1.1.1.1/cdn-cgi/trace >> $LOG_DIR/network_info.txt
# Create the zip file directly from LOG_DIR
ln -s "$LOG_DIR" /tmp/$OUTPUT_FILE_NAME