This commit is contained in:
simon987 2020-07-05 19:10:06 -04:00
parent 7f494fd8f1
commit 57b994cc65

8
run
View File

@ -58,6 +58,9 @@ def do_premium_download(link, i):
soup = BeautifulSoup(r.content, "html.parser")
form = soup.find("form")
with open("debug.do_premium_download.html", "wb") as f:
f.write(r.content)
if not form:
if "The file you were looking for could not be found" not in r.text:
print(r.content, file=stderr)
@ -88,6 +91,9 @@ def parse_topic(topic_url):
r = session.get(topic_url)
soup = BeautifulSoup(r.content, "html.parser")
with open("debug.parse_topic.html", "wb") as f:
f.write(r.content)
for i, elem in enumerate(soup.find_all(class_="postlink")):
if not elem.get("href"):
continue
@ -110,6 +116,8 @@ def login():
}, headers={
"Content-Type": "application/x-www-form-urlencoded"
})
with open("debug.login.html", "wb") as f:
f.write(r.content)
topic_id = get_topic_id(TOPIC_URL)