We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5e2024b + b74e149 commit 8967938Copy full SHA for 8967938
safaribooks.py
@@ -1116,6 +1116,16 @@ def process_arguments(arguments):
1116
if parsed_args.no_cookies:
1117
arguments.error("invalid option: `--no-cookies` is valid only if you use the `--cred` option")
1118
1119
+ if len(parsed_args.bookid) > 0:
1120
+ bookID = parsed_args.bookid.split("/")[-1] # Only get book ID from URL
1121
+ print(f"bookID: {bookID}")
1122
+ if str.isdecimal(bookID):
1123
+ parsed_args.bookid = bookID
1124
+ else:
1125
+ arguments.error("Invalid book ID")
1126
1127
+ arguments.error("Book ID must not be empty")
1128
+
1129
if parsed_args.proxy:
1130
proxy_regex = r"http[s]?://[a-zA-Z0-9.-]+:\d{4}" # Matches proxy URL
1131
pattern = re.compile(proxy_regex)
0 commit comments