Calibre companion, calibre-server, and url-prefix: A question for the dev
I know that using url-prefix for calibre-server causes problems with using the content server connection in Calibre companion, and the solution at the moment is to enter the full URL to the content server with url-prefix. That works.
The Calibre content server home page has a "Feed" element with the actual URL of the opds feed, with url-prefix, and that hasn't changed in a while. A little bit of xpath magic on the returned HTML from the root path would get that URL. I haven't looked for xpath libraries for android, so maybe scraping the page is harder than it looks.
It could fall back to the current behavior of assuming no url-prefix if the xpath lookup/scraping fails, and there's no harm, no foul.
Is this a potential solution to make the discovery more automatic? Is it more trouble than it's worth?
UPDATE: A working (but simple) xpath expression to get the opds URL (or at least the path portion) is "//a[contains(@href, 'opds')]/@href"
This returns "/calibre/opds" on the HTML from my calibre server.
Last edited by duckpuppy; 10-06-2016 at 09:06 PM.
Reason: Added xpath example
|