jaketmp / ePub-quicklook

NOTE: Not working in Mojave and later! ePub quicklook and spotlight plugins for Mac OS X.
BSD 3-Clause "New" or "Revised" License
570 stars 58 forks source link

macOS Catalina: "epub.mdimporter" cannot be opened because the developer cannot be verified. #51

Open 7k50 opened 4 years ago

7k50 commented 4 years ago
Screenshot 2019-11-11 at 12 32 11
jaketmp commented 4 years ago

This seems to be related to notarisation, as seen here whomwah/qlstephen#81. Unfortunately as noted in #50, I don't have the time or tools to fix this.

sisd23978 commented 4 years ago

Literature professor here, no programming skills. I've relied on epub.mdimporter for years, so thank you. I'm hoping there will be a solution to the Catalina problem someday. I've even tried using Time Machine to fix things. If anyone knows of an alternative method to search epub text, I'd be grateful to learn it.

(P.S. dream feature, just in case anyone is looking for projects: an ability to sort search results by relevance/frequency.)

jaketmp commented 4 years ago

Sorry I can help more - one suggestion for searching the text of an ePub: if you download The Unarchiver, and drag an ePub onto it, it should extract the book into a set of text files you can search.

sisd23978 commented 4 years ago

The Unarchiver trick has been very helpful—thank you! Do you know of any way to sort the text file search results by relevance?

jaketmp commented 4 years ago

The question is relevance to what? I'm afraid that veering into the world of data-science and natural language processing - there are lots of commercial or OS options here, but big tradeoffs in terms of complexity vs cost.

pragmat1c1 commented 4 years ago

This is how I solved it: Instead of copying EPUB.mdimporter into the global directory /Library/Spotlight/ you have to put it in the user directory in ~/Library/Spotlight. For me this folder Spotlight did not exist in my home folder ~/Library, so I had to create it:

➜  ~  mkdir ~/Library/Spotlight
➜  ~  mv ~/Downloads/EPUB.mdimporter ~/Library/Spotlight
➜  ~ mv ~/Downloads/EPUB.qlgenerator ~/Library/QuickLook

# Reload
➜  ~ mdimport -r ~/Library/Spotlight/EPUB.mdimporter
➜  ~ qlmanage -r
qlmanage: resetting quicklookd

Now it works without any problem :)


Regarding results by relevance/frequency: Have a look at DEVONThink 3. It offers what you are looking for.

merelybeholdingthedevs commented 2 years ago

I don't think that the last post, while containing useful suggestions, would solve the issue indicated at the beginning. At least, it didn't work in the Catalina OS (unsurprisingly, as the code only makes the plugin work via Terminal and doesn't eschew the Apple security restrictions). Here is what I found online that appeared to be promising: 1. At Stack Exchange, someone suggested the following:

epub.mdimporter is in ~/Library/Spotlight, and run xattr -d -r com.apple.quarantine ~/Library/Spotlight to remove com.apple.quarantine from the Spotlight plugins folder

I guess we should further specify the path, to the epub.mdimporter if we don't want to exempt the whole Spotlight folder from Apple security checks...

  1. Someone on Reddit made a similar suggestion for another application:

If macOS is blocking the file “xattr -d -r com.apple.quarantine {path to file}” will clear quarantine for the file. Be careful when using this one, only clear quarantine if you trust the file. This will only work if macOS is blocking the file with gatekeeper or xdefend.

I haven't tried any of these as I have no idea how to "undo" if something goes wrong. Just in case these appear to be a possible solution for a user with better computer skills...

damian0815 commented 1 year ago

I can confirm that @pragmat1c1 's suggestion is 100% working on macOS Monterey 12.6 on an M1 mac after deleting the com.apple.quarantine xattr entries as per @merelybeholdingthedevs 's comment. It takes a few minutes for the quicklook previews to start working, and the Spotlight process seems to be taking even longer, but i'm starting to see epubs showing up in Finder search where I've verified that the appearance is due to a full index of the text and not just the title or metadata.

merelybeholdingthedevs commented 1 year ago

Another confirmation here, for macOS Catalina! Many thanks, damian0815, brilliant indeed!: I had given up much earlier; merely hoping that the recent Calibre option for full text search could be an alternative (to some limited degree, surely). Glad that the suggestions for other programs applied well for mdimporter together with pragma1c1's post. Cheers!

yinan-c commented 3 months ago

Thanks @pragmat1c1 and @merelybeholdingthedevs for the advice. I have removed quarantine for the spotlight pluggin and it worked great, although the quicklook is not showing the full book but just an short description with some basic information, is that what I should expect?