ajslater / codex

Codex is a web based comic archive browser and reader
GNU General Public License v3.0
184 stars 6 forks source link

Newest update breaks opds streaming #375

Closed ipkstef closed 2 months ago

ipkstef commented 3 months ago

had to revert my image back to "ajslater/codex@sha256:a2c9bd7c838c476ae537c237c28abe1362d9b5e493fbfcac15adcb45b53649d8"

But the latest update forces opds clients to attempt to download instead of streaming. It doesn't download as well

Using the panels app

ajslater commented 3 months ago

I'm having trouble reproducing this.

I just opened Panels on my iPhone and connected to my server running codex v1.5.13 with docker. This server version is tagged as "latest" or "v1.5.13a2". I navigated to a comic I'd never read before and streamed the pages successfully. I also downloaded the comic successfully.

It seems odd that you can navigate to comics but not access them, so it's not a general url, proxy or authorization error. Can you think of anything else unusual about your setup? Have you tried navigating the OPDS urls with a web browser and seeing if you can access the streaming or download urls? Navigating that way is a little tedious because the urls embedded in the xml aren't rendered as hyperlinks by the browser, but with a little copy and paste we might get closer to figuring out what's going on.

ipkstef commented 3 months ago

Thank you for the prompt reply, i will run through your debugging tips after work and report back

abillauer commented 3 months ago

I am also seeing something odd with OPDS. I am using OPDS V1 and chunky and I can't connect. The Connection fails. I was able to connect prior to the upgrade.

I am not sure how auth works for OPDS but these steps are what I have seen so far: 1) Login into the codex web interface 2) Navigate to the OPDS URL in a new tab (http://XXX.XXX.XXX.XXX:9810/opds/v1.2/r/0/1) and I get back the OPDS XML


1) Open private browsing window Navigate to the OPDS URL in a new tab (http://XXX.XXX.XXX.XXX:9810/opds/v1.2/r/0/1) I get a "Server Error (500)" I am not sure if it is supposed to prompt for a password but it doesn't (I tried FireFox and Safari) Is there a URL modifier to pass the login credentials? Something else?

I have the log level at debug and I don't see any OPDS activity there.

Any guidance would be appreciated.

ajslater commented 3 months ago

I just tried with a private window and was able to get the XML. However I have anonymous access allowed on that server.

The way authorization works with OPDS is through HTTP AUTH. If you have private only access enabled, you'll need to pass credentials that way, e.g.

http://user@password:xxx.xxx.xxx.xxx:9810/opds/v1.2/r/0/1)

OPDS clients usually handle this.

I'm about to board a flight, so I expect I'll get back to this tomorrow at earliest.

abillauer commented 3 months ago

That didn't work for me. The browser couldn't parse the address and I got a search error.

I also tried http://xxx.xxx.xxx.xxx:9810/opds/v1.2/r/0/1:user@password

but that yielded a 500.

Have a safe flight!

ajslater commented 3 months ago

I wrote the the url scheme wrong: the @ & : were switched.

It’s @.***:port/path

On Tue, Apr 9, 2024 at 6:07 PM abillauer @.***> wrote:

That didn't work for me. The browser couldn't parse the address and I got a search error.

I also tried @.***

but that yielded a 500.

Have a safe flight!

— Reply to this email directly, view it on GitHub https://github.com/ajslater/codex/issues/375#issuecomment-2046122859, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACAKRVOQB34EXPL2IUR5YLY4RRBHAVCNFSM6AAAAABF62JQRWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBWGEZDEOBVHE . You are receiving this because you commented.Message ID: @.***>

abillauer commented 3 months ago

I tried

http://user:password@xxx.xxx.xxx.xxx:9810/opds/v1.2/r/0/1

and I got a 500 error. I do not have anonymous access on.

When I turn on anonymous access the browser connects and the user passoword works in chunky. Oddly enough I am now seeing the same behavior reported. Chunky only will let me download and not stream the comics.

ajslater commented 2 months ago

I fixed some things in the new v1.5.14

abillauer commented 2 months ago

I installed 1.5.14 and it fixes the login issue on Chucky on IOS. The streaming issue still exists but I think I have a bit more of a direction.

When I navigate in Chunky by file view and I try to view a comic that has no meta data the files show up as title "0000" and I can only download them. When I view by publisher/series I can see the full title and I can stream.

It is odd there is anything there as I have the "Import Metadata on Library Scan" Flag unchecked. I think the OPDS file view is what is impacted with no meta-data.

abillauer commented 2 months ago

"It is odd there is anything there as I have the "Import Metadata on Library Scan" Flag unchecked. I think the OPDS file view is what is impacted with no meta-data."

I just realized (and confirmed) the meta-data that is there was created on read. So at least that is explained : )

ajslater commented 2 months ago

When I navigate in Chunky by file view and I try to view a comic that has no meta data the files show up as title "0000" and I can only download them. When I view by publisher/series I can see the full title and I can stream. ... I have the "Import Metadata on Library Scan" Flag unchecked

Aha! This will help reproduction, thanks!

ajslater commented 2 months ago

This was Chunky being a little too helpful. Without scanning metadata we don't get book page counts. When chunky sees a pse streaming link without a page count it assumes it's a zero length book and not streamable. So similar to my web reader I'm now doing just in time page count reading for chunky and any other opds readers that require page counts greater that 0 or even accurate page counts.

Fixed I think in v1.5.15

abillauer commented 2 months ago

THANK YOU!! Works amazing now.

Thanks again for all your hard work!! Codex rocks!!