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

Issue #237: handle exceptions due to missing "rights" key #238

Closed nhonaitran closed 3 years ago

nhonaitran commented 3 years ago

The issue is caused by unhandled exception thrown for missing key "rights" in the info and book_info dictionaries when fetching book info.

This PR addresses above issue by replacing existing call to lookup the "rights" key to using the get method with default value set to empty string if the key is missing in the book info dictionary.

Similar replacements applied to other keys as well to prevent from missing key exception.