Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0e106e6da6 | |||
| 68eb4a22b7 |
@@ -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 © 2025</p>
|
<p>TheOnlyWayUp © 2026</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+19
-5
@@ -174,12 +174,26 @@ 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")
|
||||||
|
|
||||||
part_trees: list[BeautifulSoup] = [
|
# Transform part metadata into an easily-indexable dictionary
|
||||||
clean_tree(
|
part_id_title_dictionary = {
|
||||||
part["title"], part["id"], archive.read(str(part["id"])).decode("utf-8")
|
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(
|
||||||
|
part_id_title_dictionary[id],
|
||||||
|
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
|
||||||
> © 2025
|
> © 2026
|
||||||
</p>
|
</p>
|
||||||
</aside>
|
</aside>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Copyright © 2025 - All rights reserved by <a
|
Copyright © 2026 - 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