-
-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Downloading issue #110
Comments
The AudibleAPI does not allow |
FYI: |
That worked perfectly! Thanks for the ridiculous quick reply! |
Hi, not sure if this is the same issue so I re-opened this ticket. These are for books in the Plus Catelog. I am getting the following errors:
|
That’s not the same issue. The error message indicates, that you don’t have permission to download these books. |
Sorry for my ignorance, but is it just copying the following files: cmd_get-annotations.py in the app direction? (in my case linux ~/.audible/plugins)? |
Yes. But instead of copying these files, I would give you a prepared download command file. |
Ok sure we can do that for sure then. What link do I download the file from? |
During the day (UTC+02:00), I will put the source code in this thread |
@johnlescault Edit: |
Please copy the content below to import json
import click
from audible.aescipher import decrypt_voucher_from_licenserequest
from audible_cli.decorators import (
bunch_size_option,
timeout_option,
pass_client,
pass_session
)
from audible_cli.models import Library
CLIENT_HEADERS = {
"User-Agent": "Audible/671 CFNetwork/1240.0.4 Darwin/20.6.0"
}
@click.command("test-license")
@timeout_option
@bunch_size_option
@pass_session
@pass_client(headers=CLIENT_HEADERS)
async def cli(session, api_client):
"""test license #110"""
bunch_size = session.params.get("bunch_size")
library = await Library.from_api_full_sync(
api_client,
image_sizes="1215, 408, 360, 882, 315, 570, 252, 558, 900, 500",
bunch_size=bunch_size
)
titles = (
"Play Time for Puppy Hello Genius",
"No snow for Christmas",
"Tuckerbean on the Moon",
"Mouse Says Sorry Hello Genius",
"I want to be a crocodile"
)
for title in titles:
click.echo(50 * "*")
click.echo(f"Current title: {title}")
match = library.search_item_by_title(title)
full_match = [i for i in match if i[1] == 100]
search_match = full_match if full_match else match
# selecting first match only
try:
item = search_match[0][0]
except IndexError:
click.echo("Could not find these item in library")
continue
click.echo(f"Matched title: {item.full_title}")
click.echo(f"title asin: {item.asin}")
body = {
"supported_drm_types": ["Mpeg", "Adrm"],
"quality": "High",
"consumption_type": "Download",
"response_groups": "content_reference"
}
click.echo("Requesting license")
license_response = await api_client.post(
f"content/{item.asin}/licenserequest",
body=body,
response_callback=lambda x: x
)
status_code = license_response.status_code
click.echo(f"License response status code: {status_code}")
try:
response_data = license_response.json()
except json.JSONDecodeError:
response_data = license_response.text
else:
try:
voucher = decrypt_voucher_from_licenserequest(
api_client.auth, response_data
)
except:
pass
else:
response_data["content_license"]["license_response"] = voucher
if isinstance(response_data, dict):
response_data = json.dumps(response_data, indent=4)
click.echo("Got the following response data:")
click.echo(response_data) |
That's really strange. The license for the book is granted. But it seams that the downloads are failing. |
I've one idea. Can you run the command with |
@johnlescault |
Adding --jobs to test-licence gave the following error:
I also added it to my normal "audible -v error download --all --aaxc --cover --cover-size 1215 --chapter --pdf --jobs 1 --bunch-size 200 --ignore-errors" and received the same results with the errors. |
This seems to be different than issue: #103
I am getting error:
Bad Request (400): 1 validation error detected: Value 'Extreme' at 'quality' failed to satisfy constraint: Member must satisfy enum value set: [High, Normal]
However when using the Android Audible App I am still able to download the book.
Is there a new limit being imposed by Audible per device? (audible-cli being one device and my android being a different with different limit)
Just curious if anyone else has had this happen?
Edit: The only file I am able to download is the jpg cover file - all other files give that error.
The text was updated successfully, but these errors were encountered: