Skip to content
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

License not granted to customer [xxxxxxxxxxxxxx] for asin [YYYYYYY] #118

Open
tdguchi opened this issue Sep 5, 2022 · 60 comments
Open

License not granted to customer [xxxxxxxxxxxxxx] for asin [YYYYYYY] #118

tdguchi opened this issue Sep 5, 2022 · 60 comments

Comments

@tdguchi
Copy link

tdguchi commented Sep 5, 2022

Hi, i was downloading my library (109 books) included in my suscription, (so, not bought audios)
After 150 books, more or less i was "granted" with an error "license error"

i have tried all branches, getting some more info

image

It happens with all audiobooks, if i remove that (based on asin the next audiobook gives same error.

Is there a download limit? or its another thing?

PD: i have used a plugin posted on other issue, but no info related to these asin

thanks in advance

@mkb79
Copy link
Owner

mkb79 commented Sep 5, 2022

Can you try the count-aycl-files branch with --ignore-errors flag set? This will ignore these errors and proceed with the next.

How discussed in #115 this could be items which are not released yet? Maybe it could be a rate limit too.

@mkb79
Copy link
Owner

mkb79 commented Sep 5, 2022

So you have the asin of the books? And your marketplace?

@tdguchi
Copy link
Author

tdguchi commented Sep 5, 2022

image

Im using audible.es

with --ignore-errors it ignores them, and the next one and the next... until the end of the library.

image

items not released? i dont believe it, the option of rate limit gains power.... because i can listen to that audiobook in the website

@mkb79
Copy link
Owner

mkb79 commented Sep 5, 2022

Can you give me the output of the following command audible api -p "response_groups=product_desc,media, product_attrs,relationships,series,customer_rights,pdf_url" -i 4 library/B09ZLFY5YG. I will check this.

And maybe you run the download command with debug messages audible -v debug download ...?

@tdguchi
Copy link
Author

tdguchi commented Sep 5, 2022

{
    "item": {
        "amazon_asin": null,
        "asin": "B09ZLFY5YG",
        "audible_editors_summary": null,
        "author_pages": null,
        "authors": null,
        "availability": null,
        "available_codecs": [
            {
                "enhanced_codec": "LC_64_44100_stereo",
                "format": "Enhanced",
                "is_kindle_enhanced": true,
                "name": "aax_44_64"
            },
            {
                "enhanced_codec": "format4",
                "format": "Format4",
                "is_kindle_enhanced": false,
                "name": "format4"
            },
            {
                "enhanced_codec": "LC_128_44100_stereo",
                "format": "Enhanced",
                "is_kindle_enhanced": true,
                "name": "aax_44_128"
            },
            {
                "enhanced_codec": "mp44464",
                "format": "Enhanced",
                "is_kindle_enhanced": true,
                "name": "mp4_44_64"
            },
            {
                "enhanced_codec": "mp444128",
                "format": "Enhanced",
                "is_kindle_enhanced": true,
                "name": "mp4_44_128"
            },
            {
                "enhanced_codec": "aax",
                "format": "Enhanced",
                "is_kindle_enhanced": false,
                "name": "aax"
            }
        ],
        "badge_types": null,
        "badges": null,
        "benefit_id": "AYCL",
        "buying_options": null,
        "category_ladders": null,
        "claim_code_url": null,
        "collection_ids": null,
        "content_delivery_type": "SinglePartBook",
        "content_level": null,
        "content_rating": null,
        "content_type": "Product",
        "continuity": null,
        "copyright": null,
        "credits_required": null,
        "customer_reviews": null,
        "customer_rights": {
            "is_consumable": true,
            "is_consumable_indefinitely": false,
            "is_consumable_offline": true,
            "is_consumable_until": null
        },
        "date_first_available": null,
        "distribution_rights_region": [
            "PR",
            "PS",
            "PT",
            "PW",
            "PY",
            "QA",
            "AD",
            "AE",
            "AF",
            "AG",
            "AI",
            "AL",
            "AM",
            "AO",
            "AQ",
            "AR",
            "AS",
            "AT",
            "RE",
            "AU",
            "AW",
            "AX",
            "AZ",
            "RO",
            "BA",
            "BB",
            "RS",
            "BD",
            "BE",
            "RU",
            "BF",
            "BG",
            "RW",
            "BH",
            "BI",
            "BJ",
            "BL",
            "BM",
            "BN",
            "BO",
            "SA",
            "BQ",
            "SB",
            "BR",
            "SC",
            "BS",
            "SD",
            "BT",
            "SE",
            "BV",
            "SG",
            "BW",
            "SH",
            "SI",
            "BY",
            "SJ",
            "BZ",
            "SK",
            "SL",
            "SM",
            "SN",
            "SO",
            "CA",
            "SR",
            "CC",
            "SS",
            "CD",
            "ST",
            "CF",
            "SV",
            "CG",
            "CH",
            "SX",
            "CI",
            "SZ",
            "CK",
            "CL",
            "CM",
            "CN",
            "CO",
            "CR",
            "TC",
            "TD",
            "TF",
            "CV",
            "TG",
            "CW",
            "TH",
            "CX",
            "CY",
            "TJ",
            "CZ",
            "TK",
            "TL",
            "TM",
            "TN",
            "TO",
            "TR",
            "TT",
            "DE",
            "TV",
            "TW",
            "DJ",
            "TZ",
            "DK",
            "DM",
            "DO",
            "UA",
            "UG",
            "DZ",
            "UM",
            "EC",
            "US",
            "EE",
            "EG",
            "EH",
            "UY",
            "UZ",
            "VA",
            "ER",
            "VC",
            "ES",
            "ET",
            "VE",
            "VG",
            "VI",
            "VN",
            "VU",
            "FI",
            "FJ",
            "FK",
            "FM",
            "FO",
            "FR",
            "WF",
            "GA",
            "GB",
            "WS",
            "GD",
            "GE",
            "GF",
            "GG",
            "GH",
            "GI",
            "GL",
            "GM",
            "GN",
            "GP",
            "GQ",
            "GR",
            "GS",
            "GT",
            "GU",
            "GW",
            "GY",
            "HK",
            "HM",
            "HN",
            "HR",
            "HT",
            "YE",
            "HU",
            "ID",
            "YT",
            "IE",
            "IL",
            "IM",
            "IN",
            "IO",
            "ZA",
            "IQ",
            "IS",
            "IT",
            "ZM",
            "JE",
            "ZW",
            "JM",
            "JO",
            "JP",
            "KE",
            "KG",
            "KH",
            "KI",
            "KM",
            "KN",
            "KR",
            "KW",
            "KY",
            "KZ",
            "LA",
            "LB",
            "LC",
            "LI",
            "LK",
            "LR",
            "LS",
            "LT",
            "LU",
            "LV",
            "LY",
            "MA",
            "MC",
            "MD",
            "ME",
            "MF",
            "MG",
            "MH",
            "MK",
            "ML",
            "MM",
            "MN",
            "MO",
            "MP",
            "MQ",
            "MR",
            "MS",
            "MT",
            "MU",
            "MV",
            "MW",
            "MX",
            "MY",
            "MZ",
            "NC",
            "NE",
            "NF",
            "NG",
            "NI",
            "NL",
            "NO",
            "NP",
            "NR",
            "NU",
            "NZ",
            "OM",
            "PA",
            "PE",
            "PF",
            "PG",
            "PH",
            "PK",
            "PL",
            "PM",
            "PN"
        ],
        "editorial_reviews": null,
        "episode_count": null,
        "episode_number": null,
        "episode_type": null,
        "extended_product_description": null,
        "format_type": "unabridged",
        "generic_keyword": null,
        "has_children": false,
        "image_url": null,
        "invites_remaining": null,
        "is_adult_product": false,
        "is_archived": null,
        "is_ayce": true,
        "is_buyable": true,
        "is_downloaded": null,
        "is_finished": null,
        "is_in_wishlist": null,
        "is_listenable": true,
        "is_pdf_url_available": null,
        "is_pending": false,
        "is_playable": null,
        "is_preorderable": false,
        "is_purchasability_suppressed": false,
        "is_released": null,
        "is_removable": true,
        "is_removable_by_parent": true,
        "is_returnable": true,
        "is_searchable": null,
        "is_visible": true,
        "is_world_rights": false,
        "is_ws4v_companion_asin_owned": null,
        "is_ws4v_enabled": null,
        "isbn": null,
        "issue_date": "2022-05-09",
        "language": "spanish",
        "library_status": {
            "date_added": "2022-09-04T23:38:28.000Z",
            "is_pending": false,
            "is_preordered": null,
            "is_removable": true,
            "is_visible": true
        },
        "listening_status": null,
        "member_giving_status": null,
        "merchandising_description": null,
        "merchandising_summary": "<p>Las ventas de biograf\u00edas de personajes notorios y famosos son el principal negocio de Ediciones Plutarco. Presidente, premios Nobel, actrices...</p>",
        "music_id": null,
        "narration_accent": null,
        "narrators": null,
        "new_episode_added_date": null,
        "order_id": null,
        "order_item_id": null,
        "origin_asin": null,
        "origin_id": null,
        "origin_marketplace": "ALMIKO4SZCSAR",
        "origin_type": null,
        "part_number": null,
        "participation_plans": null,
        "pdf_url": null,
        "percent_complete": null,
        "periodical_info": null,
        "plans": [
            {
                "customer_eligible": null,
                "detail_plan_names": null,
                "end_date": "2099-12-31T12:00:00.00000Z",
                "plan_name": "ES-AYCL",
                "start_date": "2022-05-04T13:35:00.00035Z"
            }
        ],
        "platinum_keywords": null,
        "preorder_release_date": null,
        "preorder_status": null,
        "price": null,
        "product_images": {
            "500": "https://m.media-amazon.com/images/I/5173w-3dn3L._SL500_.jpg"
        },
        "product_page_url": null,
        "product_site_launch_date": null,
        "program_participation": "Audible Original",
        "provided_review": null,
        "publication_datetime": "2022-05-09T00:00:00Z",
        "publication_name": null,
        "publisher_name": null,
        "publisher_summary": null,
        "purchase_date": "2022-09-04T23:38:28.000Z",
        "rating": null,
        "read_along_support": null,
        "relationships": null,
        "release_date": "2022-05-09",
        "review_status": null,
        "runtime_length_min": 77,
        "sample_url": null,
        "season_number": null,
        "series": null,
        "sku": "BK_AOES_000039ES",
        "sku_lite": "BK_AOES_000039",
        "social_media_images": {
            "facebook": "https://m.media-amazon.com/images/I/5173w-3dn3L._SL10_UR1600,800_CR200,50,1200,630_CLa%7C1200,630%7C5173w-3dn3L.jpg%7C0,0,1200,630+82,82,465,465_PJAdblSocialShare-Gradientoverlay-largeasin-0to70,TopLeft,0,0_PJAdblSocialShare-AudibleLogo-Large,TopLeft,600,270_OU01_ZBESCUCHANDO%20EN,617,216,52,500,AudibleSansMd,30,255,255,255.jpg",
            "twitter": "https://m.media-amazon.com/images/I/5173w-3dn3L._SL10_UR1600,800_CR200,50,1024,512_CLa%7C1024,512%7C5173w-3dn3L.jpg%7C0,0,1024,512+67,67,376,376_PJAdblSocialShare-Gradientoverlay-twitter-largeasin-0to60,TopLeft,0,0_PJAdblSocialShare-AudibleLogo-Medium,TopLeft,490,223_OU01_ZBESCUCHANDO%20EN,483,152,55,450,AudibleSansMd,32,255,255,255.jpg"
        },
        "status": "Active",
        "subscription_asins": null,
        "subtitle": null,
        "text_to_speech": null,
        "thesaurus_subject_keywords": [
            "audible_original",
            "literature-and-fiction"
        ],
        "title": "El Bi\u00f3grafo",
        "voice_description": "Castilian Spanish",
        "ws4v_companion_asin": null
    },
    "response_groups": [
        "relationships",
        "customer_rights",
        "product_desc",
        "always-returned",
        "origin",
        "library_status",
        "series",
        "pdf_url",
        "media",
        "product_attrs"
    ]
}

when adding -v DEBUG flag....

image

@mkb79
Copy link
Owner

mkb79 commented Sep 5, 2022

That looks inconspicuous.

Can you try audible api -m post -b '{"supported_drm_types": ["Dash", "HlsCmaf", "Hls", "Mpeg"], "quality": "High", "consumption_type": "Streaming", "response_groups": "last_position_heard, pdf_url, content_reference"}' -i 4 content/B09ZLFY5YG/licenserequest please. This makes a streaming license request. Maybe these title can only be streamed?!

@tdguchi
Copy link
Author

tdguchi commented Sep 5, 2022

{ "content_license": { "acr": "CR!EW7PW3DQPD3VH65TTDJSXA3W96F7", "asin": "B09ZLFY5YG", "content_metadata": { "content_reference": { "acr": "CR!EW7PW3DQPD3VH65TTDJSXA3W96F7", "asin": "B09ZLFY5YG", "content_format": "M4A_AAX_44", "content_size_in_bytes": 74357293, "file_version": "1", "marketplace": "ALMIKO4SZCSAR", "sku": "BK_AOES_000039", "tempo": "1.0", "version": "39908921" }, "last_position_heard": { "status": "DoesNotExist" } }, "drm_type": "Dash", "license_id": "ced49de7-ab9c-44ec-998e-0523fc009a2b", "license_response": "https://d1jobzhhm62zby.cloudfront.net/bk_aoes_000039/39908921/signed/g1/bk_aoes_000039_44,128_v8.master.mpd?ss_sec=20&iss_sec=10&isc=1&id=ced49de7-ab9c-44ec-998e-0523fc009a2b&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=MD1BAJ27VEMQ8GGY7BZB/20220905/us-east-1/cloudfront/aws4_request&X-Amz-Date=20220905T115924Z&X-Amz-Expires=60&X-Amz-SignedHeaders=host&X-Amz-Signature=75e2e7683694a9348304039694b54086833596488ffe6750c6fe487aa64c079c", "message": "Customer [A2J3RR50AFBV7G] has rights to asin [B09ZLFY5YG] for AYCL", "request_id": "0e89c8d2-c5cf-41c9-96b9-e16a8d9ecfd5_7WNBR3J8K22WE14ZBSZ8", "requires_ad_supported_playback": false, "status_code": "Granted" }, "response_groups": [ "always-returned", "last_position_heard", "pdf_url", "content_reference" ] }

@mkb79
Copy link
Owner

mkb79 commented Sep 5, 2022

Thank you. The streaming license is granted but the download license not. Maybe there are two reasons for this:

  1. There is a rate limit for downloads
  2. This item is only streamable and not downloadable.

Can you download this item via the Audible App for mobile device or PC?
I would suggest, you try it again tomorrow. If you could download it, then it’s a rate limit. Otherwise I would think it is only streamable.

@tdguchi
Copy link
Author

tdguchi commented Sep 5, 2022

I have tried to download from mobile app. it does nothing, with that audiobook, or any of the ones that I have previously download.
So... rate limit? xD

Its there anyway to bypass it (tomorrow, when limits were gone) does bunch-size avoid it?

@johnlescault
Copy link

In my experience it is a limit. If you wait 12-24 hours it should allow you to continue.

@mkb79
Copy link
Owner

mkb79 commented Sep 5, 2022

@tdguchi

Its there anyway to bypass it (tomorrow, when limits were gone) does bunch-size avoid it?

The bunch size has another meaning. At the beginning of the download command, your whole library is requested and returned from the server in JSON-format. The library of some users are very big (thousands of books)! With the bunch-size option you can set the size, how many items will returned from the server. If you have 400 items and set a bunch-size of 200, it needs two requests to get them all. If you set the size to 400, it will get them with only one request. A higher bunch size will result in network errors, if you have a slow network connection.

@johnlescault

In my experience it is a limit. If you wait 12-24 hours it should allow you to continue.

I'm thinking so too. But the response body does not indicate such a rate limit. Maybe the headers do?

@tdguchi
Can you try a plug-in script where I output the response headers?

@tdguchi
Copy link
Author

tdguchi commented Sep 5, 2022

which one plug-in?

@mkb79
Copy link
Owner

mkb79 commented Sep 5, 2022

@tdguchi

Please copy the copy below to a file in your plug-in dir and name it cmd_get-license.py and then run it with audible get-license B09ZLFY5YG

import secrets
from typing import Dict, Union

import click
import httpx
from audible.client import convert_response_content
from audible_cli.decorators import pass_client


def response_callback(resp: httpx.Response) -> Union[Dict, str]:
    return convert_response_content(resp), resp.headers


@click.command("get-license")
@click.argument("asin")
@pass_client
async def cli(client, asin):
    response_groups = "last_position_heard, pdf_url, content_reference"

    body = {
        "supported_drm_types": ["Mpeg", "Adrm"],
        "quality": "High",
        "consumption_type": "Download",
        "response_groups": response_groups
    }

    headers = {
        "X-Amzn-RequestId": secrets.token_hex(20).upper(),
        "X-ADP-SW": "37801821",
        "X-ADP-Transport": "WIFI",
        "X-ADP-LTO": "120",
        "X-Device-Type-Id": "A2CZJZGLK2JJVM",
        "device_idiom": "phone"
    }
    lr, headers = await client.post(
        f"content/{asin}/licenserequest",
        body=body,
        headers=headers,
        response_callback=response_callback
    )
    print(headers)
    content_license = lr["content_license"]

    status_code = content_license["status_code"]
    click.echo(f"License status code: {status_code}")

    if status_code == "Denied":
        if "license_denial_reasons" in content_license:
            for reason in content_license["license_denial_reasons"]:
                message = reason.get("message", "UNKNOWN")
                rejection_reason = reason.get("rejectionReason", "UNKNOWN")
                validation_type = reason.get("validationType", "UNKNOWN")
                click.echo(
                    f"License denied message for {asin}: {message}."
                    f"Reason: {rejection_reason}."
                    f"Type: {validation_type}"
                )

        msg = content_license["message"]
        raise Exception(msg)

Edit: Forgot to print out the headers. Add this now.

@tdguchi
Copy link
Author

tdguchi commented Sep 5, 2022

Headers({'content-type': 'application/json', 'content-length': '1416', 'connection': 'keep-alive', 'server': 'Server', 'date': 'Mon, 05 Sep 2022 13:11:15 GMT', 'x-amz-rid': '*********X', 'x-amzn-requestid': '******D787D', 'x-amz-date': 'Mon, 05 Sep 2022 13:11:15 GMT', 'vary': 'Content-Type,Accept-Encoding,X-Amzn-CDN-Cache,X-Amzn-AX-Treatment,User-Agent', 'strict-transport-security': 'max-age=300; includeSubDomains; preload', 'permissions-policy': 'interest-cohort=()', 'x-cache': 'Miss from cloudfront', 'via': '1.1 96067a94609f0eba55814e78a68eeb7e.cloudfront.net (CloudFront)', 'x-amz-cf-pop': 'MAD56-P3', 'x-amz-cf-id': 'b**************NHBnFjgoUPvA=='}) License status code: Denied License denied message for B09ZLFY5YG: Customer [*************] has rights to asin [B09ZLFY5YG] for AYCL.Reason: UNKNOWN.Type: AYCL License denied message for B09ZLFY5YG: Customer [*************] is not part of any plans..Reason: RequesterEligibility.Type: Membership License denied message for B09ZLFY5YG: Since ClientId is null, skipping client rights validation.AAAClientId[ApolloEnv:AudibleApiExternalRouterService/EU/Prod], does not has access to asin[B09ZLFY5YG]..Reason: RequesterEligibility.Type: Client License denied message for B09ZLFY5YG: Ownership: User [*************] does not has Ownership rights for asin [B09ZLFY5YG]..Reason: RequesterEligibility.Type: Ownership Uncaught Exception Traceback (most recent call last): File "/home/papimami/.local/lib/python3.10/site-packages/audible_cli/cli.py", line 60, in main sys.exit(cli(*args, **kwargs)) File "/usr/lib/python3/dist-packages/click/core.py", line 1128, in __call__ return self.main(*args, **kwargs) File "/usr/lib/python3/dist-packages/click/core.py", line 1053, in main rv = self.invoke(ctx) File "/usr/lib/python3/dist-packages/click/core.py", line 1659, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/lib/python3/dist-packages/click/core.py", line 1395, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/lib/python3/dist-packages/click/core.py", line 754, in invoke return __callback(*args, **kwargs) File "/usr/lib/python3/dist-packages/click/decorators.py", line 84, in new_func return ctx.invoke(f, obj, *args, **kwargs) File "/usr/lib/python3/dist-packages/click/core.py", line 754, in invoke return __callback(*args, **kwargs) File "/home/papimami/.local/lib/python3.10/site-packages/audible_cli/decorators.py", line 24, in wrapper return asyncio.run(f(*args, ** kwargs)) File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete return future.result() File "/home/papimami/.local/lib/python3.10/site-packages/audible_cli/decorators.py", line 62, in wrapper return await f(*args, client, **kwargs) File "/home/papimami/.audible/plugins/cmd_get-license.py", line 60, in cli raise Exception(msg) Exception: License not granted to customer [*************] for asin [B09ZLFY5YG]

@mkb79
Copy link
Owner

mkb79 commented Sep 5, 2022

The only really striking thing on the headers is the 'strict-transport-security': 'max-age=300; includeSubDomains; preload'. I don’t get these header in my license request response headers. I checked my protocols of the last 6 months.

@tdguchi
Copy link
Author

tdguchi commented Sep 5, 2022

So we are in a dead end? XD

Im confused, one line says "customer has rights" and the following says "denied"

Also says im not part of any plan... but i have a client ID, but, again, Since ClientId is null, skipping client rights

edit: the Header diferences could caused because im on "demo" period?

@mkb79
Copy link
Owner

mkb79 commented Sep 5, 2022

You have the rights. Otherwise you don’t get a license for streaming, we've tested out. I'll test some things and will report back later.

Maybe in the meantime you could write to Audible, why you don’t can download items via the official app ;)!

@tdguchi
Copy link
Author

tdguchi commented Sep 5, 2022

I have asked them, 24h reply ....

maybe its answer could be... "you moron stop downloading our books" xD

@mkb79
Copy link
Owner

mkb79 commented Sep 5, 2022

That's great. Thank you. Unfortunately, I'm not going any further yet. This is the problem if the API is not public.

@tdguchi
Copy link
Author

tdguchi commented Sep 5, 2022

well, even if i only can download 150 audio books a day, its not a big deal, i have 20 days , i could download.. 3000 books xD

@mkb79
Copy link
Owner

mkb79 commented Sep 5, 2022

You can test it out, if you can tomorrow download this amount of items or if they downgrade it for "heavy" users ;)!

@tdguchi
Copy link
Author

tdguchi commented Sep 5, 2022

Hmm, i could download covers, and chapters.json so the problem is with aaxc only.

all goes to a max download limit reached.

@mkb79
Copy link
Owner

mkb79 commented Sep 5, 2022

Yeah,only a license request (aaxc files) for AYCL books should be affected by this. Have you one credit left? If so, you can try out and buy a book with these token and try to download it.

@tdguchi
Copy link
Author

tdguchi commented Sep 5, 2022

Credits? i dont know what that is... i have suscribed via amazon login, i have been navigating, and nothing about credits its mentioned...

edit: amazon.es -> audible.es

@mkb79
Copy link
Owner

mkb79 commented Sep 5, 2022

I does not know if you get a monthly credit for free? I've got those in my Abo.

@tdguchi
Copy link
Author

tdguchi commented Sep 5, 2022

audible.es does not have anything about credits, if I login in audible.com yes a credit menu its shown, but, im not member there.
I could start a 0.00 30 days period, but, i will wait until audible.es 30 days period ends.

cheking api response, i have this:

"execution_times": 1, "index": 1, "metadata": { "alternative_description": "<p>Suscripci\u00f3n mensual.</p>\n", "alternative_name": "Gold Monthly", "barker_name": "Gold Member - Monthly", "base_plan_sku": "B07VKB274C", "benefits": [], "business_model": "Premium", "business_submodel": "Discovery", "contract_name": "GoldMonthlyFullPrice", "credit_bankable_limit": 0, "credit_revenue": 0.0, "description": "<b>AudibleListener&#174; Gold Membership - Monthly:</b> EUR 9.99 a month.", "display_switch_asins": [], "grace_period": { "number_of_intervals": 63, "time_interval": "Day"
"metadata": { "alternative_description": "<p>Prueba gratuita.</p>\n", "alternative_name": "Prueba gratuita", "barker_name": "Prueba gratuita", "base_plan_sku": "B07VKB274C", "benefits": [], "business_model": "Premium", "business_submodel": "Discovery", "contract_name": "GoldMonthly1MFreeTrial", "credit_bankable_limit": 0, "credit_revenue": 0.0, "description": "<p>Prueba gratuita</p>\n", "display_switch_asins": [], "grace_period": { "number_of_intervals": 63, "time_interval": "Day" }, "is_auto_renew_enabled": true, "is_buyable": true, "is_credit_alert_email_enabled": false, "is_eligible_for_glg": false, "is_eligible_for_hiatus": true, "is_searchable": false, "is_vet_required": true, "is_wallet_cycling_enabled": true, "name": "Prueba gratuita", "offer_type": "FreeTrial", "plan_group_type": "Discovery", "plan_id": "B07VJJ67K3", "program_type": "Default", "soft_decline_times_to_try": 6, "soft_decline_wait_to_try_period": { "number_of_intervals": 4, "time_interval": "Day" }, "tax_price_type": "InclusiveFixedPrice" }, "renewal_policy": "no_renew"

So, saomething called gold membership, where i have a "free period"

@mkb79
Copy link
Owner

mkb79 commented Sep 5, 2022

Too bad. Otherwise, you could have bought a title with the credit and then tested the download.

@tdguchi
Copy link
Author

tdguchi commented Sep 6, 2022

after 24h, im abe to download again, so..
DIN DIN DIN we got download limit xD
Also, audible has answered, nothing special, they think i dont know how to press download button and send me iinstructions to navigate inside de app..... xDDD

I will report back when the limit shows again to tell the number of books.

@tdguchi
Copy link
Author

tdguchi commented Sep 6, 2022

Hmm iis there any command to clean all library at once?

Also, how can i add a book to library using audible cli and asin?

(im not good using apis)

@mkb79
Copy link
Owner

mkb79 commented Sep 6, 2022

Also, how can i add a book to library using audible cli and asin?

There is no command for this yet. But you can use the API with audible api -m put -b '{"asin": "ASIN_TO_ADD"}' -i 4 library/item

Hmm iis there any command to clean all library at once?

Do you mean remove all? Then no, there is not such command yet. But can be implemented.

@mkb79
Copy link
Owner

mkb79 commented Sep 6, 2022

In the meantime you can you the Amazon website. Go to content and devices or so (in germany it’s named "Inhalte und Geräte“)! There you can delete multiple items at once.

@johnlescault
Copy link

Hmm iis there any command to clean all library at once?

Also, how can i add a book to library using audible cli and asin?

(im not good using apis)

This is not an eligant fix, but use tampermonkey with this script. Just need to enable it and open your library and it will start to remove books by simulating the button click.

// ==UserScript==
// @name         Audible Auto Remove from Library
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://www.audible.ca/library/*
// @icon         https://www.google.com/s2/favicons?domain=audible.ca
// @require  http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js

// @grant    GM_addStyle
// ==/UserScript==

(function() {
    'use strict';
    let first = true;
console.log("Started!");
    var my_tag = document.getElementsByClassName("bc-button-text");
    var count = my_tag.length;
    var TargetLink = $("a:contains('Go forward a page')")



    setTimeout(() => {  console.log("Execute first check"); waitForKeyElements ("button:contains('Remove')", clickSubmitBtnWhenItAppears, false); }, 3000);
    if (TargetLink.length)
    {
        setTimeout(() => {  location.reload(); }, 30000);
    }

    console.log("End!");

    function clickSubmitBtnWhenItAppears (jNode) {
        console.log("CLICK!!!!!!!!!");
        var clickEvent = document.createEvent ('MouseEvents');
        clickEvent.initEvent ('click', true, true);
        jNode[0].dispatchEvent (clickEvent);

    }

})();
/*--- waitForKeyElements():  A utility function, for Greasemonkey scripts,
    that detects and handles AJAXed content.

    Usage example:

        waitForKeyElements (
            "div.comments"
            , commentCallbackFunction
        );

        //--- Page-specific function to do what we want when the node is found.
        function commentCallbackFunction (jNode) {
            jNode.text ("This comment changed by waitForKeyElements().");
        }

    IMPORTANT: This function requires your script to have loaded jQuery.
*/
function waitForKeyElements (
    selectorTxt,    /* Required: The jQuery selector string that
                        specifies the desired element(s).
                    */
    actionFunction, /* Required: The code to run when elements are
                        found. It is passed a jNode to the matched
                        element.
                    */
    bWaitOnce,      /* Optional: If false, will continue to scan for
                        new elements even after the first match is
                        found.
                    */
    iframeSelector  /* Optional: If set, identifies the iframe to
                        search.
                    */
) {
    var targetNodes, btargetsFound;

    if (typeof iframeSelector == "undefined")
        targetNodes     = $(selectorTxt);
    else
        targetNodes     = $(iframeSelector).contents ()
                                           .find (selectorTxt);

    if (targetNodes  &&  targetNodes.length > 0) {
        btargetsFound   = true;
        /*--- Found target node(s).  Go through each and act if they
            are new.
        */
        targetNodes.each ( function () {
            var jThis        = $(this);
            var alreadyFound = jThis.data ('alreadyFound')  ||  false;

            if (!alreadyFound) {
                //--- Call the payload function.
                var cancelFound     = actionFunction (jThis);
                if (cancelFound)
                    btargetsFound   = false;
                else
                    jThis.data ('alreadyFound', true);
            }
        } );
    }
    else {
        btargetsFound   = false;
    }

    //--- Get the timer-control variable for this selector.
    var controlObj      = waitForKeyElements.controlObj  ||  {};
    var controlKey      = selectorTxt.replace (/[^\w]/g, "_");
    var timeControl     = controlObj [controlKey];

    //--- Now set or clear the timer as appropriate.
    if (btargetsFound  &&  bWaitOnce  &&  timeControl) {
        //--- The only condition where we need to clear the timer.
        clearInterval (timeControl);
        delete controlObj [controlKey]
    }
    else {
        //--- Set a timer, if needed.
        if ( ! timeControl) {
            timeControl = setInterval ( function () {
                    waitForKeyElements (    selectorTxt,
                                            actionFunction,
                                            bWaitOnce,
                                            iframeSelector
                                        );
                },
                2000
            );
            controlObj [controlKey] = timeControl;
        }
    }
    waitForKeyElements.controlObj   = controlObj;
}

@mkb79
Copy link
Owner

mkb79 commented Sep 6, 2022

@tdguchi

I will report back when the limit shows again to tell the number of books.

How many books you could download today? And how many of them are AYCL files?

@tdguchi
Copy link
Author

tdguchi commented Sep 6, 2022

Sorry, i have a complicated day, need to stay with my father at hospital, now we are at home, tomorrow i will check

@mkb79
Copy link
Owner

mkb79 commented Sep 6, 2022

Oh, my goodness. I understand that. Private affairs are definitely a priority. So take it easy and I hope things going right as fast as possible.

@tdguchi
Copy link
Author

tdguchi commented Sep 6, 2022

yeah thanks, nothing severe, my mom died of cancer a month ago, my father is having a bad time (well all of us... but my father... well, was his wife... sure you know what i mean)

@mkb79
Copy link
Owner

mkb79 commented Sep 6, 2022

Yeah, know what you mean. My sincere condolences for the loss. Some things suddenly become absolutely irrelevant.

@tdguchi
Copy link
Author

tdguchi commented Sep 7, 2022

:)

well, lets going...

image

image

But, i have downloaded some yesterday in the morning, so, 58 now, 47 then, 105 books downloaded, 50 less than the first day.

I think that it has nothing with the number of vouchers downloaded (my suscription is AYCL, so i can only listen to them) but in the first image, i see something like a limit in mb to be downloaded.or maybe im only very tired xD

As yesterday, covers and chapters files downloaded when --ignore-errors flag is used. for aaxc, a "license not granted" error shows.

@mkb79
Copy link
Owner

mkb79 commented Sep 7, 2022

Reading this Audible help page there should be no limit for listen or download AYCL titles.

@tdguchi
Copy link
Author

tdguchi commented Sep 7, 2022

Yeah, and thats ok, i can stream any book, even when using audible cli i got the not granted error.

So, maybe there is no limit to "stream" but if exists to "download"

image

10 hours later, I could download some more books (yeah, i manage to scrape the website search pages, and add a lot of books via api)

@mkb79
Copy link
Owner

mkb79 commented Sep 7, 2022

They wrote on the help page No. Audible Plus and Audible Premium Plus members can listen all they want to the Plus Catalog. You can stream or download any title in the catalog.!

So downloads should don't have any rate limits.

@tdguchi
Copy link
Author

tdguchi commented Sep 7, 2022

they say "any title" not "any number"

I mean, is different limit the catalog to a total of for example 80% of full catalog, and a limit in stream or download per time period.

They say I have full access to all books, "you can stream or download any title in the catalog" but they dont say "you can download or stream all what you want"

If that second limit didnt exists, i could simply generate all asin combinations, add all catalog to my library, and with a really good connection, download all audible audiobooks in the free 30 day period.

@mkb79
Copy link
Owner

mkb79 commented Sep 7, 2022

Unfortunately, the text is not clear in this regard. But Audible (Amazon) has nothing to give away. They have to pay license fees and the infrastructure (servers and employees) also costs money. I could therefore fully understand a rate limit.

@tdguchi
Copy link
Author

tdguchi commented Sep 7, 2022

debug: License denied message for B09QMKWZHS: Customer is not part of any plans.Reason: RequesterEligibility.Type: Membership
debug: License denied message for B09QMKWZHS: Ownership: No Ownership information returned by DAOQS for customer [A2J3RR50AFBV7G] and for asin [B09QMKWZHS]..Reason: RequesterEligibility.Type: Ownership
debug: License denied message for B09QMKWZHS: ApolloEnv:AudibleApiExternalRouterService/EU/Prod[AAA], does not has access to asin[B09QMKWZHS].ApolloEnv:AudibleApiExternalRouterService/EU/Prod[LWA], does not has access to asin[B09QMKWZHS]..Reason: RequesterEligibility.Type: Client
debug: License denied message for B09QMKWZHS: Access Expiry Date missing.Reason: InternalError.Type: AYCL

New message, now something related to expiry date.

Now when trying to stream something from the library it says

¡Enhorabuena por tu compra!
Tu título se está procesando y pronto estará disponible para escuchar. Por favor, vuelve a cargar la página.

In english... the title is processing and soon will be there to be listen, please refresh page

Thats new, maybe im banned... who knows, I must wait xD

@mkb79
Copy link
Owner

mkb79 commented Sep 7, 2022

In english... the title is processing and soon will be there to be listen, please refresh page

That is new to me too. Do you have the streaming issue for all AYCL audiobooks?

@tdguchi
Copy link
Author

tdguchi commented Sep 7, 2022

I have tried some, all with same results...

@tdguchi
Copy link
Author

tdguchi commented Sep 8, 2022

I have contacted audible, more than 24h later, i cant download or stream anything.

@mkb79
Copy link
Owner

mkb79 commented Sep 8, 2022

But that's very unusual. Normally, the rate limit was over after 24 hours.

@mkb79
Copy link
Owner

mkb79 commented Sep 8, 2022

Maybe they had to react now, as OpenAudible also supports downloading AYCL titles in its beta.

@tdguchi
Copy link
Author

tdguchi commented Sep 8, 2022

Maybe if you reach the limit 2 o 3 consecutive days, they ban you for 48h or a week.. and if you insist, banned xD

i will wait the answer from audible.

@tdguchi
Copy link
Author

tdguchi commented Sep 8, 2022

I have downloaded openaudible beta...


{
 "date": "Thu Sep 08 16:07:00 CEST 2022",
 "reason": "OK",
 "code": 200,
 "resp": {
  "content_license": {
   "acr": "CR!XNFN4HJZZX5DX9EVWYHD4XPW6WX1",
   "status_code": "Denied",
   "drm_type": "Adrm",
   "license_denial_reasons": [
    {
     "validationType": "Membership",
     "message": "Customer is not part of any plans",
     "rejectionReason": "RequesterEligibility"
    },
    {
     "validationType": "Ownership",
     "message": "Ownership: No Ownership information returned by DAOQS for customer [A2J**********] and for asin [B08B1SP258].",
     "rejectionReason": "RequesterEligibility"
    },
    {
     "validationType": "Client",
     "message": "ApolloEnv:AudibleApiExternalRouterService/EU/OneBox/Prod[AAA], does not has access to asin[B08B1SP258].ApolloEnv:AudibleApiExternalRouterService/EU/OneBox/Prod[LWA], does not has access to asin[B08B1SP258].",
     "rejectionReason": "RequesterEligibility"
    },
    {
     "validationType": "AYCL",
     "message": "Access Expiry Date missing",
     "rejectionReason": "InternalError"
    }
   ],

Almost same errors given by audible-cli no?

@tdguchi
Copy link
Author

tdguchi commented Sep 8, 2022

Also i ran this; audible api -m post -b '{"supported_drm_types": ["Dash", "HlsCmaf", "Hls", "Mpeg"], "quality": "High", "consumption_type": "Streaming", "response_groups": "last_position_heard, pdf_url, content_reference"}' -i 4 content/B09ZLFY5YG/licenserequest

{
    "content_license": {
        "acr": "CR!EW7PW3DQPD3VH65TTDJSXA3W96F7",
        "asin": "B09ZLFY5YG",
        "content_metadata": {
            "content_reference": {
                "acr": "CR!EW7PW3DQPD3VH65TTDJSXA3W96F7",
                "asin": "B09ZLFY5YG",
                "content_format": "M4A_AAX_44",
                "content_size_in_bytes": 74357293,
                "file_version": "1",
                "marketplace": "ALMIKO4SZCSAR",
                "sku": "BK_AOES_000039",
                "tempo": "1.0",
                "version": "39908921"
            },
            "last_position_heard": {
                "status": "DoesNotExist"
            }
        },
        "drm_type": "Dash",
        "license_denial_reasons": [
            {
                "message": "Customer is not part of any plans",
                "rejectionReason": "RequesterEligibility",
                "validationType": "Membership"
            },
            {
                "message": "Ownership: No Ownership information returned by DAOQS for customer [A2J*********] and for asin [B09ZLFY5YG].",
                "rejectionReason": "RequesterEligibility",
                "validationType": "Ownership"
            },
            {
                "message": "ApolloEnv:AudibleApiExternalRouterService/EU/Prod[AAA], does not has access to asin[B09ZLFY5YG].ApolloEnv:AudibleApiExternalRouterService/EU/Prod[LWA], does not has access to asin[B09ZLFY5YG].",
                "rejectionReason": "RequesterEligibility",
                "validationType": "Client"
            },
            {
                "message": "Access Expiry Date missing",
                "rejectionReason": "InternalError",
                "validationType": "AYCL"
            }
        ],
        "message": "License not granted to customer [A2J3RR*******] for asin [B09ZLFY5YG]",
        "request_id": "e72bcc25-22ab-490f-8f1b-6cbe4ab45f89_1TACE2E2NSHGHA094SN2",
        "requires_ad_supported_playback": false,
        "status_code": "Denied"
    },
    "response_groups": [
        "always-returned",
        "last_position_heard",
        "pdf_url",
        "content_reference"
    ]
}

also have a denial when trying to get a streaming license via api

@tdguchi
Copy link
Author

tdguchi commented Sep 9, 2022

Im still unable to stream or download, more than 48 hours.

Audible its not answering yet

@mkb79
Copy link
Owner

mkb79 commented Sep 9, 2022

Oh, that are bad news. They will send you a message soo, hopefully!

@tdguchi
Copy link
Author

tdguchi commented Sep 11, 2022

Finally i can download and stream again..... im 100% sure that it was a limit rate.

but it only let me download a few books, only 20-30.... now i get again the "license not granted" error

@mkb79
Copy link
Owner

mkb79 commented Sep 11, 2022

Damn... Do you have received any answer from Audible?

@tdguchi
Copy link
Author

tdguchi commented Sep 11, 2022

Nothing....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants