import AO3 print("Work ID:") thework = input() url = "https://archiveofourown.org/works/" + str(thework) workid = AO3.utils.workid_from_url(url) work = AO3.Work(workid) with open(f"{work.title}.epub", "wb") as file: file.write(work.download("EPUB"))