satorumurmur / bibi

Bibi | EPUB Reader on your website.
https://bibi.epub.link
MIT License
859 stars 123 forks source link

How do you read an ebook directly from a web server? #58

Open gabrielsscti opened 6 years ago

gabrielsscti commented 6 years ago

How do you read a zipped .epub file that's in a web server?

KitaitiMakoto commented 6 years ago

@Guildsmac Try /bib/i/?book=xxx.epub like: https://bibid.kitaitimakoto.net/components/bibi/bib/i/?book=https%3A%2F%2Fstorage.googleapis.com%2Fbibid%2Fuploads%2FKitaitiMakoto%2F40839b04faeaf64a65dd9b9ac940f6f15304c13d.epub

yinux9 commented 4 years ago

@Guildsmac Try /bib/i/?book=xxx.epub like: https://bibid.kitaitimakoto.net/components/bibi/bib/i/?book=https%3A%2F%2Fstorage.googleapis.com%2Fbibid%2Fuploads%2FKitaitiMakoto%2F40839b04faeaf64a65dd9b9ac940f6f15304c13d.epub

Is a very good solution but for me this only can work for me y the same domain. I can´t upload from another URL of the another site. you modify the script? Please help me

KitaitiMakoto commented 4 years ago

You need two configurations to achieve cross domain loading.

yinux9 commented 4 years ago

You need two configurations to achieve cross domain loading.

Thank you, i try but dont have fix this.Version 1.0.1 server (192.168.10.239) with epub folder: httpd.conf

In the another server viewer: "bookshelf" : "http://192.168.10.239/lector/epub/" "trustworthy-origins" : ["http://192.168.10.239"], URL Tests: -http://127.0.0.1/lector/bibi/?book=book5.epub -http://127.0.0.1/lector/bibi/?book=http%3A%2F%2F192.168.10.239%2Flector%2Fepub%2Fbook5.epub

Log "OPTIONS /lector/epub/book5.epub HTTP/1.1" 200 - "http://127.0.0.1/lector/bibi/extensions/extractor/on-the-fly.bibi-zip-loader.worker.js"

"GET /lector/epub/book5.epub/META-INF/container.xml HTTP/1.1" 403 - "http://127.0.0.1/lector/bibi/?book=book5.epub"

Error: Fail to Open the Book

Can you help me fix. I can make a donation. Thank You

KitaitiMakoto commented 4 years ago

Can you show your browser's console log? If there are errors, page them. And HTTP request headers for EPUB file also helpful.

yinux9 commented 4 years ago

Can you show your browser's console log? If there are errors, page them. And HTTP request headers for EPUB file also helpful.

unzipper.js:24 Uncaught TypeError: Bibi.x(...) is not a function at unzipper.js:24 (anonymous) @ unzipper.js:24 Access to fetch at 'http://192.168.10.239/epub/book5.epub' from origin 'http://192.168.10.130' has been blocked by CORS policy: Request header field range is not allowed by Access-Control-Allow-Headers in preflight response. 192.168.10.130/:1 Access to fetch at 'http://192.168.10.239/epub/book5.epub' from origin 'http://192.168.10.130' has been blocked by CORS policy: Request header field range is not allowed by Access-Control-Allow-Headers in preflight response. 192.168.10.130/:1 Access to XMLHttpRequest at 'http://192.168.10.239/epub/book5.epub/META-INF/container.xml' from origin 'http://192.168.10.130' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. bibi.js:26 GET http://192.168.10.239/epub/book5.epub/META-INF/container.xml net::ERR_FAILED (anonymous) @ bibi.js:26 O.download @ bibi.js:26 a @ bibi.js:24 (anonymous) @ bibi.js:24 (anonymous) @ bibi.js:24 Promise.catch (async) or @ bibi.js:24 (anonymous) @ bibi.js:24 initializeBook @ bibi.js:24 (anonymous) @ bibi.js:24 Promise.then (async) loadBook @ bibi.js:24 Promise.then (async) hello @ bibi.js:24 (anonymous) @ bibi.js:19 document.addEventListener.e @ bibi.js:19 (anonymous) @ bibi.js:19 192.168.10.130/:1 Uncaught (in promise) Failed to Open the Book.

KitaitiMakoto commented 4 years ago

Thank you!.

Access to fetch at 'http://192.168.10.239/epub/book5.epub' from origin 'http://192.168.10.130' has been blocked by CORS policy: Request header field range is not allowed by Access-Control-Allow-Headers in preflight response.

This indicates that your server config for 192.168.10.239(not for 192.168.10.13) is something wrong. How about checking server configuration about CORS?

yinux9 commented 4 years ago

Apache httpd.conf <Directory "C:/xampp/htdocs"> Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Header set Access-Control-Allow-Origin "*"

KitaitiMakoto commented 4 years ago

Is it working? May you restart Apache successfully?

yinux9 commented 4 years ago

Is it working? May you restart Apache successfully?

Yes, restart apache. and reinstall All and dont work. :(

KitaitiMakoto commented 4 years ago

hmm... How about adding Access-Control-Allow-Headers setting according to browser log?

txb2d commented 3 years ago

I met same problem !who can help me