steinarb / opds-reader Goto Github PK
View Code? Open in Web Editor NEWA calibre plugin containing an OPDS client that can import books into calibre
License: GNU General Public License v3.0
A calibre plugin containing an OPDS client that can import books into calibre
License: GNU General Public License v3.0
Doesn't this already happen?
calibre, version 5.1.0
ERROR: Unhandled exception: AttributeError:object has no attribute 'id'
calibre 5.1 embedded-python: True is64bit: True
macOS-10.15.7-x86_64-i386-64bit Darwin ('64bit', '')
('Darwin', '19.6.0', 'Darwin Kernel Version 19.6.0: Mon Aug 31 22:12:52 PDT 2020; root:xnu-6153.141.2~1/RELEASE_X86_64')
Python 3.8.5
OSX: ('10.15.7', ('', '', ''), 'x86_64')
Interface language: None
Successfully initialized third party plugins: OPDS Client (1, 0, 0)
Traceback (most recent call last):
File "site-packages/feedparser.py", line 398, in getattr
File "site-packages/feedparser.py", line 356, in getitem
KeyError: 'id'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "calibre_plugins.opds_client.main", line 182, in download_opds
File "calibre_plugins.opds_client.model", line 97, in downloadOpdsCatalog
File "calibre_plugins.opds_client.model", line 143, in makeMetadataFromParsedOpds
File "calibre_plugins.opds_client.model", line 150, in opdsToMetadata
File "site-packages/feedparser.py", line 400, in getattr
AttributeError: object has no attribute 'id'
Hi, please can you fix it? This happens to the OPDS catalog https://flibusta.site/opds
calibre, version 5.1.0
ERROR: Unhandled exception: ValueError:unconverted data remains: +02:00
calibre 5.1 embedded-python: True is64bit: True
macOS-10.15.7-x86_64-i386-64bit Darwin ('64bit', '')
('Darwin', '19.6.0', 'Darwin Kernel Version 19.6.0: Mon Aug 31 22:12:52 PDT 2020; root:xnu-6153.141.2~1/RELEASE_X86_64')
Python 3.8.5
OSX: ('10.15.7', ('', '', ''), 'x86_64')
Interface language: None
Successfully initialized third party plugins: OPDS Client (1, 0, 0)
Traceback (most recent call last):
File "calibre_plugins.opds_client.main", line 182, in download_opds
File "calibre_plugins.opds_client.model", line 97, in downloadOpdsCatalog
File "calibre_plugins.opds_client.model", line 143, in makeMetadataFromParsedOpds
File "calibre_plugins.opds_client.model", line 153, in opdsToMetadata
File "lib/python3.8/_strptime.py", line 568, in _strptime_datetime
File "lib/python3.8/_strptime.py", line 352, in _strptime
ValueError: unconverted data remains: +02:00
Hello !
I just installed the plugin and I must admit it's a great tool :)
Unfortunately when browsing a catalog (http://gallica.bnf.fr/opds), I can list the different categories and download the catalogs to be displayed in the plugin windows, but then it freezes and I can't select any book to be downloaded.
How can I provide information to help debugging ?
Here is a screenshot when it's freezing : Screenshot
Cheers
CyD
calibre, version 5.1.0
ERROR: Unhandled exception: AttributeError:object has no attribute 'author'
calibre 5.1 embedded-python: True is64bit: True
macOS-10.15.7-x86_64-i386-64bit Darwin ('64bit', '')
('Darwin', '19.6.0', 'Darwin Kernel Version 19.6.0: Mon Aug 31 22:12:52 PDT 2020; root:xnu-6153.141.2~1/RELEASE_X86_64')
Python 3.8.5
OSX: ('10.15.7', ('', '', ''), 'x86_64')
Interface language: None
Successfully initialized third party plugins: OPDS Client (1, 0, 0)
Traceback (most recent call last):
File "site-packages/feedparser.py", line 398, in getattr
File "site-packages/feedparser.py", line 356, in getitem
KeyError: 'author'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "calibre_plugins.opds_client.main", line 182, in download_opds
File "calibre_plugins.opds_client.model", line 97, in downloadOpdsCatalog
File "calibre_plugins.opds_client.model", line 143, in makeMetadataFromParsedOpds
File "calibre_plugins.opds_client.model", line 148, in opdsToMetadata
File "site-packages/feedparser.py", line 400, in getattr
AttributeError: object has no attribute 'author'
E.g. the "Maven cookbook" was already present, but it still showed up as a new download candidate.
I tried to load my fbreader library (https://books.fbreader.org/opds), but it needs google oauth2 (for web applications), which isn't supported.
(Python has a camelCase modula/pascal feel to it)
I use the entire collection of OpenStax and I have the Author set to OpenStax...downloading ends up with many folders such as 'OpenStax 123' 'OpenStax 987', et cetera...They should all be in the same folder, otherwise it pollutes the library.
A 'Download All' button might be nice to have (allowing for hiding any books in user library already).
Edit: A button to 'select all' might be better, it'd allow for more fine-grain control in the end.
Edit: For now, I've set the SelectionMode
to QAbstractItemView::ExtendedSelection
which allows cursor drag-selection.
This morning I upgraded calibre to the latest version, 5.38.0. After restarting, I attempted to invoke the OPDS Client plugin, and it failed with a "KeyError: 'Server'" error. I restarted calibre in debug mode and produced the following log file:
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
calibre Debug log
calibre 5.38 embedded-python: True is64bit: True
Linux-5.13.0-28-generic-x86_64-with-glibc2.2.5 Linux ('64bit', 'ELF')
('Linux', '5.13.0-28-generic', '#3120.04.1-Ubuntu SMP Wed Jan 19 14:08:10 UTC 2022')20.04.1-Ubuntu SMP Wed Jan 19 14:08:10 UTC 2022')
Python 3.8.5
Interface language: None
Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 47, 0) && DeDRM (10, 0, 2) && Package KFX (from KFX Input) (1, 47, 0) && Find Duplicates (1, 9, 4) && Goodreads (1, 5, 3) && Goodreads Sync (1, 15, 1) && KFX metadata reader (from KFX Input) (1, 47, 0) && KFX Input (1, 47, 0) && Kindle hi-res covers (0, 5, 0) && OPDS Client (1, 0, 0) && Obok DeDRM (7, 2, 1) && Search The Internet (1, 8, 1) && Standard Ebooks (1, 0, 0)
calibre 5.38 embedded-python: True is64bit: True
Linux-5.13.0-28-generic-x86_64-with-glibc2.2.5 Linux ('64bit', 'ELF')
('Linux', '5.13.0-28-generic', '#31
Python 3.8.5
Interface language: None
Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 47, 0) && DeDRM (10, 0, 2) && Package KFX (from KFX Input) (1, 47, 0) && Find Duplicates (1, 9, 4) && Goodreads (1, 5, 3) && Goodreads Sync (1, 15, 1) && KFX metadata reader (from KFX Input) (1, 47, 0) && KFX Input (1, 47, 0) && Kindle hi-res covers (0, 5, 0) && OPDS Client (1, 0, 0) && Obok DeDRM (7, 2, 1) && Search The Internet (1, 8, 1) && Standard Ebooks (1, 0, 0)
Turning on automatic hidpi scaling
devicePixelRatio: 1.0
logicalDpi: 96.0 x 96.0
physicalDpi: 127.99999999999999 x 128.18691588785046
Using calibre Qt style: True
[0.00] Starting up...
[0.00] Showing splash screen...
[0.06] splash screen shown
[0.06] Initializing db...
[0.08] db initialized
[0.08] Constructing main UI...
DEBUG: 0.0 Goodreads Sync::dialogs.py - loading translations
DEBUG: 0.0 GoodreadsSync::action.py - loading translations
DEBUG: 0.0 obok::utilities.py - loading translations
DEBUG: 0.0 obok::dialogs.py - loading translations
DEBUG: 0.0 obok::config.py - loading translations
DEBUG: 0.0 obok::action_err.py - loading translations
DEBUG: 0.6 HttpHelper::init: proxy=None
[0.93] main UI initialized...
[0.93] Hiding splash screen
Starting QuickView
Failed to initialize plugin: '/home/kevin/.config/calibre/plugins/Inept Epub DeDRM.zip'
Traceback (most recent call last):
File "calibre/customize/ui.py", line 740, in initialize_plugins
File "calibre/customize/ui.py", line 64, in load_plugin
File "calibre/customize/zipplugin.py", line 292, in load
File "importlib/init.py", line 127, in import_module
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "calibre/customize/zipplugin.py", line 184, in exec_module
File "calibre/customize/zipplugin.py", line 180, in get_code
File "calibre_plugins.ineptepub.init", line 168
print 'IneptEpub: Using libcrypto.'
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('IneptEpub: Using libcrypto.')?
calibre 5.38 embedded-python: True is64bit: True
Linux-5.13.0-28-generic-x86_64-with-glibc2.2.5 Linux ('64bit', 'ELF')
('Linux', '5.13.0-28-generic', '#31~20.04.1-Ubuntu SMP Wed Jan 19 14:08:10 UTC 2022')
Python 3.8.5
Interface language: None
Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 47, 0) && DeDRM (10, 0, 2) && Package KFX (from KFX Input) (1, 47, 0) && Find Duplicates (1, 9, 4) && Goodreads (1, 5, 3) && Goodreads Sync (1, 15, 1) && KFX metadata reader (from KFX Input) (1, 47, 0) && KFX Input (1, 47, 0) && Kindle hi-res covers (0, 5, 0) && OPDS Client (1, 0, 0) && Obok DeDRM (7, 2, 1) && Search The Internet (1, 8, 1) && Standard Ebooks (1, 0, 0)
Traceback (most recent call last):
File "calibre_plugins.opds_client.ui", line 24, in show_dialog
d = OpdsDialog(self.gui, self.qaction.icon(), do_user_config)
File "calibre_plugins.opds_client.main", line 68, in init
catalogsTuple = self.model.downloadOpdsRootCatalog(self.gui, self.opdsUrlEditor.currentText(), False)
File "calibre_plugins.opds_client.model", line 78, in downloadOpdsRootCatalog
self.serverHeader = feed.headers['Server']
KeyError: 'Server'
[3.39] splash screen hidden
[3.39] Started up in 3.39 seconds with 642 books**
After reinstalling calibre 5.37.0, the plugin worked as normal.
Calibre 5.44.0
OS: Windows8.1
The plugin is installed normally, but there is no button.
calibre just upgraded to version 6.0.0, and Calibre OPDS client fails with:
calibre, version 6.0.0
ERROR: Unhandled exception: AttributeError:type object 'QHeaderView' has no attribute 'Stretch'
calibre 6.0 embedded-python: True
Linux-5.15.0-33-generic-x86_64-with-glibc2.31 Linux ('64bit', 'ELF')
('Linux', '5.15.0-33-generic', '#34~20.04.1-Ubuntu SMP Thu May 19 15:51:16 UTC 2022')
Python 3.10.1
Interface language: None
Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 49, 0) && DeDRM (10, 0, 2) && Package KFX (from KFX Input) (1, 49, 0) && Find Duplicates (1, 9, 5) && Goodreads (1, 5, 3) && Goodreads Sync (1, 15, 1) && KFX metadata reader (from KFX Input) (1, 49, 0) && KFX Input (1, 49, 0) && Kindle hi-res covers (0, 5, 0) && OPDS Client (1, 0, 0) && Obok DeDRM (7, 2, 1) && Search The Internet (1, 8, 1) && Standard Ebooks (1, 0, 0)
Traceback (most recent call last):
File "calibre_plugins.opds_client.ui", line 24, in show_dialog
d = OpdsDialog(self.gui, self.qaction.icon(), do_user_config)
File "calibre_plugins.opds_client.main", line 105, in init
self.library_view.horizontalHeader().setSectionResizeMode(0, QHeaderView.Stretch)
AttributeError: type object 'QHeaderView' has no attribute 'Stretch'
On the calibre website, under "What's New" there's this:
"Because calibre has now moved to Qt 6, some third party plugins will no longer work, until they are also ported to Qt 6. Fortunately, plugin developers were given over half a year to port their plugins, so most have already been ported."
It would look a lot better with thumbnails
(I can't remember what "the documentation format is" anymore)
Does this work with Calibre 3.x?
I tried it, and it ran into an error.
Hi,
I wan't use this plugin with a calibre-web generated opds.
My server is private and authentification must be use.
Does this plugin support basic authentification from calibre-web?
Thanks for your help!
Remove all print statements from the code.
I think I saw something similar when downloading the opds itself, but I wasn't paying attention then. Download continues ok in spite of these exceptions. Maybe it happens when an entry does not have a timestamp, if that is possible?
calibre, version 2.71.0
ERROR: Unhandled exception: TypeError:'NoneType' object is not iterable
calibre 2.71 embedded-python: True is64bit: True
Linux-4.1.13-100.fc21.x86_64-x86_64-with-fedora-21-Twenty_One Linux ('64bit', 'ELF')
('Linux', '4.1.13-100.fc21.x86_64', '#1 SMP Tue Nov 10 13:13:20 UTC 2015')
Python 2.7.9
Linux: ('Fedora', '21', 'Twenty One')
Successfully initialized third party plugins: OPDS Client (1, 0, 0)
Traceback (most recent call last):
File "site-packages/calibre/gui2/library/models.py", line 923, in data
TypeError: 'NoneType' object is not iterable
I changed configuration and pressed Ok. And got this:
calibre, version 6.13.0
ОШИБКА: Необработанное прерывание:: <b>ModuleNotFoundError</b>:No module named 'config'
calibre 6.13 embedded-python: True
Windows-10-10.0.19045-SP0 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19045')
Python 3.10.1
Windows: ('10', '10.0.19045', 'SP0', 'Multiprocessor Free')
Interface language: ru
Successfully initialized third party plugins: AudioBook_Duration (1, 0, 9) && BookFusion Plugin (0, 8, 0) && Extract ISBN (1, 6, 0) && GetFileName (0, 2, 0) && Import List (1, 9, 0) && Job Spy (1, 0, 205) && KOReader Sync (0, 4, 1) && Libgen Fiction (0, 4, 0) && Library Codes (1, 0, 54) && Library Genesis (1, 2, 0) && OPDS Client (1, 0, 0) && Reading List (1, 15, 1) && TextDiff (1, 1, 2) && Wikidata (2, 0, 0) && Wikidata gui (2, 0, 0) && Zotero Metadata Importer (1, 0, 78)
Traceback (most recent call last):
File "calibre\gui2\preferences\plugins.py", line 301, in customize_plugin
File "calibre\gui2\preferences\plugins.py", line 379, in modify_plugin
File "calibre\customize\__init__.py", line 177, in do_user_config
File "calibre_plugins.opds_client.__init__", line 37, in save_settings
File "calibre_plugins.opds_client.ui", line 28, in apply_settings
ModuleNotFoundError: No module named 'config'
I suppose this line:
opds-reader/calibre_plugin/ui.py
Line 28 in 4c21b06
from .config import prefs
Calibre 6.13.0.
I just updated my calibre installation to version 5.0.1, and the OPDS Client entry on the main toolbar disappeared. I attempted to reinstall, but it doesn't show as an available action to install on the toolbar.
Some examples:
http://www.feedbooks.com/books/top.atom?category=FBFIC028000&lang=en
http://www.feedbooks.com/catalog.atom
http://bookserver.archive.org/catalog/
http://pragprog.com/magazines.opds
http://www.manybooks.net/opds/index.php
http://m.gutenberg.org/ebooks/?format=opds
http://opds.oreilly.com/opds/
http://www.baenebooks.com/stanza.aspx
When updating the book list model after each OPDS chunk, the line heights are wrong.
The line heights are corrected after the final read but they look a bit silly during the intermediate chunks.
Hi, i get an error on calibre 3:
Traceback (most recent call last):
File "/usr/lib/calibre/calibre/gui2/ui.py", line 156, in __init__
ac = self.init_iaction(action)
File "/usr/lib/calibre/calibre/gui2/ui.py", line 170, in init_iaction
ac = action.load_actual_plugin(self)
File "/usr/lib/calibre/calibre/customize/__init__.py", line 614, in load_actual_plugin
ac = getattr(importlib.import_module(mod), cls)(gui,
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/usr/lib/calibre/calibre/customize/zipplugin.py", line 183, in load_module
exec compiled in mod.__dict__
File "calibre_plugins.opds_client.ui", line 9, in <module>
File "/usr/lib/calibre/calibre/customize/zipplugin.py", line 183, in load_module
exec compiled in mod.__dict__
File "calibre_plugins.opds_client.main", line 12, in <module>
File "/usr/lib/calibre/calibre/customize/zipplugin.py", line 183, in load_module
exec compiled in mod.__dict__
File "calibre_plugins.opds_client.model", line 12, in <module>
ImportError: cannot import name feedparser
I think calibre changed something. Installing python module (pip install feedparser) did not help because this is related to
from calibre.web.feeds import feedparser
regards
I'm not sure which entry is problematic (Published?), but there is a parsing issue that occurs after clicking 'Download OPDS'. Some of my entries cannot have a Published date because they're ancient, such as Shakespearean texts, as an example.
Does this occur only with PDF books?
The exlusion list, is a list of books that should be permanently hidden from the comparison.
Perhaps use the Bonjour protocol? (is this what FBReaderJ uses?)
I don't know if this is possible or not, but is there any way to select the format of the book that can be downloaded from the OPDS feed? For example, I use the OPDS client to check for revisions to ebooks from Standard Ebooks (https://standardebooks.org/opds). When I select a book to download, it automatically downloads the epub format, which I really can't use since I have a kindle (I know, I can convert with calibre, but I'd rather have it in the azw3 format that SE provides).
On devices with smaller screens, it can be impossible to use the UI. Perhaps designing the UI to be friendly to smaller viewports such as 720p or even 480p might be nice.
Can't be done with OPDS.
The calibre REST API must be used for this (the calibre REST API is used to set the import/purchase dates).
Log:
Starting job: https://standardebooks.org/ebooks/abraham-merritt/the-moon-pool/dist/abraham-merritt_the-moon-pool.epub3
Job: "https://standardebooks.org/ebooks/abraham-merritt/the-moon-pool/dist/abraham-merritt_the-moon-pool.epub3" failed with error:
Traceback (most recent call last):
File "site-packages\calibre\gui2\threaded_jobs.py", line 83, in start_work
File "site-packages\calibre\gui2\ebook_download.py", line 87, in __call__
File "site-packages\calibre\gui2\ebook_download.py", line 109, in _add
Exception: Not a support e-book format.
Called with args: (<calibre.gui2.ui.Main object at 0x00000188486F9678>, None, u'https://standardebooks.org/ebooks/abraham-merritt/the-moon-pool/dist/abraham-merritt_the-moon-pool.epub3', u'', u'', True, [], None) {u'abort': <threading._Event object at 0x000001884D1F49C8>, u'log': <calibre.utils.logging.GUILog object at 0x000001884D1F4C88>, u'notifications': <Queue.Queue instance at 0x000001884D1F4848>}
Attempting to grab from the Standard Ebooks OPDS feed
When trying to use the "Popular" OPDS from http://m.gutenberg.org/ebooks/?format=opds (used as an example that you can easily reach, my COPS installation triggers the same error) I receive an error that the author attribute cannot be found. My feeling is that the opds-reader is not recursing sufficiently deeply into the XML responses to actually find books, finding a list of categories without books may cause this error.
Error as follows
calibre 2.63 embedded-python: True is64bit: True
Linux-3.13.0-92-generic-x86_64-with-debian-jessie-sid Linux ('64bit', 'ELF')
('Linux', '3.13.0-92-generic', '#139-Ubuntu SMP Tue Jun 28 20:42:26 UTC 2016')
Python 2.7.9
Linux: ('debian', 'jessie/sid', '')
Successfully initialized third party plugins: OPDS Client (1, 0, 0)
Traceback (most recent call last):
File "calibre_plugins.opds_client.main", line 182, in download_opds
File "calibre_plugins.opds_client.model", line 97, in downloadOpdsCatalog
File "calibre_plugins.opds_client.model", line 143, in makeMetadataFromParsedOpds
File "calibre_plugins.opds_client.model", line 149, in opdsToMetadata
File "site-packages/calibre/web/feeds/feedparser.py", line 408, in getattr
AttributeError: object has no attribute 'author'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.