ajslater / codex

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

Download Button doesn't download comic file #241

Closed beville closed 1 year ago

beville commented 1 year ago

I could could never get the download button from the web UI to work on my iPad, but never really looked into it. Tried recently on my desktop computer and while it downloads a file, it's not a CBZ file, but HTML, always about 2KB. Content looks like:

<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta charset="utf-8" />
        <meta name="viewport"
              content="width=device-width,initial-scale=1.0,viewport-fit=cover"/>
        <title>Codex</title>

<link rel="icon"
      href="/static/img/logo.3fb129bfbd92.svg"
      sizes="any"
      type="image/svg+xml"/>

<link rel="icon"
      href="/static/img/logo-32.dbb98f6dfde4.webp"
      sizes="32x32"
      type="image/webp"/>

<link rel="apple-touch-icon"
      href="/static/img/logo-maskable-180.201cbde62d55.webp"
      sizes="180x180"
      type="image/webp"/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-title" content="Codex"/>
<meta name="apple-mobile-web-app-status-bar-style" content="#2A2A2A" />

<link rel="manifest"
      href="/manifest.webmanifest"
      crossorigin="use-credentials"/>
<meta name="mobile-web-app-capable" content="yes" />
<meta name="application-name" content="Codex" />
<meta name="theme-color" content="#2A2A2A" />
<script async src="/serviceworker-register.js"></script>

<script>
  var CODEX = {
    APP_PATH: "/",
    API_V3_PATH: "/api/v3/",
    LAST_ROUTE: {'group': 'r', 'pk': 0, 'page': 1},
    MISSING_COVER: "/static/img/missing-cover.8c8c1d4f6782.webp",
    MISSING_PAGE: "/static/img/missing-page.71bb10f7c72a.svg",
    OPDS_PATH: "/opds/v1.2/r/0/1",
  };
  Object.freeze(CODEX);
</script>

        <link rel="stylesheet" href="/static/assets/admin-1fb653fc.css" />
<link rel="stylesheet" href="/static/assets/main-fdbc6a42.css" />
<script type="module" crossorigin="" src="/static/assets/main-15e2075d.js"></script>
    </head>
    <body>
        <noscript>
            <h1>Codex doesn't work without JavaScript</h1>
            Please enable it to continue.
        </noscript>
        <div id="App" />
    </body>
</html>

I even see it from the demo server.

ajslater commented 1 year ago

This was totally broken. As was "download page". Thanks for the report. It happened when I introduced some complicated code that attempts to fix downloading inside Progressive Web App on iOS. Should be fixed now in v1.2.3

beville commented 1 year ago

This problem persisted for me with 1.2.3 and later.

I had Codex installed on Ubuntu 22.04, running in a venv with Python 3.10. I also made a point to clear the pip caches before I re-installed Codex, so all dependencies would be up to date. Still didn't work.

I switched over to using the Docker image, and it started working. I notice the Docker image is running Python 3.11. Maybe there is some subtle difference in the environments?

I'll stick with the Docker image for now, so not an issue for me at the moment, but wanted to add more info to this ticket.