Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a84d4edb6b | |||
| 1379f416bc | |||
| 83466ded4d |
+10
-9
@@ -1,10 +1,11 @@
|
|||||||
__pycache__
|
**/__pycache__/
|
||||||
*ipynb
|
**/*.ipynb
|
||||||
build
|
**/build/
|
||||||
.idea
|
.idea/
|
||||||
.vscode
|
.vscode/
|
||||||
.venv
|
**/.venv/
|
||||||
.env
|
**/.env
|
||||||
*log
|
**/.env_template
|
||||||
*.md
|
**/*.log
|
||||||
|
**/*.md
|
||||||
src/api/uv.lock
|
src/api/uv.lock
|
||||||
|
|||||||
+6
-9
@@ -1,4 +1,4 @@
|
|||||||
FROM node:20
|
FROM node:20-alpine
|
||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
COPY src/frontend/package*.json .
|
COPY src/frontend/package*.json .
|
||||||
@@ -13,15 +13,12 @@ FROM python:3.13-slim
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY --from=nobodyxu/apt-fast:latest-debian-buster-slim /usr/local/ /usr/local/
|
RUN apt update && \
|
||||||
|
apt install -y git build-essential python3.13-dev libglib2.0-0 libpango-1.0-0 libpangoft2-1.0-0 && \
|
||||||
RUN apt update
|
apt clean && \
|
||||||
RUN apt install -y aria2
|
rm -rf /var/lib/apt/lists/*
|
||||||
RUN apt-fast install -y git build-essential python3.13-dev libgobject-2.0 libpango-1.0 libpangoft2-1.0
|
|
||||||
# aiohttp-client-cache depends on multipart, which requires python3.13-dev to build successfully on 3.13
|
# aiohttp-client-cache depends on multipart, which requires python3.13-dev to build successfully on 3.13
|
||||||
# weasyprint depends on libgoject, libpango, and libpangoft2
|
# weasyprint depends on libgoject, libpango, and libpangoft2
|
||||||
|
|
||||||
RUN rm -rf /var/lib/apt/lists/*
|
|
||||||
# https://github.com/TheOnlyWayUp/WattpadDownloader/pull/82#discussion_r2470358950
|
# https://github.com/TheOnlyWayUp/WattpadDownloader/pull/82#discussion_r2470358950
|
||||||
|
|
||||||
|
|
||||||
@@ -32,7 +29,7 @@ WORKDIR /app
|
|||||||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
|
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
|
||||||
|
|
||||||
COPY src/api/pyproject.toml /app
|
COPY src/api/pyproject.toml /app
|
||||||
RUN uv sync
|
RUN uv sync && uv cache clean
|
||||||
COPY src/api/ /app
|
COPY src/api/ /app
|
||||||
COPY --from=0 /build/build /app/src/build
|
COPY --from=0 /build/build /app/src/build
|
||||||
|
|
||||||
|
|||||||
@@ -53,5 +53,5 @@ My thanks to [aerkalov/ebooklib](https://github.com/aerkalov/ebooklib) for a fas
|
|||||||
---
|
---
|
||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<p>TheOnlyWayUp © 2026</p>
|
<p>TheOnlyWayUp © 2025</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+4
-18
@@ -174,26 +174,12 @@ async def handle_download(
|
|||||||
story_zip = await fetch_story_content_zip(story_id, cookies)
|
story_zip = await fetch_story_content_zip(story_id, cookies)
|
||||||
archive = ZipFile(story_zip, "r")
|
archive = ZipFile(story_zip, "r")
|
||||||
|
|
||||||
# Transform part metadata into an easily-indexable dictionary
|
part_trees: list[BeautifulSoup] = [
|
||||||
part_id_title_dictionary = {
|
|
||||||
str(part["id"]): part["title"] for part in metadata["parts"]
|
|
||||||
}
|
|
||||||
|
|
||||||
part_trees: list[BeautifulSoup] = []
|
|
||||||
|
|
||||||
for id in archive.namelist():
|
|
||||||
if (
|
|
||||||
id not in part_id_title_dictionary
|
|
||||||
): # If a part is deleted and the old story_zip is cached, this is needed to avoid a KeyError exception
|
|
||||||
continue
|
|
||||||
|
|
||||||
part_trees.append(
|
|
||||||
clean_tree(
|
clean_tree(
|
||||||
part_id_title_dictionary[id],
|
part["title"], part["id"], archive.read(str(part["id"])).decode("utf-8")
|
||||||
id,
|
|
||||||
archive.read(id).decode("utf-8"),
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
for part in metadata["parts"]
|
||||||
|
]
|
||||||
|
|
||||||
images = (
|
images = (
|
||||||
[await fetch_tree_images(tree) for tree in part_trees]
|
[await fetch_tree_images(tree) for tree in part_trees]
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
href="https://github.com/TheOnlyWayUp"
|
href="https://github.com/TheOnlyWayUp"
|
||||||
class="underline"
|
class="underline"
|
||||||
target="_blank">TheOnlyWayUp</a
|
target="_blank">TheOnlyWayUp</a
|
||||||
> © 2026
|
> © 2025
|
||||||
</p>
|
</p>
|
||||||
</aside>
|
</aside>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Copyright © 2026 - All rights reserved by <a
|
Copyright © 2025 - All rights reserved by <a
|
||||||
href="https://rambhat.la"
|
href="https://rambhat.la"
|
||||||
class="link"
|
class="link"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
|||||||
Reference in New Issue
Block a user