Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 09-01-2023, 03:32 AM   #1666
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,685
Karma: 2162246
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Count Pages v1.13.1 Released

Release Notes
https://github.com/kiwidude68/calibr..._pages-v1.13.1

Many thanks to Kovid for the steer on the relevant calibre code to ensure that now this plugin does indeed match the ebook viewer page count should anyone choose that particular option.
kiwidude is offline   Reply With Quote
Old 09-01-2023, 04:07 AM   #1667
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,258
Karma: 6426810
Join Date: Sep 2020
Device: Calibre E-book viewer
Quote:
Originally Posted by kiwidude View Post
Release Notes
https://github.com/kiwidude68/calibr..._pages-v1.13.1

Many thanks to Kovid for the steer on the relevant calibre code to ensure that now this plugin does indeed match the ebook viewer page count should anyone choose that particular option.


wow I just tested it, and this was a really pleasant surprise, as I'm running Calibre from source and the viewer takes more time to load in this mode.

(I'm using dev mode because of the new book details CSS customising feature)

Yesterday I had to open a bunch of titles in Viewer to get the page number manually and it was a bit tiresome.


Last edited by Comfy.n; 09-01-2023 at 04:33 AM.
Comfy.n is online now   Reply With Quote
Advert
Old 09-01-2023, 02:58 PM   #1668
C-novice
ReadingZealot
C-novice is a marvel to beholdC-novice is a marvel to beholdC-novice is a marvel to beholdC-novice is a marvel to beholdC-novice is a marvel to beholdC-novice is a marvel to beholdC-novice is a marvel to beholdC-novice is a marvel to beholdC-novice is a marvel to beholdC-novice is a marvel to beholdC-novice is a marvel to behold
 
Posts: 164
Karma: 11818
Join Date: Oct 2014
Device: kobo ARC, Samsung Tab4
CountPages plugin icon not showing on Calibre's toolbar

I had to reinstall Calibre and added the count pages plugin, restarted Calibre but I am not seeing its icon on Calibre's toolbar as I normally do.

Could I have missed a step somewhere?

I downloaded the plugin, went to Preferences --> Change Calibre's behaviour --> Plugins --> Load plug in from file, restart Calibre and that's it. No way to choose count pages -no icon.
C-novice is offline   Reply With Quote
Old 09-01-2023, 03:08 PM   #1669
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,443
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Preferences: Toolbars:
If the Plugin is installed, the icon should be available

REMEMBER: some toolbars have a Device Connected version. If you want the tool to be available on both, you need to add it to each one.
theducks is offline   Reply With Quote
Old 09-01-2023, 03:51 PM   #1670
C-novice
ReadingZealot
C-novice is a marvel to beholdC-novice is a marvel to beholdC-novice is a marvel to beholdC-novice is a marvel to beholdC-novice is a marvel to beholdC-novice is a marvel to beholdC-novice is a marvel to beholdC-novice is a marvel to beholdC-novice is a marvel to beholdC-novice is a marvel to beholdC-novice is a marvel to behold
 
Posts: 164
Karma: 11818
Join Date: Oct 2014
Device: kobo ARC, Samsung Tab4
Quote:
Originally Posted by theducks View Post
Preferences: Toolbars:
If the Plugin is installed, the icon should be available

REMEMBER: some toolbars have a Device Connected version. If you want the tool to be available on both, you need to add it to each one.

Oh dear me. Know what it was? The icons on the toolbar are large so countpages went onto a second line which I have to nav to the right a bit to see.

Thank you!
C-novice is offline   Reply With Quote
Advert
Old 09-01-2023, 04:29 PM   #1671
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,443
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by C-novice View Post
Oh dear me. Know what it was? The icons on the toolbar are large so countpages went onto a second line which I have to nav to the right a bit to see.

Thank you!
Good to hear you found it.
FWIW I moved Preferences and Help to the Menu Bar (text only), that leave mor room.
theducks is offline   Reply With Quote
Old 09-09-2023, 12:37 PM   #1672
wanderson
Member
wanderson began at the beginning.
 
Posts: 19
Karma: 10
Join Date: Jul 2017
Device: Kindle Paperwhite Gen 11 & Likebook Mars
Poor / erratic results trying to get Goodreads.com data

I'm getting poor (or at least erratic) results using the Count Pages plugin (CP) when trying to get Goodreads.com data. I'm using Calibre 6.26.0, Count Pages 1.13.1 and Goodreads 1.7.9. See attachment for my CP control panel.

THANKS to kiwidude for these useful plugins!

In most cases, CP simply fails to get a page count from the Goodreads API. These results are typically described in the FAILURE section below.

In other, somewhat perplexing, cases, CP will succeed in getting a page count, IMMEDIATELY AFTER A FAILURE. See SUCCESS below.

By the way, these two logs were from consecutive attempts with CP. The first was after a clean startup in Calibre, and the second immediately followed.

My workflow is to import my EPUB book, get additional metadata using the Goodreads plugin (thanks again, kiwidude), potentially revise the Amazon ID if it does not correspond to the appropriate B* Kindle ID, and then use CP to retrieve page data.

What am I doing wrong? Or is this just the Goodreads API being flaky or recalcitrant?

Thanks for any information.

Willie

========= FAILURE ==========

Spoiler:

Count Page/Word Statistics
do_count_statistics - book_path=None, pages_algorithm=0, page_count_mode=Download, statistics_to_run=['PageCount'], custom_chars_per_page=1500, icu_wordcount=True
do_count_statistics - job started for file book_path=None
-------------------------------
Logfile for book ID 1738 (The Code Breaker: Jennifer Doudna, Gene Editing, and the Future of the Human Race - Walter Isaacson)
Method of counting _page_count_mode=Download _download_sources=[('goodreads', '55513377')]
results= {'PageCount': None}
FAILED TO GET PAGE COUNT FROM WEBSITE
1738
do_statistics_for_book: None 0 Download [('goodreads', '55513377')] ['PageCount'] 1500 True
DownloadPagesWorker::run - source_id=55513377, source_name=goodreads
DownloadPagesWorker::run - PAGE_DOWNLOADS[source_name]={'URL': 'https://www.goodreads.com/book/show/%s', 'pages_xpath': '//div[@class="FeaturedDetails"]/p[@data-testid="pagesFormat"]/text()', 'name': 'Goodreads', 'id': 'goodreads', 'icon': 'images/goodreads.png', 'active': True, 'pages_regex': '([0-9]+) pages'}
DownloadPagesWorker::run - self.pages_regex=([0-9]+) pages
Download source book url: 'https://www.goodreads.com/book/show/55513377'
_parse_page_count: start
_parse_page_count: root.__class__= HtmlElement
_parse_page_count: pages_xpath='//div[@class="FeaturedDetails"]/p[@data-testid="pagesFormat"]/text()', =pages_regex='([0-9]+) pages'
_parse_page_count: pages= []
_parse_page_count: end



========= SUCCESS =========

Spoiler:

Count Page/Word Statistics
do_count_statistics - book_path=None, pages_algorithm=0, page_count_mode=Download, statistics_to_run=['PageCount'], custom_chars_per_page=1500, icu_wordcount=True
do_count_statistics - job started for file book_path=None
-------------------------------
Logfile for book ID 1738 (The Code Breaker: Jennifer Doudna, Gene Editing, and the Future of the Human Race - Walter Isaacson)
Method of counting _page_count_mode=Download _download_sources=[('goodreads', '55513377')]
results= {'download_source': 'goodreads', 'PageCount': 552}
Downloaded page count from Goodreads: 552
1738
do_statistics_for_book: None 0 Download [('goodreads', '55513377')] ['PageCount'] 1500 True
DownloadPagesWorker::run - source_id=55513377, source_name=goodreads
DownloadPagesWorker::run - PAGE_DOWNLOADS[source_name]={'URL': 'https://www.goodreads.com/book/show/%s', 'pages_xpath': '//div[@class="FeaturedDetails"]/p[@data-testid="pagesFormat"]/text()', 'name': 'Goodreads', 'id': 'goodreads', 'icon': 'images/goodreads.png', 'active': True, 'pages_regex': '([0-9]+) pages'}
DownloadPagesWorker::run - self.pages_regex=([0-9]+) pages
Download source book url: 'https://www.goodreads.com/book/show/55513377'
_parse_page_count: start
_parse_page_count: root.__class__= HtmlElement
_parse_page_count: pages_xpath='//div[@class="FeaturedDetails"]/p[@data-testid="pagesFormat"]/text()', =pages_regex='([0-9]+) pages'
_parse_page_count: pages= ['552 pages, Kindle Edition']
_parse_page_count: pages[0]= 552 pages, Kindle Edition
_parse_page_count: pages_regex= ([0-9]+) pages
_parse_page_count: pages_text= 552
_parse_page_count: have pages_regex='([0-9]+) pages'
_parse_page_count: result from regex='552'
_parse_page_count: end
Attached Thumbnails
Click image for larger version

Name:	Untitled.png
Views:	91
Size:	70.4 KB
ID:	203671  

Last edited by wanderson; 09-11-2023 at 06:54 PM. Reason: Please Spoiler Log files
wanderson is offline   Reply With Quote
Old 09-09-2023, 09:03 PM   #1673
Strether
Guru
Strether ought to be getting tired of karma fortunes by now.Strether ought to be getting tired of karma fortunes by now.Strether ought to be getting tired of karma fortunes by now.Strether ought to be getting tired of karma fortunes by now.Strether ought to be getting tired of karma fortunes by now.Strether ought to be getting tired of karma fortunes by now.Strether ought to be getting tired of karma fortunes by now.Strether ought to be getting tired of karma fortunes by now.Strether ought to be getting tired of karma fortunes by now.Strether ought to be getting tired of karma fortunes by now.Strether ought to be getting tired of karma fortunes by now.
 
Strether's Avatar
 
Posts: 760
Karma: 2825929
Join Date: Feb 2007
Location: Fresno
Device: Kindle 1; iPad Air; iPhone 7; Kobo Libra; Kindle Oasis 3
For what it's worth, the new Kindle Scribe after the last update, does not support the Count Pages plugin.

Loaded the book on both my Scribe and my Paperwhite and only the latter device shows pages as available. Pages are grayed out on the Scribe. Have downloaded 3 new books since installing Calibre 6.26 and pages are not available on any of them.

Not sure whether it's worth your while to investigate this, but thought I'd report it.

Jim
Strether is offline   Reply With Quote
Old 09-12-2023, 02:24 AM   #1674
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,685
Karma: 2162246
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Quote:
Originally Posted by Strether View Post
For what it's worth, the new Kindle Scribe after the last update, does not support the Count Pages plugin.

Loaded the book on both my Scribe and my Paperwhite and only the latter device shows pages as available. Pages are grayed out on the Scribe. Have downloaded 3 new books since installing Calibre 6.26 and pages are not available on any of them.

Not sure whether it's worth your while to investigate this, but thought I'd report it.

Jim
Jim - kind of confused here. This plugin has no relevance to specific devices whatsoever - all it does is populate a column in the calibre library. It doesn't try to modify the books themselves or apply some sort of metadata to them on your device - it is purely for when on your PC and looking at your calibre library being able to see some extra data about a book in the library grid.
kiwidude is offline   Reply With Quote
Old 09-12-2023, 03:54 AM   #1675
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,685
Karma: 2162246
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Quote:
Originally Posted by wanderson View Post
I'm getting poor (or at least erratic) results using the Count Pages plugin (CP) when trying to get Goodreads.com data.
The cause of the erratic behavior is the same problem the Goodreads metadata plugin had - the Goodreads website not returning consistent html results unless using a Chrome based user agent. I am making the same change to this plugin as I made to the other one to force it to choose a random Chrome agent rather than the default calibre behaviour of a wider pool of types of web browser user agents.

From my quick attempt at a download of page count this solved the issue. Release coming soon.
kiwidude is offline   Reply With Quote
Old 09-12-2023, 05:48 AM   #1676
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,685
Karma: 2162246
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Count Pages v1.13.2 Released

Release Notes
https://github.com/kiwidude68/calibr..._pages-v1.13.2
kiwidude is offline   Reply With Quote
Old 09-13-2023, 11:29 AM   #1677
wanderson
Member
wanderson began at the beginning.
 
Posts: 19
Karma: 10
Join Date: Jul 2017
Device: Kindle Paperwhite Gen 11 & Likebook Mars
Quote:
Originally Posted by kiwidude View Post
Thanks for the fast response, kiwidude. I've tried 1.13.2 and it seems much improved. I still (typically) have to run it twice, but it seems to be reliably getting a good page count on the second effort, and occasionally on the first. Here are logs from two back-to-back runs; the first run got one out of 5, and the second run got the remaining four.

Thanks again.

======PARTIAL FAILURE======
Spoiler:
Count Page/Word Statistics
do_count_statistics - book_path=None, pages_algorithm=0, page_count_mode=Download, statistics_to_run=['PageCount'], custom_chars_per_page=1500, icu_wordcount=True
do_count_statistics - job started for file book_path=None
do_count_statistics - book_path=None, pages_algorithm=0, page_count_mode=Download, statistics_to_run=['PageCount'], custom_chars_per_page=1500, icu_wordcount=True
do_count_statistics - job started for file book_path=None
do_count_statistics - book_path=None, pages_algorithm=0, page_count_mode=Download, statistics_to_run=['PageCount'], custom_chars_per_page=1500, icu_wordcount=True
do_count_statistics - job started for file book_path=None
do_count_statistics - book_path=None, pages_algorithm=0, page_count_mode=Download, statistics_to_run=['PageCount'], custom_chars_per_page=1500, icu_wordcount=True
do_count_statistics - job started for file book_path=None
do_count_statistics - book_path=None, pages_algorithm=0, page_count_mode=Download, statistics_to_run=['PageCount'], custom_chars_per_page=1500, icu_wordcount=True
do_count_statistics - job started for file book_path=None
-------------------------------
Logfile for book ID 1848 (Our Kind of Traitor - John le Carré)
Method of counting _page_count_mode=Download _download_sources=[('goodreads', '7839766')]
results= {'PageCount': None}
FAILED TO GET PAGE COUNT FROM WEBSITE
1848
do_statistics_for_book: None 0 Download [('goodreads', '7839766')] ['PageCount'] 1500 True
DownloadPagesWorker::run - source_id=7839766, source_name=goodreads
DownloadPagesWorker::run - PAGE_DOWNLOADS[source_name]={'URL': 'https://www.goodreads.com/book/show/%s', 'pages_xpath': '//div[@class="FeaturedDetails"]/p[@data-testid="pagesFormat"]/text()', 'name': 'Goodreads', 'id': 'goodreads', 'icon': 'images/goodreads.png', 'active': True, 'pages_regex': '([0-9]+) pages'}
DownloadPagesWorker::run - self.pages_regex=([0-9]+) pages
Download source book url: 'https://www.goodreads.com/book/show/7839766'
_parse_page_count: start
_parse_page_count: pages_xpath='//div[@class="FeaturedDetails"]/p[@data-testid="pagesFormat"]/text()', =pages_regex='([0-9]+) pages'
_parse_page_count: pages= []
_parse_page_count: end

-------------------------------
Logfile for book ID 1847 (Our Game - John le Carré)
Method of counting _page_count_mode=Download _download_sources=[('goodreads', '22927861')]
results= {'PageCount': None}
FAILED TO GET PAGE COUNT FROM WEBSITE
1847
do_statistics_for_book: None 0 Download [('goodreads', '22927861')] ['PageCount'] 1500 True
DownloadPagesWorker::run - source_id=22927861, source_name=goodreads
DownloadPagesWorker::run - PAGE_DOWNLOADS[source_name]={'URL': 'https://www.goodreads.com/book/show/%s', 'pages_xpath': '//div[@class="FeaturedDetails"]/p[@data-testid="pagesFormat"]/text()', 'name': 'Goodreads', 'id': 'goodreads', 'icon': 'images/goodreads.png', 'active': True, 'pages_regex': '([0-9]+) pages'}
DownloadPagesWorker::run - self.pages_regex=([0-9]+) pages
Download source book url: 'https://www.goodreads.com/book/show/22927861'
_parse_page_count: start
_parse_page_count: pages_xpath='//div[@class="FeaturedDetails"]/p[@data-testid="pagesFormat"]/text()', =pages_regex='([0-9]+) pages'
_parse_page_count: pages= []
_parse_page_count: end

-------------------------------
Logfile for book ID 1844 (A Most Wanted Man - John le Carré)
Method of counting _page_count_mode=Download _download_sources=[('goodreads', '7006264')]
results= {'download_source': 'goodreads', 'PageCount': 336}
Downloaded page count from Goodreads: 336
1844
do_statistics_for_book: None 0 Download [('goodreads', '7006264')] ['PageCount'] 1500 True
DownloadPagesWorker::run - source_id=7006264, source_name=goodreads
DownloadPagesWorker::run - PAGE_DOWNLOADS[source_name]={'URL': 'https://www.goodreads.com/book/show/%s', 'pages_xpath': '//div[@class="FeaturedDetails"]/p[@data-testid="pagesFormat"]/text()', 'name': 'Goodreads', 'id': 'goodreads', 'icon': 'images/goodreads.png', 'active': True, 'pages_regex': '([0-9]+) pages'}
DownloadPagesWorker::run - self.pages_regex=([0-9]+) pages
Download source book url: 'https://www.goodreads.com/book/show/7006264'
_parse_page_count: start
_parse_page_count: pages_xpath='//div[@class="FeaturedDetails"]/p[@data-testid="pagesFormat"]/text()', =pages_regex='([0-9]+) pages'
_parse_page_count: pages= ['336 pages, ebook']
_parse_page_count: pages[0]= 336 pages, ebook
_parse_page_count: pages_regex= ([0-9]+) pages
_parse_page_count: pages_text= 336
_parse_page_count: have pages_regex='([0-9]+) pages'
_parse_page_count: result from regex='336'
_parse_page_count: end

-------------------------------
Logfile for book ID 1845 (A Perfect Spy - John le Carré)
Method of counting _page_count_mode=Download _download_sources=[('goodreads', '10069474')]
results= {'PageCount': None}
FAILED TO GET PAGE COUNT FROM WEBSITE
1845
do_statistics_for_book: None 0 Download [('goodreads', '10069474')] ['PageCount'] 1500 True
DownloadPagesWorker::run - source_id=10069474, source_name=goodreads
DownloadPagesWorker::run - PAGE_DOWNLOADS[source_name]={'URL': 'https://www.goodreads.com/book/show/%s', 'pages_xpath': '//div[@class="FeaturedDetails"]/p[@data-testid="pagesFormat"]/text()', 'name': 'Goodreads', 'id': 'goodreads', 'icon': 'images/goodreads.png', 'active': True, 'pages_regex': '([0-9]+) pages'}
DownloadPagesWorker::run - self.pages_regex=([0-9]+) pages
Download source book url: 'https://www.goodreads.com/book/show/10069474'
_parse_page_count: start
_parse_page_count: pages_xpath='//div[@class="FeaturedDetails"]/p[@data-testid="pagesFormat"]/text()', =pages_regex='([0-9]+) pages'
_parse_page_count: pages= []
_parse_page_count: end

-------------------------------
Logfile for book ID 1846 (A Small Town in Germany - John le Carré)
Method of counting _page_count_mode=Download _download_sources=[('goodreads', '56485308')]
results= {'PageCount': None}
FAILED TO GET PAGE COUNT FROM WEBSITE
1846
do_statistics_for_book: None 0 Download [('goodreads', '56485308')] ['PageCount'] 1500 True
DownloadPagesWorker::run - source_id=56485308, source_name=goodreads
DownloadPagesWorker::run - PAGE_DOWNLOADS[source_name]={'URL': 'https://www.goodreads.com/book/show/%s', 'pages_xpath': '//div[@class="FeaturedDetails"]/p[@data-testid="pagesFormat"]/text()', 'name': 'Goodreads', 'id': 'goodreads', 'icon': 'images/goodreads.png', 'active': True, 'pages_regex': '([0-9]+) pages'}
DownloadPagesWorker::run - self.pages_regex=([0-9]+) pages
Download source book url: 'https://www.goodreads.com/book/show/56485308'
_parse_page_count: start
_parse_page_count: pages_xpath='//div[@class="FeaturedDetails"]/p[@data-testid="pagesFormat"]/text()', =pages_regex='([0-9]+) pages'
_parse_page_count: pages= []
_parse_page_count: end


======SUCCESS======
Spoiler:
Count Page/Word Statistics
do_count_statistics - book_path=None, pages_algorithm=0, page_count_mode=Download, statistics_to_run=['PageCount'], custom_chars_per_page=1500, icu_wordcount=True
do_count_statistics - job started for file book_path=None
do_count_statistics - book_path=None, pages_algorithm=0, page_count_mode=Download, statistics_to_run=['PageCount'], custom_chars_per_page=1500, icu_wordcount=True
do_count_statistics - job started for file book_path=None
do_count_statistics - book_path=None, pages_algorithm=0, page_count_mode=Download, statistics_to_run=['PageCount'], custom_chars_per_page=1500, icu_wordcount=True
do_count_statistics - job started for file book_path=None
do_count_statistics - book_path=None, pages_algorithm=0, page_count_mode=Download, statistics_to_run=['PageCount'], custom_chars_per_page=1500, icu_wordcount=True
do_count_statistics - job started for file book_path=None
-------------------------------
Logfile for book ID 1846 (A Small Town in Germany - John le Carré)
Method of counting _page_count_mode=Download _download_sources=[('goodreads', '56485308')]
results= {'download_source': 'goodreads', 'PageCount': 336}
Downloaded page count from Goodreads: 336
1846
do_statistics_for_book: None 0 Download [('goodreads', '56485308')] ['PageCount'] 1500 True
DownloadPagesWorker::run - source_id=56485308, source_name=goodreads
DownloadPagesWorker::run - PAGE_DOWNLOADS[source_name]={'URL': 'https://www.goodreads.com/book/show/%s', 'pages_xpath': '//div[@class="FeaturedDetails"]/p[@data-testid="pagesFormat"]/text()', 'name': 'Goodreads', 'id': 'goodreads', 'icon': 'images/goodreads.png', 'active': True, 'pages_regex': '([0-9]+) pages'}
DownloadPagesWorker::run - self.pages_regex=([0-9]+) pages
Download source book url: 'https://www.goodreads.com/book/show/56485308'
_parse_page_count: start
_parse_page_count: pages_xpath='//div[@class="FeaturedDetails"]/p[@data-testid="pagesFormat"]/text()', =pages_regex='([0-9]+) pages'
_parse_page_count: pages= ['336 pages, ebook']
_parse_page_count: pages[0]= 336 pages, ebook
_parse_page_count: pages_regex= ([0-9]+) pages
_parse_page_count: pages_text= 336
_parse_page_count: have pages_regex='([0-9]+) pages'
_parse_page_count: result from regex='336'
_parse_page_count: end

-------------------------------
Logfile for book ID 1845 (A Perfect Spy - John le Carré)
Method of counting _page_count_mode=Download _download_sources=[('goodreads', '10069474')]
results= {'download_source': 'goodreads', 'PageCount': 604}
Downloaded page count from Goodreads: 604
1845
do_statistics_for_book: None 0 Download [('goodreads', '10069474')] ['PageCount'] 1500 True
DownloadPagesWorker::run - source_id=10069474, source_name=goodreads
DownloadPagesWorker::run - PAGE_DOWNLOADS[source_name]={'URL': 'https://www.goodreads.com/book/show/%s', 'pages_xpath': '//div[@class="FeaturedDetails"]/p[@data-testid="pagesFormat"]/text()', 'name': 'Goodreads', 'id': 'goodreads', 'icon': 'images/goodreads.png', 'active': True, 'pages_regex': '([0-9]+) pages'}
DownloadPagesWorker::run - self.pages_regex=([0-9]+) pages
Download source book url: 'https://www.goodreads.com/book/show/10069474'
_parse_page_count: start
_parse_page_count: pages_xpath='//div[@class="FeaturedDetails"]/p[@data-testid="pagesFormat"]/text()', =pages_regex='([0-9]+) pages'
_parse_page_count: pages= ['604 pages, Paperback']
_parse_page_count: pages[0]= 604 pages, Paperback
_parse_page_count: pages_regex= ([0-9]+) pages
_parse_page_count: pages_text= 604
_parse_page_count: have pages_regex='([0-9]+) pages'
_parse_page_count: result from regex='604'
_parse_page_count: end

-------------------------------
Logfile for book ID 1848 (Our Kind of Traitor - John le Carré)
Method of counting _page_count_mode=Download _download_sources=[('goodreads', '7839766')]
results= {'download_source': 'goodreads', 'PageCount': 306}
Downloaded page count from Goodreads: 306
1848
do_statistics_for_book: None 0 Download [('goodreads', '7839766')] ['PageCount'] 1500 True
DownloadPagesWorker::run - source_id=7839766, source_name=goodreads
DownloadPagesWorker::run - PAGE_DOWNLOADS[source_name]={'URL': 'https://www.goodreads.com/book/show/%s', 'pages_xpath': '//div[@class="FeaturedDetails"]/p[@data-testid="pagesFormat"]/text()', 'name': 'Goodreads', 'id': 'goodreads', 'icon': 'images/goodreads.png', 'active': True, 'pages_regex': '([0-9]+) pages'}
DownloadPagesWorker::run - self.pages_regex=([0-9]+) pages
Download source book url: 'https://www.goodreads.com/book/show/7839766'
_parse_page_count: start
_parse_page_count: pages_xpath='//div[@class="FeaturedDetails"]/p[@data-testid="pagesFormat"]/text()', =pages_regex='([0-9]+) pages'
_parse_page_count: pages= ['306 pages, Hardcover']
_parse_page_count: pages[0]= 306 pages, Hardcover
_parse_page_count: pages_regex= ([0-9]+) pages
_parse_page_count: pages_text= 306
_parse_page_count: have pages_regex='([0-9]+) pages'
_parse_page_count: result from regex='306'
_parse_page_count: end

-------------------------------
Logfile for book ID 1847 (Our Game - John le Carré)
Method of counting _page_count_mode=Download _download_sources=[('goodreads', '22927861')]
results= {'download_source': 'goodreads', 'PageCount': 353}
Downloaded page count from Goodreads: 353
1847
do_statistics_for_book: None 0 Download [('goodreads', '22927861')] ['PageCount'] 1500 True
DownloadPagesWorker::run - source_id=22927861, source_name=goodreads
DownloadPagesWorker::run - PAGE_DOWNLOADS[source_name]={'URL': 'https://www.goodreads.com/book/show/%s', 'pages_xpath': '//div[@class="FeaturedDetails"]/p[@data-testid="pagesFormat"]/text()', 'name': 'Goodreads', 'id': 'goodreads', 'icon': 'images/goodreads.png', 'active': True, 'pages_regex': '([0-9]+) pages'}
DownloadPagesWorker::run - self.pages_regex=([0-9]+) pages
Download source book url: 'https://www.goodreads.com/book/show/22927861'
_parse_page_count: start
_parse_page_count: pages_xpath='//div[@class="FeaturedDetails"]/p[@data-testid="pagesFormat"]/text()', =pages_regex='([0-9]+) pages'
_parse_page_count: pages= ['353 pages, Kindle Edition']
_parse_page_count: pages[0]= 353 pages, Kindle Edition
_parse_page_count: pages_regex= ([0-9]+) pages
_parse_page_count: pages_text= 353
_parse_page_count: have pages_regex='([0-9]+) pages'
_parse_page_count: result from regex='353'
_parse_page_count: end


EDIT: Alas, I am still seeing some persistent failures for books with page counts at Goodreads. I'll post additional logs if there is interest.

Last edited by wanderson; 09-13-2023 at 12:11 PM. Reason: Additional runs give some continuing issues.
wanderson is offline   Reply With Quote
Old 09-14-2023, 06:05 AM   #1678
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,685
Karma: 2162246
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Quote:
Originally Posted by wanderson View Post
Thanks for the fast response, kiwidude. I've tried 1.13.2 and it seems much improved. I still (typically) have to run it twice, but it seems to be reliably getting a good page count on the second effort, and occasionally on the first. Here are logs from two back-to-back runs; the first run got one out of 5, and the second run got the remaining four.
I picked one of those books, ran count pages five times in a row on it and it succeeded every time. Perhaps Goodreads have some flaky servers that get hit from your location, or perhaps I just got lucky. Unless I can replicate a failure myself (I don't use this download counts feature personally so it is not one I am going to hit during normal calibre usage) then I'm afraid there is nothing more I can do.
kiwidude is offline   Reply With Quote
Old 10-06-2023, 11:46 PM   #1679
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,685
Karma: 2162246
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Count Pages v1.13.3 Released

Release Notes
https://github.com/kiwidude68/calibr..._pages-v1.13.3

Thanks to @seeder for some missing files/fixes for some of the downloads of international sites, not a feature I ever use to notice myself.

This version also has an important change made to how I read the contents of an epub/azw3 book, in that I am attempting to process the html entities "properly" rather than some of the historical hackiness in there. This will resolve the issue raised by someone where they had AZW3 and ePub versions of the same book giving wildly different word counts - which was due to the AZW3 version using html encoded entities and the epub version not doing so.

Anyways the net result is dont be surprised if you see page counts and word counts now change a little to what was calculated previously (for some of the algorithms).
kiwidude is offline   Reply With Quote
Old 10-07-2023, 05:13 AM   #1680
Smokus
Junior Member
Smokus began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Oct 2023
Device: Kindle Paperwhite Signature Edition
Which algorithm for Page Count is objectively the best one?
Does Page Count from Goodreads offer superior results than using algorithms to obtain Page Count?

I don't know if it matters, but I usually convert EPUB books into KFX and then use the Count Pages plugin.

Last edited by Smokus; 10-07-2023 at 05:15 AM.
Smokus is offline   Reply With Quote
Reply

Tags
count, count pages, page count, pages, plugin


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Quality Check kiwidude Plugins 1207 Today 09:39 PM
[GUI Plugin] Open With kiwidude Plugins 403 04-01-2024 09:39 AM
[GUI Plugin] Quick Preferences kiwidude Plugins 62 03-17-2024 12:47 AM
[GUI Plugin] Kindle Collections (old) meme Plugins 2070 08-11-2014 01:02 AM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 01:27 PM


All times are GMT -4. The time now is 10:52 PM.


MobileRead.com is a privately owned, operated and funded community.