I am getting error during downloading book.
Python 3.5.3
[-] Logging into Safari Books Online...
[*] Retrieving book info...
[-] Title: Prometheus: Up & Running
[-] Authors: Brian Brazil
[-] Identifier: 9781492034131
[-] ISBN: 9781492034148
[-] Publishers: O'Reilly Media, Inc.
--- Logging error ---
Traceback (most recent call last):
File "/usr/lib/python3.5/logging/__init__.py", line 983, in emit
stream.write(msg)
UnicodeEncodeError: 'ascii' codec can't encode character '\xa9' in position 50: ordinal not in range(128)
Call stack:
File "safaribooks.py", line 1024, in <module>
SafariBooks(args_parsed)
File "safaribooks.py", line 292, in __init__
self.display.book_info(self.book_info)
File "safaribooks.py", line 135, in book_info
self.info("{0}{1}{2}: {3}".format(self.SH_YELLOW, t[0], self.SH_DEFAULT, t[1]), True)
File "safaribooks.py", line 67, in info
self.log(message)
File "safaribooks.py", line 61, in log
self.logger.info(str(message))
Message: "\x1b[33mRights\x1b[0m: Copyright \xa9 O'Reilly Media, Inc."
Arguments: ()
[#] Unhandled Exception: 'ascii' codec can't encode character '\xa9' in position 239: ordinal not in range(128) (type: UnicodeEncodeError)
[+] Please delete all the `<BOOK NAME>/OEBPS/*.xhtml` files and restart the program.
[!] Aborting...
--- Logging error ---
Traceback (most recent call last):
File "/usr/lib/python3.5/logging/__init__.py", line 983, in emit
stream.write(msg)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 6722-6723: ordinal not in range(128)
Call stack:
File "safaribooks.py", line 95, in unhandled_exception
self.exit("Unhandled Exception: %s (type: %s)" % (o, o.__class__.__name__))
File "safaribooks.py", line 90, in exit
self.save_last_request()
File "safaribooks.py", line 100, in save_last_request
.format(*self.last_request))
File "safaribooks.py", line 61, in log
self.logger.info(str(message))
Message: 'Last request done:\n\tURL: https://www.safaribooksonline.com/api/v1/book/9781492034131/\n\tDATA: None\n\tOTHERS: {}\n\n\t200\n\tServer: nginx/1.10.3 (Ubuntu)\n\tContent-Type: application/json\n\tAllow: GET, HEAD, OPTIONS\n\tx-xss-protection: 1; mode=block\n\tContent-Language: en-US\n\tx-content-type-options: nosniff\n\tX-Frame-Options: SAMEORIGIN\n\tstrict-transport-security: max-age=3600; includeSubDomains, max-age=31536000; includeSubdomains\n\tContent-Encoding: gzip\n\tCache-Control: s-maxage=31536000\n\tContent-Length: 1711\n\tAccept-Ranges: bytes\n\tDate: Thu, 24 May 2018 21:25:45 GMT\n\tVia: 1.1 varnish\n\tConnection: keep-alive\n\tX-Client-IP: 62.245.87.212\n\tX-Served-By: cache-hhn1541-HHN\n\tX-Cache: MISS\n\tX-Cache-Hits: 0\n\tX-Timer: S1527197145.328775,VS0,VE551\n\tVary: Accept-Encoding\n\n{"url":"https://www.safaribooksonline.com/api/v1/book/9781492034131/","natural_key":["9781492034131"],"authors":[{"name":"Brian Brazil"}],"subjects":[],"topics":[{"score":-0.692030336285675,"name":"Information Technology / Operations","slug":"information-technology-operations","uuid":"c363ab45-daa6-442e-b572-1a4467aceeb0","epub_identifier":"9781492034131"}],"publishers":[{"name":"O\'Reilly Media, Inc.","id":1,"slug":"oreilly-media-inc"}],"chapters":["https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/cover.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/toc01.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/titlepage01.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/copyright-page01.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/preface01.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/part01.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/ch01.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/ch02.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/part02.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/ch03.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/ch04.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/ch05.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/ch06.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/part03.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/ch07.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/ch08.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/ch09.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/ch10.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/ch11.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/ch12.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/part04.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/ch13.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/ch14.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/ch15.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/ch16.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/ch17.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/part05.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/ch18.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/ch19.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/part06.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/ch20.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/ix01.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/colophon01.html","https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/colophon02.html"],"cover":"https://www.safaribooksonline.com/library/cover/9781492034131/","chapter_list":"https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/","toc":"https://www.safaribooksonline.com/api/v1/book/9781492034131/toc/","flat_toc":"https://www.safaribooksonline.com/api/v1/book/9781492034131/flat-toc/","web_url":"https://www.safaribooksonline.com/library/view/prometheus-up/9781492034131/","last_chapter_read":{"url":"https://www.safaribooksonline.com/api/v1/book/9781492034131/chapter/ch09.html","title":"9. Containers and Kubernetes","web_url":"https://www.safaribooksonline.com/library/view/prometheus-up/9781492034131/ch09.html"},"academic_excluded":false,"opf_unique_identifier_type":"pub-identifier","has_mathml":false,"created_time":"2018-05-01T16:47:13.772384Z","last_modified_time":"2018-05-01T16:53:31.924780Z","identifier":"9781492034131","name":"book.epub","title":"Prometheus: Up & Running","format":"book","content_format":"book","source":"application/epub+zip","orderable_title":"Prometheus: Up & Running","has_stylesheets":true,"description":"<span><div><p>Get up to speed with Prometheus, the metrics-based monitoring system used by thousands of organizations in production. This practical guide provides application developers, sysadmins, and DevOps practitioners with a hands-on introduction to the important aspects of Prometheus, including infrastructure and application monitoring, dashboarding and alerting, direct code instrumentation, and metric collection from third-party systems with exporters.</p><p>This open source system has gained popularity over the past few years for good reason. With its simple yet powerful data model and query language, Prometheus does one thing and it does it well. Author and Prometheus core developer Brian Brazil guides you through Prometheus setup, the Node Exporter, and the Alertmanager, then guides you through its use in application and infrastructure monitoring.</p><ul><li>Know where and how much to apply instrumentation to your application code</li><li>Expose metrics through client libraries to make them available to Prometheus</li><li>Identify metrics with labels: unique key-value pairs associated with a time series</li><li>Get an introduction to Grafana, a popular tool for building dashboards</li><li>Learn how to use the node exporter to monitor your infrastructure</li><li>Use service discovery to provide different views of your machines and services</li><li>Use Prometheus with Kubernetes, and examine exporters you can use with containers</li><li>Convert data from other monitoring systems into the Prometheus format</li></ul></div></span>","isbn":"9781492034148","issued":"2018-07-15","language":"en","rights":"Copyright \xc2\xa9 O\'Reilly Media, Inc.","updated":"2018-05-01T16:40:44.367564Z","orderable_author":"Brazil, Brian","purchase_link":null,"publisher_resource_links":{"Errata Page":"http://oreilly.com/catalog/0636920147343/errata"},"is_free":false,"is_system_book":true,"is_active":true,"is_hidden":false,"virtual_pages":458,"duration_seconds":null,"pagecount":384}\n'
Arguments: ()
info_9781492033905.log info_9781492034131.log
lukas@PRGN00008351A:~/git/safaribooks$ cat info_9781492034131.log
[24/May/2018 23:22:14] ** Welcome to SafariBooks! **
[24/May/2018 23:22:14] Logging into Safari Books Online...
[24/May/2018 23:22:20] Retrieving book info...
[24/May/2018 23:22:21] Title: Prometheus: Up & Running
[24/May/2018 23:22:21] Authors: Brian Brazil
[24/May/2018 23:22:21] Identifier: 9781492034131
[24/May/2018 23:22:21] ISBN: 9781492034148
[24/May/2018 23:22:21] Publishers: O'Reilly Media, Inc.
[24/May/2018 23:22:21] File "safaribooks.py", line 1024, in <module>
SafariBooks(args_parsed)
File "safaribooks.py", line 292, in __init__
self.display.book_info(self.book_info)
File "safaribooks.py", line 135, in book_info
self.info("{0}{1}{2}: {3}".format(self.SH_YELLOW, t[0], self.SH_DEFAULT, t[1]), True)
File "safaribooks.py", line 70, in info
self.out(output)
File "safaribooks.py", line 64, in out
sys.stdout.write("\r" + " " * self.columns + "\r" + put + "\n")
[24/May/2018 23:22:21] Unhandled Exception: 'ascii' codec can't encode character '\xa9' in position 122: ordinal not in range(128) (type: UnicodeEncodeError)
[24/May/2018 23:25:43] ** Welcome to SafariBooks! **
[24/May/2018 23:25:43] Logging into Safari Books Online...
[24/May/2018 23:25:45] Retrieving book info...
[24/May/2018 23:25:46] Title: Prometheus: Up & Running
[24/May/2018 23:25:46] Authors: Brian Brazil
[24/May/2018 23:25:46] Identifier: 9781492034131
[24/May/2018 23:25:46] ISBN: 9781492034148
[24/May/2018 23:25:46] Publishers: O'Reilly Media, Inc.
[24/May/2018 23:25:46] File "safaribooks.py", line 1024, in <module>
SafariBooks(args_parsed)
File "safaribooks.py", line 292, in __init__
self.display.book_info(self.book_info)
File "safaribooks.py", line 135, in book_info
self.info("{0}{1}{2}: {3}".format(self.SH_YELLOW, t[0], self.SH_DEFAULT, t[1]), True)
File "safaribooks.py", line 70, in info
self.out(output)
File "safaribooks.py", line 64, in out
sys.stdout.write("\r" + " " * self.columns + "\r" + put + "\n")
[24/May/2018 23:25:46] Unhandled Exception: 'ascii' codec can't encode character '\xa9' in position 239: ordinal not in range(128) (type: UnicodeEncodeError)