Comments (9)
I was trying to download an ebook.
from odmpy.
I may have missed out on a dependency. Can you run the pip install command below, and then retry the download again?
python3 -m pip install lxml
from odmpy.
On it!
from odmpy.
Alright, so don't think I had the dependency you just mentioned, but I got a different error this time. Here is the whole cmd output:
C:\Users\titus\Desktop\Libby>odmpy libby --ebook --direct
odmpy Interactive Client for Libby
Found 5 loans.
1: The Third Wheel 🎧 Jeff Kinney
* Expires: 2023-04-20 Johnson County Library and Olathe Public Library
2: The Long Haul 🎧 Jeff Kinney
* Expires: 2023-04-20 Johnson County Library and Olathe Public Library
3: Cabin Fever 🎧 Jeff Kinney
* Expires: 2023-04-24 Johnson County Library and Olathe Public Library
4: Physics for Game Developers 📕 David M Bourg
* Expires: 2023-05-04 Johnson County Library and Olathe Public Library
5: Diary of a Wimpy Kid 🎧 Jeff Kinney
* Expires: 2023-05-04 Johnson County Library and Olathe Public Library
Download. Choose from 1-5 (separate choices with a space or leave blank to quit),
then press enter: 4
Opening ebook "Physics for Game Developers"...
Downloading apa.html: 0%| | 0/274 [00:00<?, ?it/s]
An unexpected error has occurred
Traceback (most recent call last):
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\site-packages\odmpy\odm.py", line 1079, in run
extract_loan_file(libby_client, selected_loan, args)
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\site-packages\odmpy\odm.py", line 366, in extract_loan_file
process_ebook_loan(
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\site-packages\odmpy\processing\ebook.py", line 519, in process_ebook_loan
soup = BeautifulSoup(res.text, features="html.parser")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\site-packages\bs4_init_.py", line 228, in init
self.feed()
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\site-packages\bs4_init.py", line 289, in feed
self.builder.feed(self.markup)
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\site-packages\bs4\builder_htmlparser.py", line 167, in feed
parser.feed(markup)
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\html\parser.py", line 110, in feed
self.goahead(0)
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\html\parser.py", line 178, in goahead
k = self.parse_html_declaration(i)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\html\parser.py", line 269, in parse_html_declaration
self.handle_decl(rawdata[i+2:gtpos])
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\site-packages\bs4\builder_htmlparser.py", line 112, in handle_decl
self.soup.endData(Doctype)
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\site-packages\bs4_init.py", line 365, in endData
self.object_was_parsed(o)
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\site-packages\bs4_init_.py", line 370, in object_was_parsed
previous_element = most_recent_element or self._most_recent_element
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\site-packages\bs4\element.py", line 1040, in getattr
return self.find(tag)
^^^^^^^^^^^^^^
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\site-packages\bs4\element.py", line 1278, in find
l = self.find_all(name, attrs, recursive, text, 1, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\site-packages\bs4\element.py", line 1299, in find_all
return self._find_all(name, attrs, text, limit, generator, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\site-packages\bs4\element.py", line 528, in find_all
strainer = SoupStrainer(name, attrs, text, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\site-packages\bs4\element.py", line 1596, in init
self.text = self.normalize_search_value(text)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\site-packages\bs4\element.py", line 1601, in normalize_search_value
if (isinstance(value, str) or isinstance(value, collections.Callable) or hasattr(value, 'match')
^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'collections' has no attribute 'Callable'
Traceback (most recent call last):
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Scripts\odmpy-script.py", line 33, in
sys.exit(load_entry_point('odmpy==0.7.6', 'console_scripts', 'odmpy')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\site-packages\odmpy_main.py", line 27, in main
run()
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\site-packages\odmpy\odm.py", line 1079, in run
extract_loan_file(libby_client, selected_loan, args)
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\site-packages\odmpy\odm.py", line 366, in extract_loan_file
process_ebook_loan(
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\site-packages\odmpy\processing\ebook.py", line 519, in process_ebook_loan
soup = BeautifulSoup(res.text, features="html.parser")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\site-packages\bs4_init.py", line 228, in init
self.feed()
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\site-packages\bs4_init.py", line 289, in feed
self.builder.feed(self.markup)
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\site-packages\bs4\builder_htmlparser.py", line 167, in feed
parser.feed(markup)
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\html\parser.py", line 110, in feed
self.goahead(0)
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\html\parser.py", line 178, in goahead
k = self.parse_html_declaration(i)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\html\parser.py", line 269, in parse_html_declaration
self.handle_decl(rawdata[i+2:gtpos])
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\site-packages\bs4\builder_htmlparser.py", line 112, in handle_decl
self.soup.endData(Doctype)
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\site-packages\bs4_init.py", line 365, in endData
self.object_was_parsed(o)
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\site-packages\bs4_init.py", line 370, in object_was_parsed
previous_element = most_recent_element or self._most_recent_element
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\site-packages\bs4\element.py", line 1040, in getattr
return self.find(tag)
^^^^^^^^^^^^^^
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\site-packages\bs4\element.py", line 1278, in find
l = self.find_all(name, attrs, recursive, text, 1, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\site-packages\bs4\element.py", line 1299, in find_all
return self._find_all(name, attrs, text, limit, generator, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\site-packages\bs4\element.py", line 528, in _find_all
strainer = SoupStrainer(name, attrs, text, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\site-packages\bs4\element.py", line 1596, in init
self.text = self._normalize_search_value(text)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\titus\AppData\Local\Programs\Python\Python311\Lib\site-packages\bs4\element.py", line 1601, in _normalize_search_value
if (isinstance(value, str) or isinstance(value, collections.Callable) or hasattr(value, 'match')
^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'collections' has no attribute 'Callable'
from odmpy.
It looks like you have a very old version of a dependency. Please upgrade it and then try again.
python3 -m pip install beautifulsoup4 --upgrade
from odmpy.
Okay
from odmpy.
This is the version it updated to: Successfully installed beautifulsoup4-4.12.2
from odmpy.
It worked! I have one more question. Can you make the program automatically turn it into a pdf. I was reading the docs, but I got really confused about the file system. Then when I looked it up it said you could do --direct pdf to get a pdf. It didn't work. If I can't turn it into a pdf straight from the program that's fine. Thanks.
from odmpy.
You misread. Only books available in the "Open PDF" format can be downloaded as a pdf.
eBooks
Experimental Feature
Using the
--ebooks
option will allow you to download/return/renew EPUB/PDF eBook loans. Information about the different eBook formats available can be found here.For EPUB/PDF DRM loans,
odmpy
will download an.acsm
file for use with Adobe Digital Editions (ADE) by default.For loans available as an "Open EPUB" or "Open PDF", the actual DRM-free
.epub
/.acsm
file for open formats.The
--direct
optionUsing the
--direct
option with EPUB DRM loans will download the web Libby version of the eBook as an.epub
. This is different from the.epub
that you get when you use an.acsm
loan file with ADE.This option is not recommended because the
.epub
downloaded may not work well with your reader. Use this as an alternative if you cannot use the.acsm
file for whatever reason.The
--direct
option does not affect PDF eBook loans. These will continue to be downloaded as.acsm
or
from odmpy.
Related Issues (20)
- Read/write settings in `XDG_CONFIG_HOME` HOT 6
- Feature: Download books that can only be read with the Libby app HOT 3
- Is the latest version of this project 0.8.0 or 0.80? HOT 2
- Intermittenly, odmpy libby has time data value error HOT 2
- odmpy libby download issue HOT 2
- odmpy crashes when downloading audiobooks on 0.8.1 HOT 2
- How can i use it? I do not know python. HOT 2
- Long chapters are split into too-small chapters with duplicate names HOT 2
- Invalid date string HOT 4
- The --selectid option gets only the last ID in the list HOT 8
- [Feature] Multiple Subfolders
- 403 error upon using odmlibby HOT 11
- Breaking Changes HOT 1
- 403 Client Error HOT 4
- Error 1002 Hash Mismatch - HTTP Error while downloading license.
- Unable to access Libby through odmpy due to Traceback error HOT 1
- Magazines not downloading -- Error below HOT 1
- Program 'failed to create process'
- 403 Forbidden Error HOT 28
- audio books not downloading HOT 23
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from odmpy.