Skip to content

Commit

Permalink
Finally I add Amazon prime title get
Browse files Browse the repository at this point in the history
- ok 5 hour
  • Loading branch information
NyaShinn1204 committed Dec 28, 2024
1 parent 97a327c commit ba32814
Show file tree
Hide file tree
Showing 2 changed files with 298 additions and 67 deletions.
13 changes: 7 additions & 6 deletions ext/amazon.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def main_command(session, url, email, password, LOG_LEVEL, quality, vrange):
profile = "default"
vcodec = "H265" # default
bitrate = "CBR" # default
single = False # Force single episode/season instead of getting series ASIN,
vrange = vrange
vquality = None
device_id = None
Expand Down Expand Up @@ -181,12 +182,12 @@ class Types(Enum):
logger.debug(f"Device_token: {device_token}", extra={"service_name": "Amazon"})
#logger.error("Failed to get Title Metadata, Episode Type Data | Reason: Authorization is invalid", extra={"service_name": "Amazon"})

status, meta_response = amazon_downloader.get_titles(session)
if status == False:
logger.error("Failed to Get Series Json", extra={"service_name": "Amazon"})
exit(1)
else:
title_name = meta_response["titleName"]
meta_response = amazon_downloader.get_titles(session, title, single, vcodec, bitrate, vquality)
#title_name = meta_response["titleName"]
logger.info("Get Title for Season", extra={"service_name": "Amazon"})
for title in meta_response:
if title["type"] == "TV":
logger.info(" + {tv_title}_S{season:02}{episode_name}".format(tv_title=title["name"],season=title["season"] or 0, episode=title["episode"] or 0, episode_name=f" - {title["episode_name"]}" if title["episode_name"] else ""), extra={"service_name": "Amazon"})

except Exception as error:
import traceback
Expand Down
Loading

0 comments on commit ba32814

Please sign in to comment.