Skip to content

Commit

Permalink
fix: temp file wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
yihong0618 committed Sep 12, 2023
1 parent 999c9c8 commit 5a7cbca
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions book_maker/loader/epub_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
from copy import copy
from pathlib import Path

from bs4 import BeautifulSoup as bs, Tag
from bs4 import BeautifulSoup as bs
from bs4 import Tag
from bs4.element import NavigableString
from ebooklib import ITEM_DOCUMENT, epub
from rich import print
Expand All @@ -14,7 +15,7 @@
from book_maker.utils import num_tokens_from_text, prompt_config_to_kwargs

from .base_loader import BaseBookLoader
from .helper import EPUBBookLoaderHelper, not_trans, is_text_link
from .helper import EPUBBookLoaderHelper, is_text_link, not_trans


class EPUBBookLoader(BaseBookLoader):
Expand Down Expand Up @@ -478,14 +479,7 @@ def _save_temp_book(self):
index = 0
try:
for item in origin_book_temp.get_items():
if (
item.get_type() == ITEM_DOCUMENT
and (item.file_name not in self.exclude_filelist.split(","))
and (
item.file_name in self.only_filelist.split(",")
or self.only_filelist != ""
)
):
if item.get_type() == ITEM_DOCUMENT:
soup = bs(item.content, "html.parser")
p_list = soup.findAll(trans_taglist)
if self.allow_navigable_strings:
Expand Down

0 comments on commit 5a7cbca

Please sign in to comment.