Code Monkey home page Code Monkey logo

calibre_plugins's People

Contributors

2600box avatar busches avatar changhuapeng avatar kiwidude68 avatar martinca avatar sgmoore avatar un-pogaz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

calibre_plugins's Issues

Count Pages 1.11.2 through 1.13.2 - No longer processes .cbz files

Up until 2 months ago, Count Pages plug-in successfully calculated page count in. cbz files with no problems. However it has stopped working, even with newest update. Returns error mesage of "WARNING: Page/word/statistics warnings: Could not analyse some statistics in 1 of 1 books, for reasons shown in details below.

Avengers - Four - Unknown (No convertible format found)"

Same result whether using E-book viewer (calibere) or ADE.

LMK if any additional would help. Appreciate everything you've done so far with plugins - all supremely helpful!

Edit: 1) confirmed works fine on regular epub files. 2) confirmed does not work on .zip files

Search in Internet: export fails

When trying to export in Calibre-7.4.0 the configuration (click button 'Search the Internet' / Customize plug-in..., right click any line, click Export...), I get the error message 'QFileDialog' has no attribute 'AnyFile'. It seems this is related to differences between Qt6 and Qt5.

The full error message is:

calibre, version 7.4.0
FOUT: Niet afgehandelde fout: AttributeError:type object 'QFileDialog' has no attribute 'AnyFile'

calibre 7.4 embedded-python: True
Windows-10-10.0.22621-SP0 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.22621')
Python 3.11.5
Windows: ('10', '10.0.22621', 'SP0', 'Multiprocessor Free')
Interface language: nl
Successfully initialized third party plugins: DeDRM (10, 0, 3) && BOL_NL (5, 1, 3) && Library Codes (1, 0, 65) && Search The Internet (1, 10, 4) && Zotero Metadata Importer (1, 0, 78)
Traceback (most recent call last):
File "calibre_plugins.search_the_internet.config", line 1065, in export_menus
File "calibre_plugins.search_the_internet.config", line 1110, in pick_archive_name_to_export
AttributeError: type object 'QFileDialog' has no attribute 'AnyFile'

Error when looking for "unmanifested files"

I have some epubs where Modify ePubs, version 1.8.1 delete manifested files. It seems this happens when the file names contain characters such as space or brackets. The built-in epub checker used by Calibre "Edit book" feature is able to flag and rename this files without problem. However "Modify ePubs" apparently fails to see this files are referenced in the manifest and it delete them.

Below is an example from Modify ePubs log

Looking for unmanifested files
  Found file to to remove: Auel,Jean M.-[Les Enfants de la Terre-2]La Vallee des chevaux.A4.opusLu2_split_000.htm
  Found file to to remove: Auel,Jean M.-[Les Enfants de la Terre-2]La Vallee des chevaux.A4.opusLu2_split_001.htm
  Found file to to remove: Auel,Jean M.-[Les Enfants de la Terre-2]La Vallee des chevaux.A4.opusLu2_split_002.htm
  Found file to to remove: Auel,Jean M.-[Les Enfants de la Terre-2]La Vallee des chevaux.A4.opusLu2_split_003.htm
  Found file to to remove: Auel,Jean M.-[Les Enfants de la Terre-2]La Vallee des chevaux.A4.opusLu2_split_004.htm
  Found file to to remove: Auel,Jean M.-[Les Enfants de la Terre-2]La Vallee des chevaux.A4.opusLu2_split_005.htm
  Found file to to remove: Auel,Jean M.-[Les Enfants de la Terre-2]La Vallee des chevaux.A4.opusLu2_split_006.htm
  Found file to to remove: Auel,Jean M.-[Les Enfants de la Terre-2]La Vallee des chevaux.A4.opusLu2_split_007.htm
  Found file to to remove: Auel,Jean M.-[Les Enfants de la Terre-2]La Vallee des chevaux.A4.opusLu2_split_008.htm
  Found file to to remove: Auel,Jean M.-[Les Enfants de la Terre-2]La Vallee des chevaux.A4.opusLu2_split_009.htm

I suggest "Modify ePubs" fixes the (bad) file names and the manifest as does the checker in Calibre "Edit book".

"Sync Now" enabled but nothing happens when pressed

Using Calibre 5.11.0, Reading List v1.15.1 and Kindle Paperwhite (11th Generation)

1 Start Calibre
2. Plug in Kindle
3. "Reading List"->"Sync Now" becomes enabled
4. Press "Sync Now."

At this point, no jobs are created or started to sync the kindle.

The same steps work with my old (7th generation) kindle

Count Pages: unpredictable/unconfigurable page count for book records with multiple formats

I often have books in multiple formats (EPUB, PDF, and MOBI, for example). I would like to be able to predict and/or configure how the pages are counted—so, for example, to fall back on the actual PDF page count instead of making an estimate from the EPUB or MOBI, for example (if there is a PDF). As it is, I don't know which file the page estimates correspond to for each record--just that they only sometimes match the PDF.

Count Pages - Consider using the embedded json blob in goodreads

It appears that Goodreads embeds the json blob that feeds the UI within the HTML document within <script id="__NEXT_DATA__" type="application/json">. You can probably simplify download.py a lot if you grab that json blob and then use numPages under the details section. Here's how I found it with several books in my library:

$ wget -qSO- 'https://www.goodreads.com/book/show/29867' | grep -oP '<script id="__NEXT_DATA__" type="application/json">([^<]+)' | sed 's,<script id="__NEXT_DATA__" type="application/json">,,g' | jq . | grep numPages
            "numPages": 105,

The result is pretty consistent throughout my library.

Goodreads - Could not parse data

Trying to add metadata to a book and the plugin cant parse the goodreads page.

calibre, version 6.14.1
ERROR: No matches found:

Failed to find any books that match your search. Try making the search less specific. For example, use only the author's last name and a single distinctive word from the title.

To see the full log, click "Show details".

Running identify query with parameters:
{'title': 'The Four Divine Beasts', 'authors': ['Wo Chi Xi Hong Shi'], 'identifiers': {'goodreads': '40899385'}, 'timeout': 30}
Using plugins: Goodreads (1, 7, 3)
The log from individual plugins is below

****************************** Goodreads (1, 7, 3) ******************************
Found 0 results
Downloading from Goodreads took 1.4195895195007324
[GoodreadsMoreTags] Integration active
identify - start. title=The Four Divine Beasts, authors=['Wo Chi Xi Hong Shi'], identifiers={'goodreads': '40899385'}
[GoodreadsMoreTags] Captured identifier 40899385
Goodreads book url: 'https://www.goodreads.com/book/show/40899385'
Trying to parse book json for 2022 web page format
Json script node found, page in 2022+ html format
Could not parse all of title/authors/goodreads id from: 'https://www.goodreads.com/book/show/40899385'
Found Goodreads id: '40899385' Title: None Authors: None
[GoodreadsMoreTags] Captured 0 result(s) for 40899385


The identify phase took 1.42 seconds
The longest time (1.4195895195007324) was taken by: Goodreads
Merging results from different sources
We have 0 merged results, merging took: 0.00 seconds

Automate ASIN fix?

Hi,

I'm looking to automate the ASIN for kindle fire fix upon conversion to the mobi file format, or at least on first load into the calibre library. Would this somehow be possible? There doesn't seem to be a setting for it.

Use case is so that I can load a file into my library and have it be served in an already fixed state via Calibre server for download to my kindle.

Thanks!

GoodReads Sync plugin runs "add to read shelf" actions on books that are actually currently-reading

Problem Statement

There is a checkbox on the Update Reading Progress dialog to "Put finished books on read shelf", which is supposed to move books to the read shelf if progress >= 100 during an "Update reading progress" action. This is not currently working as advertised.

Books having their reading progress synced that are not finished yet (progress is less than 100) are having the read shelf add actions ran instead of the currently-reading add actions ran.

EXPECTED behavior:

  • Books whose progress are now >= 100 get moved to the read shelf, and have the read shelf's Shelf Add actions executed.
  • Books whose progress < 100 (say, 39%) have the "Shelf Add actions" for the currently-reading shelf ran after update, and NOT having the read shelf's Shelf Add Actions executed for this book.

ACTUAL behavior:

(assuming the "Put books on currently-reading" and "Put Finished books on read shelf" checkboxes are both checked)

  • Books whose progress are still < 100 (say, 39%) correctly stay on the currently-reading shelf on GoodReads, but have the read shelf's "Shelf Add actions" executed instead of the Shelf Add Actions for the currently-reading shelf in calibre.

Possibly wrong hypothesis from someone who doesn't really know python and is unfamiliar with this codebase:

The following line uses a hard-coded reference to the read shelf name and indiscriminately adds the read Shelf Add actions regardless if it's updating an in-progress book or a finished book:

add_actions.extend(self.shelves_map[self.read_shelf_name].get(cfg.KEY_ADD_ACTIONS,[]))

Modify ePub should run on import

Hey, great work here!

I think the modify ePub plugin is being underutilized as a UI plugin, and should be duplicated/forked into a FilePlugin that runs every time you import a new book.

This way, we don't have to go into the plugin every time we want to run some default manipulations on an ePub, and instead it'll happen automatically.

Count Pages - Additional menu options

If feasible: A separate menu item that would fill out only unpopulated columns.

Use-case: I would use this in place of turning off 'overwrite always.'

Thanks in advance.

Manage Series - Issue with using any of the Search websites functions for series information

Hi, sorry I am a bit new to Calibre and I am having an issue with the Manage Series plugin when trying to search and of the website options listed to search for Series Information, I get the following error:

calibre, version 6.13.0
ERROR: Unhandled exception: TypeError:QUrl.fromEncoded(): argument 1 has unexpected type 'str'

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: en_GB
Successfully initialized third party plugins: Comicvine (0, 14, 1) && Embed Comic Metadata (1, 6, 5) && Evrit (1, 3, 0) && Extract ISBN (1, 6, 0) && Find Duplicates (1, 10, 7) && Goodreads (1, 7, 3) && Goodreads More Tags (1, 2, 1) && Job Spy (1, 0, 211) && Kindle hi-res covers (0, 5, 0) && Manage Series (1, 5, 0) && ePub Extended Metadata {Writer} (0, 8, 1) && ePub Extended Metadata {Reader} (0, 8, 1) && ePub Extended Metadata (0, 8, 1)
Traceback (most recent call last):
File "calibre_plugins.manage_series.dialogs", line 760, in search_web
TypeError: QUrl.fromEncoded(): argument 1 has unexpected type 'str'

Thank you in advance!

Count Pages - Calculating Gunning Fog index is not working

The gunning fog index calculation is not working for the count pages plugin.

Count Pages v1.12.1
Calibre v6.12.0
Windows 10 22H2

Log:

Count Page/Word Statistics
Initialized urlfixer
do_count_statistics - book_path=C:\Users\user\AppData\Local\Temp\calibre_57i06tjb\t4hedm1v_count_pages\976.epub, pages_algorithm=0, page_count_mode=Estimate, statistics_to_run=['PageCount', 'WordCount', 'GunningFog'], custom_chars_per_page=1500, icu_wordcount=True
do_count_statistics - job started for file book_path=C:\Users\user\AppData\Local\Temp\calibre_57i06tjb\t4hedm1v_count_pages\976.epub
-------------------------------
Logfile for book ID 976 (Book - Author)
	Method of counting _page_count_mode=Estimate _download_sources=[]
	results= {'PageCount': 4, 'WordCount': 944}
	Found 4 pages
	Found 944 words
976
Traceback (most recent call last):
  File "calibre_plugins.count_pages.jobs", line 211, in do_statistics_for_book
  File "calibre_plugins.count_pages.statistics", line 324, in get_text_analysis
  File "calibre_plugins.count_pages.nltk_lite.textanalyzer", line 22, in __init__
ModuleNotFoundError: No module named 'copy_reg\r'
Initialized urlfixer
do_statistics_for_book:  C:\Users\user\AppData\Local\Temp\calibre_57i06tjb\t4hedm1v_count_pages\976.epub 0 Estimate [] ['PageCount', 'WordCount', 'GunningFog'] 1500 True
	Estimated accurate page count
	  Lines: 120  Divs: 5  Paras: 51
	  Accurate count: 3  Fast count: 4
	Page count: 4
	Word count using icu_wordcount - trying to count_words
	Word count - used count_words: 944
	Word count: 944

Documentation Requst: How to build the plugins

I just spent a bunch of time trying to figure out how to use these plugins, as all the documentation for each plugin mentions "the plugin zip file".

Getting some documentation around build here would be very helpful.

I tried to just clone and generate a zip of the plugin directory, which will let the plugin be installed, but throw an error when using it because of the missing common dependencies.

At first I thought this was some dependency injection that calibre-debug would do (e.g. insert code at calibre_plugins.modify_epub.common_icons) but after parsing previous issues and the .build directory, I realized that the dependencies are actually injected at build time via some unknown process.

With this strategy, you have tagged individual plugin versions, but have no GH releases or notes in the README about versions.

Finally, I have downloaded the built zip and have written my Docker file to utilize + extract the commandline script from the tar.

Quality Check: Search Epub - Minimum Window Size locked at max width of longest search string in history

Pretty straight forward, as long as there is a long string in the search history, the window cannot be resized smaller than the minimum width it takes to fully display that string. Sizing the window to fit the search string seems like a reasonable feature up to a point, but setting an upper bound on that and allowing the user to resize below it would likely be worthwhile. :)

Example below, the window cannot be made smaller than it's shown in the screenshot. If I remove the long search string manually from the history in gui.json, I can resize down the next longest string in history.

image

Goodreads Sync - Problems syncing Goodreads progress

Currently having some issues with the goodreads sync plugin, even though i have the category set correctly within the plugin settings, it doesn't seem to want to update the value, staying blank (-1) unless i manually change the it, and even then it stays at whatever value I set it to, with the automatic shelf switching taking effect.

[Search the Internet] Restore original sites

The only known methods for restoring the original sites are:

  1. Restoring a backup (requires a backup, overwrites existing sites)
  2. Deleting the json and restarting Calibre (overwrites existing site)

Thankfully I hadn't customized mine very much. But a method to restore the original sites without overwriting would be helpful for future users.

View Manager - Expand Tag browser (subgroups) hierarchy upon launch

Expand tag browser - as always - on restart.
Ideas:

  1. Expand all tag browsers
  2. Expand user preferred tag browsers
  3. Expand tag browsers as user open them last time by default (IMO this should be the default behavior for calibre)

Usecase: I use Tag browser feature heavily to organize my library but it's frustrating to "Expand" my preferred subgroups of various tag browsers everytime I launch the Calibre.

Upstream declined as a core Calibre feature. Would be nice to have this feature in the plugin as Kovid Goyal suggested.

Feature request: Allow specifying arguments to Open With in different order

In the Open With plugin, it would be very handy to be able to specify arguments for external programs such that the name of the file being opened isn't necessarily the last. For example, the rmapi program for syncing with reMarkable tablets supports a put subcommand that takes an optional argument for where on the device to place exported books. That's currently difficult to use with Open With, as the command-line call looks something like rmapi put book.epub /books, with the path on the device (/books) following the path to the book in Calibre.

Thanks for an awesome plugin! 💕

Goodreads plugin - Get all contributing authors not working properly

Hi,

the "get all contributing authors" functionality seems to be broken, since even when unchecked the plugin when downloading metadata imports other contributors such as translators.

This used to be working properly some time ago, I presume the 1.7.5 update (containing authors parsing changes) may have broken the functionality.

Is it possible to fix this issue? Thanks in advance

GoodReads Sync: an issue with Kobo Aura 2 when more than 50 books are inside the device

Hello,

My issue might be related to the Kobo Aura 2 itself, and not necessarily with the awesome GoodReads Sync plugin you made, but I'll report it here anyway, because I'm sure it can be 'fixed' (with some kind of workaround) on this plugin.

Basically this is what happens: I've got around 70 books in the Kobo Aura 2, 68 of which have a link to its entry on GoodReads. I've set up Calibre to add the Kobo's reading progress to its database, and the GoodReads Sync will then notice when there is a change, and promptly connect to GoodReads in order to sync it with the many shelves — and update their progress.

Everything works flawlessly — unless I happen to have more than 50 books on the device. Apparently, there is a limit to how many books can be updated in one go, and that's possibly imposed by the GoodReads API.

Now, before the reading progress update is made, I have always the choice of confirming which books should be updated, and which should not. So, I promptly uncheck all those books which are not relevant (e.g. those that I have already read, or those that I haven't started to read yet). The remaining books — where some reading progress may or may not have been made — are less than 30, so I just have those 30 checked, and press continue.

In spite of that, the GoodReads Sync will throw the error that it cannot update more than 50 books, and aborts. The number of checked books for updating seems to be irrelevant (or ignored); the only thing that seems to matter is how many books are in the device.

I know that everything else is working well (i.e. no issues with my login/password on GoodReads etc.) because after the automatic update attempt fails, I can freely choose which books to update, checkmark them, and let the GoodReads Sync plugin do its magic. And, sure thing, it works exactly as expected. Mind you, I have more books stored on my Mac — some synced to GoodReads as well, a few that are not — but the GoodReads Sync plugin doesn't care about all those that are not checked for update; these will be properly ignored as expected.

To recap: when launching Calibre, and letting it recognise that the Kobo Aura 2 is properly connected, it also automatically launches the GoodReads Sync plugin — as expected. It's only then that the reading progress update aborts with the limit of 50 books — no matter how many are actually selected (even if none are selected, I still get the error!). But on the other hand, after failing the automatic process (i. e. as soon as the Kobo is recognised by Calibre), the manual procedure will work flawlessly, either by updating each file individually, or by selecting a group of books (so long as they are less than 50 selected books, of course).

While I haven't taken a deep look at the GoodReads Sync plugin code — I'm not sufficiently familiar with Python for that — I can imagine that this can be a very simple fix: either make the check about the limits, and, instead of dropping an annoying error message, just give end-users the chance of unchecking the books (over the 50 limit) they don't need, and let it proceed just with the rest. After all, the actual number of books in the device is irrelevant, if the end-user only chooses a subset to sync with GoodReads.

Even better would be if the GoodReads Sync plugin was able to figure out, on its own, which books require a progress update, and which have remained in the same reading status since the last sync. But that would be asking too much at this stage, especially because I imagine that some devices (namely, those which have their own 'special' plugins to properly connect with them from within Calibre) might not present the reading progress exactly in the same way...

[Bug] Goodreads Sync`socks` lib not found

I have just installed Goodreads Sync plugin, but the plugin does not open (from menu or preference settings). When I open the settings panel, the following error shows:

calibre, version 6.10.0
ERROR: Unhandled exception: <b>AttributeError</b>:'NoneType' object has no attribute 'PROXY_TYPE_HTTP_NO_TUNNEL'

calibre 6.10  embedded-python: True
macOS-12.5.1-x86_64-i386-64bit Darwin ('64bit', '')
('Darwin', '21.6.0', 'Darwin Kernel Version 21.6.0: Wed Aug 10 14:25:27 PDT 2022; root:xnu-8020.141.5~2/RELEASE_X86_64')
Python 3.10.1
OSX: ('12.5.1', ('', '', ''), 'x86_64')
Interface language: None
Successfully initialized third party plugins: Goodreads (1, 7, 2) && Goodreads Sync (1, 16, 2)
Traceback (most recent call last):
  File "calibre/gui2/preferences/plugins.py", line 298, in double_clicked
  File "calibre/gui2/preferences/plugins.py", line 379, in modify_plugin
  File "calibre/customize/__init__.py", line 156, in do_user_config
  File "calibre_plugins.goodreads_sync.__init__", line 60, in config_widget
    grhttp = HttpHelper(self.actual_plugin_.gui)
  File "calibre_plugins.goodreads_sync.core", line 93, in __init__
    proxy_type = httplib2.socks.PROXY_TYPE_HTTP_NO_TUNNEL
AttributeError: 'NoneType' object has no attribute 'PROXY_TYPE_HTTP_NO_TUNNEL'

Count Pages: considerably different word counts for files that the TextDiff plugin deemed equal

I ran TextDiff on an AZW3 and an EPUB. It gave a ratio of "1":

No differences found in text. However, there may be differences in metadata, formatting or MIME content.

But Count Pages counted ~15k more words for the AZW3. Is it counting formatting code in the AZW3 (that somehow ended up as body text in the EPUB it was converted to)?

do_statistics_for_book:  ...\1887.epub 0 Estimate [] ['WordCount'] 1500 True
	Word count using icu_wordcount - trying to count_words
	Word count - used count_words: 185450
	Word count: 185450
do_statistics_for_book:  ...\1888.azw3 0 Estimate [] ['WordCount'] 1500 True
	Word count using icu_wordcount - trying to count_words
	Word count - used count_words: 201262
	Word count: 201262

View Manager: regression with new Calibre 7.2 - view not applied at start

Hello,

I've just updated to Calibre 7.2, which apparently solves a number or window-related issues (something with QT).
But now, View Manager doesn't correctly apply my selected View anymore at startup, or rather, it doesn't apply certain things, like the preferred column widths. This has always worked perfectly for me until today.
Strangely, the "On Device" columns is resized properly when starting Calibre with a Kindle connected. But the Title column isn't.
I need to press "reapply current view" to get all columns sized correctly. The Sort Order, however, is correct.
View_Manager_Settings.txt

Subject: Calibre Plugin Not Working as Expected - Good Read Sync

Issue:
The Good Read Sync plugin in Calibre is not functioning as expected, encountering an error during the authorization process.

Details:

  • Plugin Name: Good Read Sync
  • Calibre Version: 7.1
  • Plugin Version: 1.16.3
  • Operating System: Ubuntu 22.04 LTS

Reproduce Steps:

  1. Click on the Goodreads icon from the top bar of Calibre.
  2. Navigate to 'Customize Plugin.'
  3. Attempt to authorize the plugin with Goodreads.
  4. When prompted, click 'Allow access' on the Goodreads website.

Issue Description:

  • If 'No' is selected (haven't clicked allow access), the modal closes without issues.
  • If 'Allow' is selected, the following error occurs:
calibre, version 7.1.0
ERROR: Goodreads Failure: The request contacting Goodreads has failed.
If it reoccurs, you may have exceeded a request limit imposed by Goodreads.
In which case, wait an additional 5-10 minutes before retrying.

URL: https://www.goodreads.com/oauth/access_token
Response Code: 401
b'Invalid OAuth Request\n<!-- This is a random-length HTML comment: pllbhicnmydxtbtwvjijbfmlywfrbwxlqwsepnwgnotxoccaujuhrudqkzzadxniesgpuwoaveywwhwrzwoetlxyzthbwugoayqcjvxsemrlzuleepoweuvldsoorxubbhqoqfkgaforloaaxumqwwvlrokfckkoguusvjtagezthmsfskhybharydtbqaqukysqcosufzcvfyoydrukoqnqfligmqzfryecmbryetrtmpgomyixrtloytgspugxjojixzepaymcljqftmqzkgscpwkahsojllujkqarijudfzqjeijnyakjtzebpgcjvwfmqbtlnagyptegydyrrjzqblrylydkfbapjcjgyjsidmpvqwxlsgwqsaygtckcxoxupwvfizncztbxxtdrnwuuueortauanyvopuezuftvbpaukesgsafoovwxuxqbthhmrulferyusgilaohysxfjobxmidazheapiknnueuzdrc -->'

Additional Information:

  • The Goodreads website does not open in the browser.
  • The error indicates a 401 response code and an 'Invalid OAuth Request.'

Expected Behavior:
The authorization process should be successful without encountering errors, and the Goodreads website should open correctly.

Thank you for addressing this issue. Let me know if you need any further information.

Goodreads Sync - Feature request: Create books in Calibre with series info

Request for one of the plugins: "Goodreads Sync" or "Manage Series" whichever is appropriate...

Add an action in context menu/toolbar/etc. to do the following:

  1. download series info (list of books) from Goodreads (or other source?)
    -- series name/info for search could be from currently selected book
  2. create an empty book (if ISBN/goodreads id doesn't already exist in calibre) for each item in the series info list of books

Goodreads plugin: Python error: "Title" referenced before assignment

This is with 1.7.5 which in general seems to work really well. Thanks for fixing the authors! I did get some strange matching failures though, and investigated one that turned out to be a python error. Probably some weird unexpected format on the page.

I think all necessary information is in the log below.

Running identify query with parameters: 
{'title': 'Right as Rain', 'authors': None, 'identifiers': {'goodreads': '298064'}, 'timeout': 30} 
Using plugins: Goodreads (1, 7, 5) 
The log from individual plugins is below 

****************************** Goodreads (1, 7, 5) ****************************** 
Found 0 results 
Downloading from Goodreads took 1.2482123374938965 
identify - start. title=Right as Rain, authors=None, identifiers={'goodreads': '298064'}
Goodreads book url: 'https://www.goodreads.com/book/show/298064'
Trying to parse book json for 2022 web page format
Json script node found, page in 2022+ html format
Failed attempting to read book json meta tag from: 'https://www.goodreads.com/book/show/298064'
Traceback (most recent call last):
  File "calibre_plugins.goodreads.worker", line 130, in get_details
  File "calibre_plugins.goodreads.worker", line 195, in parse_details
UnboundLocalError: local variable 'title' referenced before assignment 

edit: Looked through some other match failures and many of them seem to be this error so I can probably supply more testcase if someone wants some.

Count pages: ignore pdfs

if a PDF is selected, just skip it instead of trying to count the pages with the standard algorithm (endless loop)

Modify ePub: Remove cover does not actually remove cover

Like it says in subject. Checking only the remove cover box in the options does not remove the cover for any book I've tested. Insert or replace cover just adds a second cover page, suffixed with _u1 (see screenshot below). Not sure when this behavior was introduced, only noticed when I went to read a book I'd cleaned up and it had two covers, instead of one.

image

Log File:

Failed to initialize plugin: 'C:\\Users\\Marty\\AppData\\Roaming\\calibre\\plugins\\Barnes & Noble.zip'
Failed to initialize plugin: 'C:\\Users\\Marty\\AppData\\Roaming\\calibre\\plugins\\Comicvine.zip'
Failed to initialize plugin: 'C:\\Users\\Marty\\AppData\\Roaming\\calibre\\plugins\\FictionDB.zip'
Failed to initialize plugin: 'C:\\Users\\Marty\\AppData\\Roaming\\calibre\\plugins\\Kindle covers (G).zip'
Failed to initialize plugin: 'C:\\Users\\Marty\\AppData\\Roaming\\calibre\\plugins\\Read MP3 AudioBook metadata.zip'
Integration status: True
Logfile for book ID 21835 (When Harry met Wednesday / Jhotenko)
Job details 21835

Failed to initialize plugin: 'C:\\Users\\Marty\\AppData\\Roaming\\calibre\\plugins\\Barnes & Noble.zip'

Failed to initialize plugin: 'C:\\Users\\Marty\\AppData\\Roaming\\calibre\\plugins\\Comicvine.zip'

Failed to initialize plugin: 'C:\\Users\\Marty\\AppData\\Roaming\\calibre\\plugins\\FictionDB.zip'

Failed to initialize plugin: 'C:\\Users\\Marty\\AppData\\Roaming\\calibre\\plugins\\Kindle covers (G).zip'

Failed to initialize plugin: 'C:\\Users\\Marty\\AppData\\Roaming\\calibre\\plugins\\Read MP3 AudioBook metadata.zip'

Integration status: True

  Modifying:  C:\Users\Marty\AppData\Local\Temp\calibre_z_0f0hld\8d38cvb6_modify_epub\21835.epub

	  Parsing xml file: content.opf

	  Parsing xml file: toc.ncx

	Remove cover

	...Looking for guide cover reference

	...Looking for meta cover

	...Looking for other.ms-* guide references to clean out

	...Remove any orphaned guide images

	...Cover modifications completed

ePub updated in 0.17 seconds


The Original unmodified ePub:
When Harry met Wednesday - Jhotenko original.zip

The resulting ePub:
When Harry met Wednesday - Jhotenko.zip

Quality Check - 'Search epubs' failing on some books, 'Modify Epub' fails too

Hi,

When I try to search inside some epubs, I get a "No matches" result window that seem to imply that the action completed normally and no results were found.

But when I open the log, i see that the parsing failed :

*** Searching for expression: jacket *** 
ERROR parsing book: C:\Users\(...).epub 
Traceback (most recent call last):
  File "calibre_plugins.quality_check.check_epub", line 244, in evaluate_book
  File "calibre\utils\zipfile.py", line 774, in __init__
  File "calibre\utils\zipfile.py", line 809, in _GetContents
  File "calibre\utils\zipfile.py", line 870, in _RealGetContents
  File "calibre\utils\zipfile.py", line 419, in _decodeExtra
struct.error: unpack requires a buffer of 4 bytes

This is on Calibre 7.2 and with the latest plugin 1.13.6.

NB : If I open and save the epub with Sigil (without making modifications), the error goes away.

Would it be possible to fix this issue in the plugin or is it related to Calibre code (zipfile.py)?

If it is not fixable in the plugin, I think a warning should be shown to the user instead of the "Ran successfully but found no result" dialog.

Set default read status on "add to shelf"

If I add a book to any shelf other than read/currently-reading/to-read before adding it to one of those three, then the book is always assigned to the 'read' shelf in addition to the shelf I tried to add the book to. This is not desirable as, in general, if I'm adding a book from Calibre it's because it is one I have in my reading queue but haven't read yet.

Example: Adding the book "Ready Player One" to my Goodreads shelf "science-fiction" (the book is not on any of my shelves in Goodreads yet)

  • Highlight the book in Calibre, choose "add to shelf"
  • Ensure that the book has been matched to a book in Goodreads
  • Click ok
  • In Goodreads, the book is now on both the shelves "science-fiction" and "read"

If the book must be added to one of those three read status shelves in Goodreads (which seems to be the case), I'd like it to be added to to-read instead of read. Right now my workaround for this is to manually add a book to the "to-read" shelf before adding it to any other shelf, but this adds extra steps and I'm likely to forget to do this for one book or another.

This could be implemented in one of two ways:

  • If the book isn't on any of the 3 read status shelves in Goodreads yet, have a global setting to add a book to "to-read" instead of "read" when adding it to any other shelf. Since those 3 shelves are mutually exclusive, you wouldn't need to make a call to the server to see if it was or wasn't already on that default shelf; you could simply say to add it to that shelf in addition to the custom one (i.e. "science-fiction" in my example), and it seems like it should automatically switch to that shelf if and only if it's not already there.
  • Somewhat better but more involved: any time a book is added to a shelf, prompt the user to say what the book's read status is and put it on the corresponding read status shelf in Goodreads.

These could also be combined to let the user set a reasonable default for themselves in global settings (in my case, default to "to-read" instead of "read"), and if desired set a read status shelf that overrides this whenever a book is added to any other shelf.

Count Pages - Question: would you accept a Pull Request to add OpenLibrary as a source?

I have found a very consistent way of grabbing page counts from OpenLibrary using the following:

#!/bin/bash
export ISBN=9780262038003
wget -qSO- "https://openlibrary.org/search?q=${ISBN}&mode=everything" | grep -P '<dd itemprop="numberOfPages" class="object">[^<]+' | grep -oP '\d+'

I could convert this into python pretty easily. If I created a pull request to add support for OpenLibrary as a source would you accept it?

Search on Babelio.com

Hi,

Nice plugin. Thank you.

The French characters are a problem when I search for a book on the babelio.com website.

I've tried UTF-8 and Latin.

Searching L'énergie de l'État
image

Result L'énergie de l'État
image

Thank you

Count Pages - Switch to goodreads to https

I continue to experience failures with Goodreads lookups and the logs show that the request was sent to http instead of https. When I try to wget the same http URL I also get failures, but when I switch to https it works fine.

I think the issue is that you have http here maybe?

Goodreads: Losing secondary authors

Sometimes the goodreads plugin will drop secondary or tertiary authors, but not always.

For instance, https://www.goodreads.com/book/show/43982434 with the two authors James R. Clapper and Trey Brown will be imported with only James R. Clapper as author. In the Goodreads database both authors are listed absolutely normally.

Another example is https://www.goodreads.com/book/show/61237037 where there are three authors listed but only 2 get imported.

A third example is https://www.goodreads.com/book/show/588497.The_Rings_of_Saturn where both the pseudonym and the real author name is listed, and only pseudonym is imported.

It doesn't happen always. https://www.goodreads.com/book/show/59808792 is an example where both authors are imported correctly.

I noticed this with Calibre 6.14 and Goodreads Sync Plugin 1.7.4, but I do not know if it worked better in earlier version. I think it's a new problem, possibly related to the new internal format Goodreads use, but not sure.

Quality Check: UI Stretch Issue with Long Search Terms in "Search ePubs"

Description:

In the "Quality Check" plugin (v1.13.6) on Windows 10, using long search terms in the "Search ePubs" feature causes the UI to stretch beyond the screen without reverting back. The UI shows a single line of input and doesn't wrap text or allow horizontal resizing.

demo.mp4

Reproduction Steps:

  1. Open "Quality Check" plugin (v1.13.6).
  2. Use "Search ePubs" feature.
  3. Enter a long search term.

Expected Behavior:

The UI should accommodate long search terms, possibly through text wrapping or horizontal resizing.

Actual Behavior:

UI stretches indefinitely and doesn't revert back, hindering the view and edit functionality of the input field.

Environment:

  • Calibre version: 6.13
  • Quality Check plugin version: 1.13.6
  • OS: Windows 10

Suggested Solution:

Implementing horizontal resizing and/or text wrapping would be ideal to prevent UI stretching with long search terms.

Goodreads Sync: authorize plugin with goodreads unexpected keyword argument 'key_file'

Seems like the authorize plugin with goodreads button isn't working.

It's returning the following:

calibre, version 6.28.1
ERROR: Unhandled exception: <b>TypeError</b>:HTTPSConnection.__init__() got an unexpected keyword argument 'key_file'

calibre 6.28.1  embedded-python: False
Linux-6.6.8-200.fc39.x86_64-x86_64-with-glibc2.38 Linux ('64bit', 'ELF')
('Linux', '6.6.8-200.fc39.x86_64', '#1 SMP PREEMPT_DYNAMIC Thu Dec 21 04:01:49 UTC 2023')
Python 3.12.1
Interface language: None
Successfully initialized third party plugins: Goodreads Sync (1, 16, 4)
Traceback (most recent call last):
  File "calibre_plugins.goodreads_sync.config", line 1204, in authorize_plugin
    (request_token, request_secret) = self.grhttp.get_request_token_secret()
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "calibre_plugins.goodreads_sync.core", line 228, in get_request_token_secret
    response, content = self._oauth_request_get(oauth_client, REQUEST_TOKEN_URL)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "calibre_plugins.goodreads_sync.core", line 129, in _oauth_request_get
    response, content = oauth_client.request(url, 'GET', headers=headers)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "calibre_plugins.goodreads_sync.oauth2.__init__", line 689, in request
    return httplib2.Http.request(self, uri, method=method, body=body,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "calibre_plugins.goodreads_sync.httplib2.__init__", line 1561, in request
    conn = self.connections[conn_key] = connection_type(
                                        ^^^^^^^^^^^^^^^^
  File "calibre_plugins.goodreads_sync.httplib2.__init__", line 999, in __init__
    httplib.HTTPSConnection.__init__(self, host, port=port,
TypeError: HTTPSConnection.__init__() got an unexpected keyword argument 'key_file'

The plugin also downloads translators as authors

Hello, and thank you for your work. As per the title, the plugin downloads the book's translators and adds them (author & translator) to the author string. The option "Get all contributing authors" is unchecked.

Goodreads Sync: Date read is no longer synced because it's missing from the xml for more recently read books

The Goodreads Sync plugin can now only sync read date for books read before the summer 2022, because the xml file it reads data from no longer contains that information for newly read books:

  <started_at></started_at>
  <read_at></read_at>
  <date_added>Mon Apr 10 02:20:37 -0700 2023</date_added>
  <date_updated>Mon Apr 10 02:21:26 -0700 2023</date_updated>
  <read_count>1</read_count>

This is really a Goodreads problem but they don't officially support the xml format as far as I know.

The HTML output does contain the data so I wrote some code to scrape it. This is at least right now less robust than parsing XML but seemed to work.

I've put it in #32 but I'm not 100% sure it's the path to take. What do you think?

Goodreads - Remove from shelf actions

Hey,
Is there a chance you could add "Remove from shelf actions"?
Actions that work the same way as "Add to shelf actions" but for the remove operation?
The forum thread mentions it a few times and that it would be easy but I don't think it was ever prioritized.
Thanks for considering

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.