diff --git a/run b/run index d1e95ce..a2ee897 100755 --- a/run +++ b/run @@ -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)