readium / r2-streamer-js Goto Github PK
View Code? Open in Web Editor NEWNodeJS Readium2 "streamer"
License: BSD 3-Clause "New" or "Revised" License
NodeJS Readium2 "streamer"
License: BSD 3-Clause "New" or "Revised" License
...because of offsetTop / offsetLeft calculations (element bounding box) resulting in minute pixel offset. Should normalize to +1 pixel for "safety" margin.
FYI Readium 1 is failing with all 3 publications on demo server.
Console error:
'webpubJson.metadata.publisher[0]'
) → getMetadata
(package_document_parser.js:41)So that’s
// getElemText(metadataElem, "publisher");
metadata.publisher = webpubJson.metadata.publisher[0].name;
Hello @danielweck, I am a bit confused regarding how this can be integrated with LCP Server
stack.
I noticed that encryption.md talks about LSD Server
as being interesting to have, thus it is not supported, right?
That being the case, there is a demo for a protected epub with LCP passphrase
"dan", does that mean that I would need to serve one protected epub per user with the LCP passphrase
built-in?
If so, how could I achieve that for testing? I tried serving the encrypted
folder from LCP Server
, but from my understanding there is no passphrase associated with that epub at all.
(node:80) UnhandledPromiseRejectionWarning: TypeError: obj.hasOwnProperty is not a function
at Array.forEach (<anonymous>)
at Object.keys.forEach (/home/nowuser/src/node_modules/r2-utils-js/dist/es8-es2017/src/_utils/JsonUtils.js:32:21)
at traverseJsonObjects_ (/home/nowuser/src/node_modules/r2-utils-js/dist/es8-es2017/src/_utils/JsonUtils.js:31:26)
at Object.keys.forEach (/home/nowuser/src/node_modules/r2-utils-js/dist/es8-es2017/src/_utils/JsonUtils.js:35:21)
at Array.forEach (<anonymous>)
at traverseJsonObjects_ (/home/nowuser/src/node_modules/r2-utils-js/dist/es8-es2017/src/_utils/JsonUtils.js:31:26)
at Object.keys.forEach (/home/nowuser/src/node_modules/r2-utils-js/dist/es8-es2017/src/_utils/JsonUtils.js:35:21)
at Array.forEach (<anonymous>)
at traverseJsonObjects_ (/home/nowuser/src/node_modules/r2-utils-js/dist/es8-es2017/src/_utils/JsonUtils.js:31:26)
at Object.keys.forEach (/home/nowuser/src/node_modules/r2-utils-js/dist/es8-es2017/src/_utils/JsonUtils.js:35:21)
at Array.forEach (<anonymous>)
at traverseJsonObjects_ (/home/nowuser/src/node_modules/r2-utils-js/dist/es8-es2017/src/_utils/JsonUtils.js:31:26)
at traverseJsonObjects_ (/home/nowuser/src/node_modules/r2-utils-js/dist/es8-es2017/src/_utils/JsonUtils.js:26:17)
at Object.keys.forEach (/home/nowuser/src/node_modules/r2-utils-js/dist/es8-es2017/src/_utils/JsonUtils.js:35:21)
at Array.forEach (<anonymous>)
at traverseJsonObjects_ (/home/nowuser/src/node_modules/r2-utils-js/dist/es8-es2017/src/_utils/JsonUtils.js:31:26)
(node:80) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
For example, to disable the built-in sample "readers" (NYPL demo, etc.), HTTP CORS (in some cases they are in fact unwanted), OPDS micro-services, etc. etc.
(there are many optional features, perhaps the server constructor should launch by default with no HTTP route activated, and a convenience method on the server class could implement a baseline suitable for "readium desktop", another for the Heroku/Now.sh online deployment, etc.)
Noticed strange behavior when using R1 reader with Node JS R2 streamer.
It looks like the subsequent hit of the same URL results in WebPub manifest
being served from the cache is not correct.
Here is the environment:
R1 reader
cd ~/ep/readium/readium-js-viewer
npm run http
R2 streamer
cd ~/r2-streamer-js
yarn run server-debug .
open up R1 reader pointing to R2 Web Manifest
http://localhost:8080/dev/index_RequireJS_no-optimize_LITE.html?epub=http://localhost:3000/pub/L1VzZXJzL21pY2hhZWxzL3IyLXN0cmVhbWVyLWpzL1RhbGVzRnJwbVNoZWtzcGlyZS5lcHVi/manifest.json
First hit results in the book being open OK. Subsequent hit or refresh results in
load indicator displayed indefinitely.
Here are the logs from R2 streamer:
First hit
::1 - - [09/Jun/2017:17:57:20 +0000] "HEAD /pub/L1VzZXJzL21pY2hhZWxzL3IyLXN0cmVhbWVyLWpzL1RhbGVzRnJwbVNoZWtzcGlyZS5lcHVi/manifest.json HTTP/1.1" - - "http://localhost:8080/dev/index_RequireJS_no-optimize_LITE.html?epub=http://localhost:3000/pub/L1VzZXJzL21pY2hhZWxzL3IyLXN0cmVhbWVyLWpzL1RhbGVzRnJwbVNoZWtzcGlyZS5lcHVi/manifest.json" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"
r2:server:pub /Users/michaels/r2-streamer-js/TalesFrpmShekspire.epub +23s
r2:server:assets Asset not in zip! manifest.json/META-INF/container.xml +1ms
::1 - - [09/Jun/2017:17:57:20 +0000] "GET /pub/L1VzZXJzL21pY2hhZWxzL3IyLXN0cmVhbWVyLWpzL1RhbGVzRnJwbVNoZWtzcGlyZS5lcHVi/manifest.json/META-INF/container.xml HTTP/1.1" 500 115 "http://localhost:8080/dev/index_RequireJS_no-optimize_LITE.html?epub=http://localhost:3000/pub/L1VzZXJzL21pY2hhZWxzL3IyLXN0cmVhbWVyLWpzL1RhbGVzRnJwbVNoZWtzcGlyZS5lcHVi/manifest.json" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"
r2:server:pub /Users/michaels/r2-streamer-js/TalesFrpmShekspire.epub +1s
::1 - - [09/Jun/2017:17:57:22 +0000] "HEAD /pub/L1VzZXJzL21pY2hhZWxzL3IyLXN0cmVhbWVyLWpzL1RhbGVzRnJwbVNoZWtzcGlyZS5lcHVi/manifest.json HTTP/1.1" 200 24453 "http://localhost:8080/dev/index_RequireJS_no-optimize_LITE.html?epub=http://localhost:3000/pub/L1VzZXJzL21pY2hhZWxzL3IyLXN0cmVhbWVyLWpzL1RhbGVzRnJwbVNoZWtzcGlyZS5lcHVi/manifest.json" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"
r2:server:pub /Users/michaels/r2-streamer-js/TalesFrpmShekspire.epub +17ms
::1 - - [09/Jun/2017:17:57:22 +0000] "GET /pub/L1VzZXJzL21pY2hhZWxzL3IyLXN0cmVhbWVyLWpzL1RhbGVzRnJwbVNoZWtzcGlyZS5lcHVi/manifest.json HTTP/1.1" 200 24453 "http://localhost:8080/dev/index_RequireJS_no-optimize_LITE.html?epub=http://localhost:3000/pub/L1VzZXJzL21pY2hhZWxzL3IyLXN0cmVhbWVyLWpzL1RhbGVzRnJwbVNoZWtzcGlyZS5lcHVi/manifest.json" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"
Second hit or page refresh
r2:server:pub /Users/michaels/r2-streamer-js/TalesFrpmShekspire.epub +40s
r2:server:manifestjson manifest.json cache +5ms
Third hit
::1 - - [09/Jun/2017:17:58:30 +0000] "HEAD /pub/L1VzZXJzL21pY2hhZWxzL3IyLXN0cmVhbWVyLWpzL1RhbGVzRnJwbVNoZWtzcGlyZS5lcHVi/manifest.json HTTP/1.1" - - "http://localhost:8080/dev/index_RequireJS_no-optimize_LITE.html?epub=http://localhost:3000/pub/L1VzZXJzL21pY2hhZWxzL3IyLXN0cmVhbWVyLWpzL1RhbGVzRnJwbVNoZWtzcGlyZS5lcHVi/manifest.json" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"
r2:server:pub /Users/michaels/r2-streamer-js/TalesFrpmShekspire.epub +28s
r2:server:assets Asset not in zip! manifest.json/META-INF/container.xml +1ms
::1 - - [09/Jun/2017:17:58:30 +0000] "GET /pub/L1VzZXJzL21pY2hhZWxzL3IyLXN0cmVhbWVyLWpzL1RhbGVzRnJwbVNoZWtzcGlyZS5lcHVi/manifest.json/META-INF/container.xml HTTP/1.1" 500 115 "http://localhost:8080/dev/index_RequireJS_no-optimize_LITE.html?epub=http://localhost:3000/pub/L1VzZXJzL21pY2hhZWxzL3IyLXN0cmVhbWVyLWpzL1RhbGVzRnJwbVNoZWtzcGlyZS5lcHVi/manifest.json" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"
r2:server:pub /Users/michaels/r2-streamer-js/TalesFrpmShekspire.epub +2s
::1 - - [09/Jun/2017:17:58:32 +0000] "HEAD /pub/L1VzZXJzL21pY2hhZWxzL3IyLXN0cmVhbWVyLWpzL1RhbGVzRnJwbVNoZWtzcGlyZS5lcHVi/manifest.json HTTP/1.1" 200 24453 "http://localhost:8080/dev/index_RequireJS_no-optimize_LITE.html?epub=http://localhost:3000/pub/L1VzZXJzL21pY2hhZWxzL3IyLXN0cmVhbWVyLWpzL1RhbGVzRnJwbVNoZWtzcGlyZS5lcHVi/manifest.json" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"
r2:server:pub /Users/michaels/r2-streamer-js/TalesFrpmShekspire.epub +16ms
::1 - - [09/Jun/2017:17:58:32 +0000] "GET /pub/L1VzZXJzL21pY2hhZWxzL3IyLXN0cmVhbWVyLWpzL1RhbGVzRnJwbVNoZWtzcGlyZS5lcHVi/manifest.json HTTP/1.1" 200 24453 "http://localhost:8080/dev/index_RequireJS_no-optimize_LITE.html?epub=http://localhost:3000/pub/L1VzZXJzL21pY2hhZWxzL3IyLXN0cmVhbWVyLWpzL1RhbGVzRnJwbVNoZWtzcGlyZS5lcHVi/manifest.json" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"
And so on - one hit is a success, subsequent from "cache" failure.
https://github.com/readium/r2-streamer-js/tree/develop/misc/json-schema/webpub-manifest
See Git commit history after August 29th:
https://github.com/readium/webpub-manifest/commits/master/schema
At this point in time, this is the only change:
readium/webpub-manifest@ae0321c#diff-c9550d5fad73447fc24ba47f95d1c6b7
Related issue: #30
This "TODO" code comment has been present from day-1 in the TypeScript source, still unresolved (time to file an issue!):
r2-streamer-js/src/http/server.ts
Lines 353 to 358 in 6afd236
Basically, the cache of ReadiumWebPubManifest models grows indefinitely in the current implementation.
This is how I instantiate the readium server:
import {
Server
} from "r2-streamer-js";
const OPDSServer = new Server({
disableDecryption: false, // deactivates the decryption of encrypted resources (Readium LCP).
disableOPDS: false, // deactivates the HTTP routes for the OPDS "micro services" (browser, converter)
disableReaders: false, // deactivates the built-in "readers" for ReadiumWebPubManifest (HTTP static host / route).
disableRemotePubUrl: false, // deactivates the HTTP route for loading a remote publication.
maxPrefetchLinks: 5, // Link HTTP header, with rel = prefetch, see server.ts MAX_PREFETCH_LINKS (default = 10)
});
const url = async () => await OPDSServer.start(5643, false);
url().then(async (res) => {
console.log(res);
const publicationURLs = OPDSServer.addPublications([
"http://localhost:3000/comics/Iron Man/Iron Man - V1 193.cbz",
]);
console.log(publicationURLs);
OPDSServer.publicationsOPDS();
const publication = await OPDSServer.loadOrGetCachedPublication(
"http://localhost:3000/comics/Iron Man/Iron Man - V1 193.cbz",
);
console.log(publication);
OPDSServer.publicationsOPDS();
});
When I look at the OPDS2
feed located here http://localhost:5643/opds2/publications.json/show
, I get this response:
{
"metadata": {
"numberOfItems": 0,
"@type": "http://schema.org/DataFeed",
"title": "Readium 2 OPDS 2.0 Feed",
"modified": "Wed Jul 14 2021 09:43:52 GMT-0700 (Pacific Daylight Time)"
},
"links": [
{
"type": "application/opds+json",
"rel": "self",
"href": "http://localhost:5643/opds2/publications.json"
}
],
"publications": [ ]
}
Why isn't my comic listed in the publications list?
Currently, a number of HTTP routes / URL paths defined in r2-streamer-js
invoke the setResponseCORS()
utility function in order to populate HTTP responses with adequate CORS headers:
r2-streamer-js/src/http/server.ts
Lines 259 to 271 in c1f3ac0
For example, for serving the ReadiumWebPublicationManifest (JSON):
r2-streamer-js/src/http/server-manifestjson.ts
Lines 344 to 345 in c1f3ac0
However, what about HTTP options
for CORS? How is this useful? What are the use-cases?
Code example:
public expressOptions(paths: string[], func: express.Handler) {
this.expressApp.options(paths, func);
}
...added to:
r2-streamer-js/src/http/server.ts
Lines 136 to 142 in c1f3ac0
...and:
_server.expressOptions(["/URL_ROUTE_PATH"],
(req: express.Request, res: express.Response) => {
res.setHeader("Access-Control-Allow-Origin", "*");
res.setHeader("Access-Control-Allow-Credentials", true);
res.setHeader("Access-Control-Allow-Methods", req.headers["access-control-request-method"]);
res.setHeader("Access-Control-Allow-Headers", req.headers["access-control-request-headers"]);
res.status(200).end();
});
Inspired from NYPL's customizations:
https://github.com/NYPL-Simplified/opds-web-client/blob/1600781c267e241e5deb4094007e50df79eb6236/packages/server/index.js#L73
( https://github.com/NYPL-Simplified/opds-web-client/blob/master/packages/server/index.js#L73 )
CC @aslagle
I'm getting this error on a few different epubs:
$ yarn run cli /Users/amyslagle/Downloads/677.epub
yarn run v0.21.3
$ node './dist/src/cli.js' /Users/amyslagle/Downloads/677.epub
process.cwd():
/Users/amyslagle/dev/r2-streamer-js
__dirname:
/Users/amyslagle/dev/r2-streamer-js/dist/src
args:
[ '/Users/amyslagle/Downloads/677.epub' ]
/Users/amyslagle/Downloads/677.epub
== EpubParser: reject
TypeError: Cannot read property 'push' of undefined
at EpubParser.fillTOCFromNavPoint (/Users/amyslagle/dev/r2-streamer-js/dist/src/parser/epub.js:945:13)
at ncx.Points.forEach (/Users/amyslagle/dev/r2-streamer-js/dist/src/parser/epub.js:917:22)
at Array.forEach (native)
at EpubParser.fillTOCFromNCX (/Users/amyslagle/dev/r2-streamer-js/dist/src/parser/epub.js:916:24)
at forEach (/Users/amyslagle/dev/r2-streamer-js/dist/src/parser/epub.js:172:34)
at Array.forEach (native)
at Promise (/Users/amyslagle/dev/r2-streamer-js/dist/src/parser/epub.js:91:22)
at EpubParser.createPublicationPromise (/Users/amyslagle/dev/r2-streamer-js/dist/src/parser/epub.js:48:16)
at Parse.zipPromise.then (/Users/amyslagle/dev/r2-streamer-js/dist/src/parser/epub.js:44:25)
false
✨ Done in 0.48s.
...just like we do for first-pass ReadiumCSS render, etc. (loading spinner)
I need to migrate old epub files.
When generating the manifest.json file, I would like to add the 'media-overlay' entry in the code below, please let me know if there is a way to do this.
"metadata": {
"@type": "http://schema.org/Book",
"title": "Aladdin and the Magic Lamp",
"identifier": "urn:uuid:978-1-4509-7342-7",
"author": "retold by Kathryn L. O’Dell",
"narrator": "Author",
"publisher": "Benchmark Education Company",
"language": "en-US",
"modified": "Tue Apr 07 2015 10:13:00 GMT+0900 (대한민국 표준시)",
"published": "Tue Feb 10 2015 20:17:22 GMT+0900 (대한민국 표준시)",
"readingProgression": "ltr",
"rendition": {
"layout": "fixed",
"orientation": "landscape",
"spread": "auto"
},
"rendition:layout": "pre-paginated",
"rendition:orientation": "landscape",
"rendition:spread": "auto"
},
"metadata": {
"@type": "http://schema.org/Book",
"title": "Aladdin and the Magic Lamp",
"identifier": "urn:uuid:978-1-4509-7342-7",
"author": "retold by Kathryn L. O’Dell",
"narrator": "Author",
"publisher": "Benchmark Education Company",
"language": "en-US",
"modified": "Tue Apr 07 2015 10:13:00 GMT+0900 (대한민국 표준시)",
"published": "Tue Feb 10 2015 20:17:22 GMT+0900 (대한민국 표준시)",
"readingProgression": "ltr",
"media-overlay": { // < --- need to add this
"active-class": "-epub-media-overlay-active"
},
"rendition": {
"layout": "fixed",
"orientation": "landscape",
"spread": "auto"
},
"rendition:layout": "pre-paginated",
"rendition:orientation": "landscape",
"rendition:spread": "auto"
},
FYI we just had a bug with this one:
as the streamer created a path64 path containing the "=" character and consequently split the path to the manifest.json.
So instead of
https://website/pub/L3Zhci9qZWxseWJvb2tzL3JlYWRpdW0vYXNzZXRzL0ZhckZyb21UaGVNYWRkaW5nQ3Jvd2QtY292ZXJBLmVwdWI=/manifest.json
it returned
https://website/pub/L3Zhci9qZWxseWJvb2tzL3JlYWRpdW0vYXNzZXRzL0ZhckZyb21UaGVNYWRkaW5nQ3Jvd2QtY292ZXJBLmVwdWI
I'm trying to use this in the webpub-viewer project to replace the in-tree copy.
I added r2-streamer-js
as a devDependency
and thought I could use it as a binary in one of my project's scripts.
It is not working unfortunately.
> [email protected] streamed ./webpub-viewer
> r2-streamer-js-server ./examples/streamed/epubs/
./webpub-viewer/node_modules/.bin/r2-streamer-js-server: line 1: use strict: command not found
./webpub-viewer/node_modules/.bin/r2-streamer-js-server: line 2: syntax error near unexpected token `exports,'
./webpub-viewer/node_modules/.bin/r2-streamer-js-server: line 2: `Object.defineProperty(exports, "__esModule", { value: true });'
I believe you need to prepend the declared "bin" script with a node "shebang".
Example: https://github.com/isaacs/rimraf/blob/master/bin.js (Line 1)
After manually adding #!/usr/bin/env node
to the dist bin script it works as expected.
https://readium2.herokuapp.com/version/show
SyntaxError: /app/dist/gitrev.json: Unexpected token < in JSON at position 0
at JSON.parse (<anonymous>)
at Object.Module._extensions..json (module.js:681:27)
at Module.load (module.js:575:32)
at tryModuleLoad (module.js:515:12)
at Function.Module._load (module.js:507:3)
at Module.require (module.js:606:17)
at require (internal/module.js:11:18)
at Server.expressApp.get (/app/dist/es8-es2017/src/http/server.js:184:29)
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
at next (/app/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/app/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
at /app/node_modules/express/lib/router/index.js:281:22
at param (/app/node_modules/express/lib/router/index.js:354:14)
at param (/app/node_modules/express/lib/router/index.js:365:14)
at Function.process_params (/app/node_modules/express/lib/router/index.js:410:3)
https://github.com/edrlab/r2-streamer-js-dist/blob/develop/dist/gitrev.json
and
https://rawgit.com/edrlab/r2-streamer-js-dist/develop/dist/gitrev.json
See:
https://github.com/edrlab/r2-streamer-js/blob/develop/package-scripts.cson#L281
https://github.com/readium/r2-streamer-js/search?q=req.headers.host
for example : behind a reverse proxy
https://readium2.herokuapp.com
Application error
An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details.
See:
https://github.com/readium/webpub-manifest/tree/master/schema
Note that the JSON schemas as divided:
"$ref": "https://URL_TO_OTHER.schema.json"
Is this supports the aws s3 signed url remote publication.
This happens in R1 reader with Node JS R2 streamer testing MO functionality.
R1 reader pointing to R2 Web Pub manifest served by Node JS R2 streamer:
http://localhost:8080/dev/index_RequireJS_no-optimize_LITE.html?epub=http://localhost:3000/pub/L1VzZXJzL21pY2hhZWxzL3IyLXN0cmVhbWVyLWpzL1RhbGVzRnJwbVNoZWtzcGlyZS5lcHVi/manifest.json
When MO data for Spine Item is accessed, fetch is failing with CORS:
Fetch API cannot load
http://localhost:3000/pub/L1VzZXJzL21pY2hhZWxzL3IyLXN0cmVhbWVyLWpzL1RhbGVzRnJwbVNoZWtzcGlyZS5lcHVi/media-overlay?resource=OEBPS%2FText%2Fp022.xhtml. Redirect
from
'http://localhost:3000/pub/L1VzZXJzL21pY2hhZWxzL3IyLXN0cmVhbWVyLWpzL1RhbGVzRnJwbVNoZWtzcGlyZS5lcHVi/media-overlay?resource=OEBPS%2FText%2Fp022.xhtml'
to
'http://localhost:3000/pub/L1VzZXJzL21pY2hhZWxzL3IyLXN0cmVhbWVyLWpzL1RhbGVzRnJwbVNoZWtzcGlyZS5lcHVi/media-overlay/?resource=OEBPS%2FText%2Fp022.xhtml'
has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is
present on the requested resource. Origin 'http://localhost:8080' is therefore
not allowed access. If an opaque response serves your needs, set the request's
mode to 'no-cors' to fetch the resource with CORS disabled.
Indeed Network tab shows redirection from:
to:
Location:/pub/L1VzZXJzL21pY2hhZWxzL3IyLXN0cmVhbWVyLWpzL1RhbGVzRnJwbVNoZWtzcGlyZS5lcHVi/media-overlay/?resource=OEBPS%2FText%2Fp003.xhtml
r2:server:main REDIRECT: /pub/L1VzZXJzL21pY2hhZWxzL3IyLXN0cmVhbWVyLWpzL1RhbGVzRnJwbVNoZWtzcGlyZS5lcHVi/media-overlay?resource=OEBPS%2FText%2Fp010.xhtml ==> /pub/L1VzZXJzL21pY2hhZWxzL3IyLXN0cmVhbWVyLWpzL1RhbGVzRnJwbVNoZWtzcGlyZS5lcHVi/media-overlay/?resource=OEBPS%2FText%2Fp010.xhtml +37s
::1 - - [10/Jun/2017:00:52:56 +0000] "GET /pub/L1VzZXJzL21pY2hhZWxzL3IyLXN0cmVhbWVyLWpzL1RhbGVzRnJwbVNoZWtzcGlyZS5lcHVi/media-overlay?resource=OEBPS%2FText%2Fp010.xhtml HTTP/1.1" 301 161 "http://localhost:8080/dev/index_RequireJS_no-optimize_LITE.html?epub=http://localhost:3000/pub/L1VzZXJzL21pY2hhZWxzL3IyLXN0cmVhbWVyLWpzL1RhbGVzRnJwbVNoZWtzcGlyZS5lcHVi/manifest.json" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"
Here is the environment:
R1 reader
cd ~/ep/readium/readium-js-viewer
npm run http
R2 streamer
cd ~/r2-streamer-js
yarn run server-debug .
Note, that there is no problem accessing this URL directly:
http://localhost:3000/pub/L1VzZXJzL21pY2hhZWxzL3IyLXN0cmVhbWVyLWpzL1RhbGVzRnJwbVNoZWtzcGlyZS5lcHVi/media-overlay?resource=OEBPS%2FText%2Fp003.xhtml
https://github.com/opds-community/opds-revision/blob/master/opds-2.0.md
NodeJS Typescript model implementation:
https://github.com/edrlab/r2-streamer-js/blob/develop/src/models/opds2.ts
Go model implementation + active deployment:
https://github.com/readium/r2-streamer-go/blob/master/models/opds2/opds2.go
+
https://readium2.feedbooks.net/publications.json
TODO:
https://readium2.herokuapp.com/opds2/publications.json
https://readium2.herokuapp.com/opds2/publications.json/show
https://readium2.herokuapp.com/opds2/publications.json/show/all
(etc.)
http://oacontent.librarysimplified.org/
=>
Readium2 streamer basic OPDS viewer:
https://readium2.herokuapp.com/opds/http%3A%2F%2Foacontent.librarysimplified.org%2F
Readium1 "library" view:
https://readium.firebaseapp.com/?epubs=https%3A%2F%2Fcors-anywhere.herokuapp.com%2Fhttp%3A%2F%2Foacontent.librarysimplified.org%2F
NYPL browser (+ source):
https://opds-browser-demo.herokuapp.com/collection/http%3A%2F%2Foacontent.librarysimplified.org/
+
https://github.com/NYPL-Simplified/opds-web-client
TODO: redirect https://readium2.herokuapp.com/opds/{OPDS_URL}
to https://opds-browser-demo.herokuapp.com/collection/{OPDS_URL}
, and change the "download EPUB" link to https://readium2.herokuapp.com/opds/{EPUB_URL}
?
WORKS:
https://s3.amazonaws.com/epubjs-manifest/examples/manifest.html?href=[URL]
FAILS:
https://futurepress.github.io/epubjs-reader/?bookPath=[URL]
@fchasen which EPUB.js URL should I use to test the webpub manifest stuff? Thanks :)
Like the question says, I have a library of comic books in cbz
and cbr
files. What is the most trivial way to generate a feed of these publications for consumption by a downstream app such as Panels on iOS?
Hi @danielweck ,
Today i need to process epub store in s3 with cloudfront signed url.
But with the same epub I stored in streamer server, i upload it to s3 then the streamer can't parse spine.
Epub uuid: urn:uuid:6f796b4e-0cd5-4ed5-a319-2fe6a9d14e9f
As I said before, the above epub still can parsed if epub url doesn't use cloudfront signed url!
Tuan Anh,
Thanks
Review existing, and add http://aslagle-demo.herokuapp.com/
Related issue: #23
Hi @danielweck,
I found that if I not browse ./manifest.json/show/all
page, i will get error r2:lcp#transform/transformer-lcp LCP not ready!
My solution
Did i miss something?
I'm very interested in streamer can stream data.
Thank you
Hi Daniel,
A couple of sample mashups are not working due to http/https mismatch:
regards, Michael
For example:
https://bookserver.archive.org/group/openaudiobooks
entry with acquisition link type="application/audiobook+json"
=>
https://api.archivelab.org/books/all_along_the_river_1710_librivox/opds_audio_manifest
This would help debug feeds, as well as linked WebPubManifests.
It would be great if this could be arbitrary UUID or database URL scheme (etc.) with backend capable of supported various storage retrieval mechanisms. This is somewhat related to the notion of "fetcher" in the Readium2 architecture (e.g. exploded EPUBs vs. packed/zipped publications), but there are deeper ramifications due to how the decoded base64 string is used to map other behaviours. To be investigated further...
> URL=`curl -H "Authorization: Bearer $BEARER" -s https://eole-recette.avh.asso.fr/api/v1/search | jq -r '.publications[0].links[0].href'`
> curl -H "Authorization: Bearer $BEARER" -s $URL | jq '.readingOrder[0]'
{
"type": "audio/?",
"duration": 12.896,
"href": "Y061664/aud001.mp3?r2tkn=eyJoYXNoIjoiNTRkYWY5MjhhNTZlYzY4OWY5OWI5NmQ0MWRhZDY0MTdiYTBkNjdlNzdmZWE2OWI4NmVmODNlZTBiYTZmNDQ5MiIsInRpbWVzdGFtcCI6MTY2MDc0MDg2MTM3MywiZXhwaXJ5Ijo4NjQwMH0%3D"
}
Related: readium/r2-opds-js#3
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.