diff --git a/fic-header.py b/fic-header.py index 7e32874..49dc6e5 100644 --- a/fic-header.py +++ b/fic-header.py @@ -11,12 +11,14 @@ data = { if os.path.exists("ficheader.html"): os.remove("ficheader.html") -thefile = open("ficheader.html", "a") +thefile = open("ficheader.html", "a") with requests.Session() as s: response = s.post(login_url , data) - print("Work ID: ") + print("Work ID:") id = input() + print("Use title? (y/n)") + thetitle = input() url = "https://archiveofourown.org/works/" + str(id) ficpage = s.get(url) ficsoup = BeautifulSoup(ficpage.content, "html.parser") @@ -138,7 +140,10 @@ with requests.Session() as s: mastersoup = BeautifulSoup(masterlist.content, "html.parser") ficno = int(mastersoup.find("span", class_="ficno").text.strip()) + 1 thefile.write("
\n") - thefile.write("

" + str(ficno) + " " + title + "

\n") + if thetitle == "y": + thefile.write("

" + str(ficno) + " " + title + "

\n") + else: + thefile.write("

" + str(ficno) + "

\n") thefile.write("