fix: detect PDF-in-epub by content instead of API format type

This commit is contained in:
^_^ 2025-12-22 20:50:21 +01:00
parent cf2bb5d7c4
commit 533536ec43
2 changed files with 3 additions and 4 deletions

View File

@ -163,8 +163,8 @@ async def download_with_progress(book: Book, progress: Progress, template: str,
# Download the book
await download_book(book, update_function, template)
# Convert PDF-in-epub to PDF if needed
if book.source_data and book.source_data.get('format_type') == 'pdf':
# Convert PDF-in-epub to PDF if needed (Nextory wraps PDFs in epub containers)
if book.source_data and book.source_data.get('source_name') == 'nextory':
from .output import format_output_location, get_default_format
from .pdf_converter import convert_pdf_epub_to_pdf, is_pdf_in_epub

View File

@ -113,7 +113,7 @@ class Nextory(Source):
async def _download_book(self, book_id: str) -> Book:
product_data = await self._get_product_data(book_id)
format_type, format_id = self._find_format(product_data)
_, format_id = self._find_format(product_data)
# Nextory serves all books via epub endpoint regardless of original format
data = await self._get_epub_data(format_id)
@ -126,7 +126,6 @@ class Nextory(Source):
),
source_data = {
"source_name": "nextory",
"format_type": format_type,
"details": product_data
}
)