![]() |
#1 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 977
Karma: 2209358
Join Date: Nov 2011
Location: London, UK
Device: Kobo Aura, Kobo Aura ONE, PocketBook InkPad Color 3
|
Spotlight importer for Mac OS X
I posted a brief announcement in another thread, but in case you didn't notice that, a new Spotlight plugin for ePub files has been released together with an updated Quicklook plugin.
I'd be interested in any feedback here (I helped write the Spotlight importer, and hacked on the core code a bit) but if you want to raise an "Issue" yourself on github please do so. https://github.com/jaketmp/ePub-quicklook Edit: the download DMG had some bad links, please try again! It indexes quite a few bits of ePub 2 metadata, as well as the textual content of unprotected books. Indexed metadata includes:
In addition it tries to detect the variant of DRM being used (Apple, Adobe, Kobo, Barnes & Noble) and for expiring (e.g. library) books, their expiry date. Last edited by chrisridd; 03-13-2012 at 03:11 AM. Reason: DMG download has been fixed |
![]() |
![]() |
![]() |
#2 |
Junior Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4
Karma: 4156
Join Date: Jan 2010
Device: none
|
I've installed this and when running queries I don't appear to get the results I'd expect.
If I search for a string of known text the epub appears but when I hover over it I see Adobe's reader showing a cover preview and no text is shown, so I can't tell from the myriad of epub hits what the context was. Is there a better epub reader that I should be using in conjunction with this so that the search results are meaningful? Last edited by paulhar; 08-31-2012 at 06:26 AM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 977
Karma: 2209358
Join Date: Nov 2011
Location: London, UK
Device: Kobo Aura, Kobo Aura ONE, PocketBook InkPad Color 3
|
Quote:
It sounds like Spotlight is successfully indexing your books. When you hover over a result in the Spotlight menu, it will use the Quicklook plugin to show you some brief overview of the book. So both plugins are working, but maybe Quicklook isn't showing you as much as you want. In particular the Quicklook plugin doesn't show any part of the book's contents at all - just the metadata gathered from one particular part of the epub file which contains the book title, author, publisher, ISBN, cover, that sort of thing. I'm not sure what you mean by "shows Adobe's reader". Can you share a screenshot? What else would you like the plugin to show? Thanks, Chris |
|
![]() |
![]() |
![]() |
#4 |
Junior Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4
Karma: 4156
Join Date: Jan 2010
Device: none
|
I found a solution to my problem by some brute forcing.
Searching in Spotlight for [server data web] returns 3 files. Hovering over them in Spotlight just shows me empty metadata and wasn't useful. I can't tell which one is the one I need, so I end up having to open them all, search, close, repeat. So, a bit of bashing later. Ideally I'd just have used iconv or similar but anyway... Code:
#!/usr/bin/env bash set -o errexit set -o nounset function exportFile { mdimport -d2 "$1" 2>&1 | sed -e 's/\\n/±/g' | tr '±' '\n' | tr '.' '\n' | sed -e 's/\\U2019/''/g' -e 's/\\U2013/-/g' -e 's/\\U2212/-/g' | sed -e 's/\\U2026/.../g' -e 's/\\U00a9/\(C\)/g' -e 's/\\U201c/\"/g' | sed -e 's/\\U201d/\"/g' -e 's/\\U00a0//g' -e 's/\\U00d7/\*/g' | sed -e 's/\\U2018/''/g' } mkdir -p txt ls *.epub | while read FILENAME; do echo "********** ${FILENAME}" exportFile "${FILENAME}" > "txt/${FILENAME}.txt" done That dumps the raw text from the epubs into a separate directory txt. Now I can search for the text, e.g. Code:
Core:txt paulhargreaves$ grep -i server * | grep -i data | grep -i web TU100_b1_p3.epub.txt: This means they avoid having to download the same information multiple times, which saves on the amount of data transferred from the web server and allows the browser to render pages more quickly TU100_b1_p4.epub.txt:This activity is unavailableShow descriptionAs you have just seen, the server sends the web page data in a sequence of packets TU100_b3_p2.epub.txt:Scene 11 - servers, websites and databases appear next to the headquarters and disappear into it So, thank you for a great plugin, it's useful! |
![]() |
![]() |
![]() |
#5 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 440
Karma: 77256
Join Date: Sep 2011
Device: none
|
Hello chrisridd,
thanks for the wonderful plugins. I noticed with 10.10.2 I believe, Quicklook no longer shows a cover. Maybe you could take a look sometime? |
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 977
Karma: 2209358
Join Date: Nov 2011
Location: London, UK
Device: Kobo Aura, Kobo Aura ONE, PocketBook InkPad Color 3
|
Quote:
I can't see what's happening though - the code's returning an image correctly, just the web preview isn't showing it up. There are a couple of similar observations on the Apple dev forums. I'll keep looking and keep you posted. Thanks for the bug report! |
|
![]() |
![]() |
![]() |
#7 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 440
Karma: 77256
Join Date: Sep 2011
Device: none
|
Awesome. Thanks chrisridd.
|
![]() |
![]() |
![]() |
#8 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 977
Karma: 2209358
Join Date: Nov 2011
Location: London, UK
Device: Kobo Aura, Kobo Aura ONE, PocketBook InkPad Color 3
|
|
![]() |
![]() |
![]() |
Tags |
mac, metadata, osx, spotlight |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
PRS-600 New Note Importer | gbargoud | Sony Reader | 0 | 06-20-2010 11:21 AM |
PRS-600 Note Importer | gbargoud | Sony Reader Dev Corner | 13 | 05-16-2010 10:29 AM |
ePub QuickLook and Spotlight plugins for Mac OS X | cjkarr | ePub | 0 | 04-16-2009 07:48 AM |
Building an EPUB Spotlight importer for MacOS X | cjkarr | ePub | 8 | 04-16-2009 03:54 AM |
Another Sony Reader importer | AprilHare | Introduce Yourself | 1 | 04-05-2008 07:27 AM |