lorenzodifuccia / safaribooks

Download and generate EPUB of your favorite books from O'Reilly Learning (aka Safari Books Online) library.
Do What The F*ck You Want To Public License
4.65k stars 691 forks source link

Rights field now gone from book info #243

Closed leakydata closed 3 years ago

leakydata commented 3 years ago

The Rights info in the book_info function is no longer returned by the safaribooks API. If you comment it out the script still won't work it just gives a Rights warning and aborts. What is the format info['Rights'] is supposed to be in? def book_info(self, info): description = self.parse_description(info["description"]).replace("\n", " ")

print("INFO:",info)

    for t in [
        ("Title", info["title"]), ("Authors", ", ".join(aut["name"] for aut in info["authors"])),
        ("Identifier", info["identifier"]), ("ISBN", info["isbn"]),
        ("Publishers", ", ".join(pub["name"] for pub in info["publishers"])),
        ("Rights", info["rights"]), 
        ("Description", description[:500] + "..." if len(description) >= 500 else description),
        ("Release Date", info["issued"]),
        ("URL", info["web_url"])
leakydata commented 3 years ago

https://github.com/jacabreragt/safaribooks/commit/250d1c611b970d53ce93ee6fe630cd582928370c fixed the problem.