mirror of
https://github.com/yihong0618/Kindle_download_helper.git
synced 2025-11-22 07:59:04 +08:00
fix: origin maybe list?
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
This commit is contained in:
@@ -227,8 +227,12 @@ class NoKindle:
|
||||
@staticmethod
|
||||
def _is_ebook(book_info):
|
||||
# https://github.com/yihong0618/Kindle_download_helper/issues/149#issuecomment-1805966855
|
||||
# TODO maybe refactor
|
||||
if not isinstance(book_info.get("origins"), dict):
|
||||
return False
|
||||
# https://github.com/yihong0618/Kindle_download_helper/issues/149#issuecomment-1806748160
|
||||
if not isinstance(book_info.get("origins", {}).get("origin"), dict):
|
||||
return False
|
||||
return (
|
||||
book_info.get("origins", {}).get("origin", {}).get("type", "") == "Purchase"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user