mkb79 / audible-cli

A command line interface for audible package. With the cli you can download your Audible books, cover, chapter files.
GNU Affero General Public License v3.0
452 stars 46 forks source link

Able to download but not export library #115

Closed johnlescault closed 2 years ago

johnlescault commented 2 years ago

Hi, I can download the books successfully, but when I try to export the library as csv I get the following:

$ audible library export
Uncaught Exception
Traceback (most recent call last):
  File "/home/joey/.local/lib/python3.8/site-packages/audible_cli/cli.py", line 69, in main
    sys.exit(cli(*args, **kwargs))
  File "/home/joey/.local/lib/python3.8/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/home/joey/.local/lib/python3.8/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/home/joey/.local/lib/python3.8/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/joey/.local/lib/python3.8/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/joey/.local/lib/python3.8/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/joey/.local/lib/python3.8/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/home/joey/.local/lib/python3.8/site-packages/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/home/joey/.local/lib/python3.8/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/home/joey/.local/lib/python3.8/site-packages/audible_cli/cmds/cmd_library.py", line 186, in export_library
    loop.run_until_complete(_export_library(session.auth, **params))
  File "/home/joey/.local/lib/python3.8/site-packages/audible_cli/config.py", line 216, in auth
    self._set_auth()
  File "/home/joey/.local/lib/python3.8/site-packages/audible_cli/config.py", line 197, in _set_auth
    self._auth = Authenticator.from_file(
  File "/home/joey/.local/lib/python3.8/site-packages/audible/auth.py", line 316, in from_file
    auth._update_attrs(**json_data)
  File "/home/joey/.local/lib/python3.8/site-packages/audible/auth.py", line 254, in _update_attrs
    setattr(self, attr, value)
  File "/home/joey/.local/lib/python3.8/site-packages/audible/auth.py", line 235, in __setattr__
    raise AttributeError(msg)
AttributeError: Authenticator is frozen, can't add attribute: with_username.
mkb79 commented 2 years ago

It seams you version of Audible is outdated. Which you have installed?

johnlescault commented 2 years ago

You're right. My downloading script automaticly sets the virtual environment. My library export script never had that built in. Sorry to bother you! Entirely my fault. It is currently not downloading certain columns but I am also getting the "license_response" when downloading right now which I believe is a daily limit so that could be why, if this issue persists I will open a new ticket. Thanks again for all the work you did on this tool - it has become something I use all time time to sync my library!

mkb79 commented 2 years ago

Thanks again for all the work you did on this tool - it has become something I use all time time to sync my library!

No problem at all. I am pleased to hear that my project is of use. But sometimes I lack a good idea of what else can be improved.

It is currently not downloading certain columns

What columns would not be exported?

johnlescault commented 2 years ago

library (copy).txt

Rename the file to tsv, had to rename it to txt to upload it.

Like I said, I am currently "timed out" so to speak by getting the "license_response" error when trying to download so I'm not sure if that is the cause, but you will see that it got all the asin numbers but not all the titles. If you sort by "date_added" it seems like there was a period where it just stopped getting the info (and then starts again towards the end)

These are 99.999% audible plus catelog if that matters. I think only the newest 6 are not.

I think these "license_response" errors seem to end after 24hours-ish, so I will report if you'd like on what it does tomorrow.

And honestly - not much can be improved. It's a great tool that does what it is supposed to!

mkb79 commented 2 years ago

The export function should be independent from any rate limit. Can you try to export the list in json format. I've an idea what is going wrong.

johnlescault commented 2 years ago

library.txt

Again, please rename to json

mkb79 commented 2 years ago

Can you run the following command and check, if there is a title and subtitle?!

audible api -m GET -p "response_groups=contributors,media,price,product_attrs,product_desc,product_extended_attrs,product_plan_details,product_plans,rating,sample,sku,series,reviews,ws4v,origin,relationships,review_attrs,categories,badge_types,category_ladders,claim_code_url,is_downloaded,is_finished,is_returnable,origin_asin,pdf_url,percent_complete, provided_review" -i 4 library/B09G7D69CX

if there is no title or subtitle can you try to set a specific marketplace like -c ca, -c us, etc.

audible api -m GET -p "response_groups=contributors,media,price,product_attrs,product_desc,product_extended_attrs,product_plan_details,product_plans,rating,sample,sku,series,reviews,ws4v,origin,relationships,review_attrs,categories,badge_types,category_ladders,claim_code_url,is_downloaded,is_finished,is_returnable,origin_asin,pdf_url,percent_complete, provided_review" -i 4 -c ca library/B09G7D69CX

My suggestion is that the asin does not response correctly for your marketplace.

johnlescault commented 2 years ago

I am located in the ca marketplace. Both commands output the exact same. It did include the title in this extract.

$ audible api -m GET -p "response_groups=contributors,media,price,product_attrs,product_desc,product_extended_attrs,product_plan_details,product_plans,rating,sample,sku,series,reviews,ws4v,origin,relationships,review_attrs,categories,badge_types,category_ladders,claim_code_url,is_downloaded,is_finished,is_returnable,origin_asin,pdf_url,percent_complete, provided_review" -i 4 -c ca library/B09G7D69CX
{
    "item": {
        "amazon_asin": null,
        "asin": "B09G7D69CX",
        "audible_editors_summary": null,
        "author_pages": null,
        "authors": [
            {
                "asin": "B08CDZ8KPP",
                "name": "Jeneva Rose"
            }
        ],
        "availability": null,
        "available_codecs": [
            {
                "enhanced_codec": "format4",
                "format": "Format4",
                "is_kindle_enhanced": false,
                "name": "format4"
            },
            {
                "enhanced_codec": "LC_64_44100_stereo",
                "format": "Enhanced",
                "is_kindle_enhanced": true,
                "name": "aax_44_64"
            },
            {
                "enhanced_codec": "LC_128_44100_stereo",
                "format": "Enhanced",
                "is_kindle_enhanced": true,
                "name": "aax_44_128"
            },
            {
                "enhanced_codec": "LC_64_22050_stereo",
                "format": "Enhanced",
                "is_kindle_enhanced": true,
                "name": "aax_22_64"
            },
            {
                "enhanced_codec": "LC_32_22050_stereo",
                "format": "Enhanced",
                "is_kindle_enhanced": true,
                "name": "aax_22_32"
            },
            {
                "enhanced_codec": "mp42264",
                "format": "Enhanced",
                "is_kindle_enhanced": true,
                "name": "mp4_22_64"
            },
            {
                "enhanced_codec": "mp42232",
                "format": "Enhanced",
                "is_kindle_enhanced": true,
                "name": "mp4_22_32"
            },
            {
                "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": [
            {
                "date_product_available_in_category": null,
                "ladder": [
                    {
                        "category_presentation": null,
                        "children": null,
                        "default_offline_storage_days_count": null,
                        "default_offline_storage_item_count": null,
                        "description": null,
                        "header": null,
                        "id": "21073372011",
                        "images": null,
                        "initial_download_days_count": null,
                        "initial_download_item_count": null,
                        "is_new": null,
                        "localized_name": null,
                        "name": "Mystery, Thriller & Suspense",
                        "products": null,
                        "promote_upsell": null,
                        "suppress_download_option": null,
                        "suppress_release_date": null
                    },
                    {
                        "category_presentation": null,
                        "children": null,
                        "default_offline_storage_days_count": null,
                        "default_offline_storage_item_count": null,
                        "description": null,
                        "header": null,
                        "id": "21073402011",
                        "images": null,
                        "initial_download_days_count": null,
                        "initial_download_item_count": null,
                        "is_new": null,
                        "localized_name": null,
                        "name": "Thriller & Suspense",
                        "products": null,
                        "promote_upsell": null,
                        "suppress_download_option": null,
                        "suppress_release_date": null
                    },
                    {
                        "category_presentation": null,
                        "children": null,
                        "default_offline_storage_days_count": null,
                        "default_offline_storage_item_count": null,
                        "description": null,
                        "header": null,
                        "id": "21073654011",
                        "images": null,
                        "initial_download_days_count": null,
                        "initial_download_item_count": null,
                        "is_new": null,
                        "localized_name": null,
                        "name": "Suspense",
                        "products": null,
                        "promote_upsell": null,
                        "suppress_download_option": null,
                        "suppress_release_date": null
                    }
                ],
                "root": "Genres"
            },
            {
                "date_product_available_in_category": null,
                "ladder": [
                    {
                        "category_presentation": null,
                        "children": null,
                        "default_offline_storage_days_count": null,
                        "default_offline_storage_item_count": null,
                        "description": null,
                        "header": null,
                        "id": "21073372011",
                        "images": null,
                        "initial_download_days_count": null,
                        "initial_download_item_count": null,
                        "is_new": null,
                        "localized_name": null,
                        "name": "Mystery, Thriller & Suspense",
                        "products": null,
                        "promote_upsell": null,
                        "suppress_download_option": null,
                        "suppress_release_date": null
                    },
                    {
                        "category_presentation": null,
                        "children": null,
                        "default_offline_storage_days_count": null,
                        "default_offline_storage_item_count": null,
                        "description": null,
                        "header": null,
                        "id": "21073402011",
                        "images": null,
                        "initial_download_days_count": null,
                        "initial_download_item_count": null,
                        "is_new": null,
                        "localized_name": null,
                        "name": "Thriller & Suspense",
                        "products": null,
                        "promote_upsell": null,
                        "suppress_download_option": null,
                        "suppress_release_date": null
                    },
                    {
                        "category_presentation": null,
                        "children": null,
                        "default_offline_storage_days_count": null,
                        "default_offline_storage_item_count": null,
                        "description": null,
                        "header": null,
                        "id": "21073657011",
                        "images": null,
                        "initial_download_days_count": null,
                        "initial_download_item_count": null,
                        "is_new": null,
                        "localized_name": null,
                        "name": "Crime Thrillers",
                        "products": null,
                        "promote_upsell": null,
                        "suppress_download_option": null,
                        "suppress_release_date": null
                    }
                ],
                "root": "Genres"
            },
            {
                "date_product_available_in_category": null,
                "ladder": [
                    {
                        "category_presentation": null,
                        "children": null,
                        "default_offline_storage_days_count": null,
                        "default_offline_storage_item_count": null,
                        "description": null,
                        "header": null,
                        "id": "21073372011",
                        "images": null,
                        "initial_download_days_count": null,
                        "initial_download_item_count": null,
                        "is_new": null,
                        "localized_name": null,
                        "name": "Mystery, Thriller & Suspense",
                        "products": null,
                        "promote_upsell": null,
                        "suppress_download_option": null,
                        "suppress_release_date": null
                    },
                    {
                        "category_presentation": null,
                        "children": null,
                        "default_offline_storage_days_count": null,
                        "default_offline_storage_item_count": null,
                        "description": null,
                        "header": null,
                        "id": "21073402011",
                        "images": null,
                        "initial_download_days_count": null,
                        "initial_download_item_count": null,
                        "is_new": null,
                        "localized_name": null,
                        "name": "Thriller & Suspense",
                        "products": null,
                        "promote_upsell": null,
                        "suppress_download_option": null,
                        "suppress_release_date": null
                    },
                    {
                        "category_presentation": null,
                        "children": null,
                        "default_offline_storage_days_count": null,
                        "default_offline_storage_item_count": null,
                        "description": null,
                        "header": null,
                        "id": "21073659011",
                        "images": null,
                        "initial_download_days_count": null,
                        "initial_download_item_count": null,
                        "is_new": null,
                        "localized_name": null,
                        "name": "Domestic Thrillers",
                        "products": null,
                        "promote_upsell": null,
                        "suppress_download_option": null,
                        "suppress_release_date": null
                    }
                ],
                "root": "Genres"
            }
        ],
        "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": [
            {
                "asin": "B09G7D69CX",
                "author_id": "amzn1.account.AEJ537QFB6DXQFPRCNB4GXL3ULXQ",
                "author_name": "nicole gangnon",
                "body": "I thought it would be more murder mystery kinda story but it was more like mean girls the adult version",
                "customer_vote": null,
                "format": "Freeform",
                "guided_responses": null,
                "id": "11ee068ca5c04e0296b7cf3a74312834",
                "location": "",
                "ratings": {
                    "overall_rating": 3,
                    "performance_rating": 4,
                    "story_rating": 3
                },
                "review_content_scores": {
                    "content_quality": 67,
                    "num_helpful_votes": 1,
                    "num_unhelpful_votes": 0
                },
                "submission_date": "2022-06-17T03:21:36Z",
                "title": "Adult Mean Girls"
            },
            {
                "asin": "B09G7D69CX",
                "author_id": "amzn1.account.AGMAKXUQSHUPJAYZYWIIN5ETKKRA",
                "author_name": "Botanix",
                "body": "Well developed story, cast of characters and performance. In the same style as Big Little Lies<br />",
                "customer_vote": null,
                "format": "Freeform",
                "guided_responses": null,
                "id": "99e70729facf489a90ad7552f46d34a2",
                "location": "",
                "ratings": {
                    "overall_rating": 5,
                    "performance_rating": 5,
                    "story_rating": 5
                },
                "review_content_scores": {
                    "content_quality": 67,
                    "num_helpful_votes": 1,
                    "num_unhelpful_votes": 0
                },
                "submission_date": "2022-05-09T22:59:20Z",
                "title": "Excellent "
            },
            {
                "asin": "B09G7D69CX",
                "author_id": "amzn1.account.AH3LT6AKHZRZNTWR4RDTUWT6CI3A",
                "author_name": "Jacquie vonHunnius",
                "body": "It certainly would have been a better story had the twist not come out of absolutely nowhere. I mean, most of the premise was ridiculous to begin with, but that \"twist\"? Oh my terrible. ",
                "customer_vote": null,
                "format": "Freeform",
                "guided_responses": null,
                "id": "d730ceda96734125b227f0662c1bb52c",
                "location": "",
                "ratings": {
                    "overall_rating": 2,
                    "performance_rating": 4,
                    "story_rating": 1
                },
                "review_content_scores": {
                    "content_quality": 50,
                    "num_helpful_votes": 0,
                    "num_unhelpful_votes": 0
                },
                "submission_date": "2022-07-25T20:02:17Z",
                "title": "What a lousy twist"
            }
        ],
        "customer_rights": null,
        "date_first_available": null,
        "distribution_rights_region": null,
        "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": null,
        "is_downloaded": false,
        "is_finished": false,
        "is_in_wishlist": null,
        "is_listenable": true,
        "is_pdf_url_available": null,
        "is_pending": false,
        "is_playable": null,
        "is_preorderable": null,
        "is_purchasability_suppressed": false,
        "is_released": null,
        "is_removable": true,
        "is_removable_by_parent": true,
        "is_returnable": true,
        "is_searchable": null,
        "is_visible": null,
        "is_world_rights": null,
        "is_ws4v_companion_asin_owned": null,
        "is_ws4v_enabled": false,
        "isbn": null,
        "issue_date": "2022-04-26",
        "language": "english",
        "library_status": {
            "date_added": "2022-07-22T01:52:47.000Z",
            "is_pending": null,
            "is_preordered": null,
            "is_removable": true,
            "is_visible": null
        },
        "listening_status": null,
        "member_giving_status": null,
        "merchandising_description": null,
        "merchandising_summary": "<p>Opulence. Sex. Betrayal\u2026sometimes friendship can be deadly. Meet the women of Buckhead - a place of expensive cars, huge houses, and competitive friendships....</p>",
        "music_id": null,
        "narration_accent": null,
        "narrators": [
            {
                "asin": null,
                "name": "Andi Arndt"
            },
            {
                "asin": null,
                "name": "Hillary Huber"
            },
            {
                "asin": null,
                "name": "Elizabeth Evans"
            },
            {
                "asin": null,
                "name": "Brittany Pressley"
            },
            {
                "asin": null,
                "name": "Cassandra Campbell"
            }
        ],
        "new_episode_added_date": null,
        "order_id": null,
        "order_item_id": null,
        "origin_asin": "B09G7D69CX",
        "origin_id": null,
        "origin_marketplace": "A2CQZ5RBY40XE",
        "origin_type": null,
        "part_number": null,
        "participation_plans": null,
        "pdf_url": null,
        "percent_complete": 0.0,
        "periodical_info": null,
        "plans": [
            {
                "customer_eligible": null,
                "detail_plan_names": null,
                "end_date": "2024-12-31T12:00:00.00000Z",
                "plan_name": "Audible-AYCL",
                "start_date": "2021-12-12T20:51:00.00051Z"
            }
        ],
        "platinum_keywords": null,
        "preorder_release_date": null,
        "preorder_status": null,
        "price": {
            "credit_price": 1.0,
            "is_buy_for_free_eligible": null,
            "is_credit_price_eligible": null,
            "is_free_eligible": null,
            "is_ws4v_upsell_eligible": null,
            "list_price": {
                "base": 36.810001373291016,
                "currency_code": "CAD",
                "merchant_id": "A2RMGFKT8AZX2C",
                "type": "list"
            },
            "lowest_price": {
                "base": 25.770000457763672,
                "currency_code": "CAD",
                "merchant_id": "A2RMGFKT8AZX2C",
                "type": "member"
            },
            "ws4v_upsell_price": {
                "base": 7.46999979019165,
                "currency_code": "CAD",
                "merchant_id": "A2RMGFKT8AZX2C",
                "type": "ws4v_upsell"
            }
        },
        "product_images": {
            "500": "https://m.media-amazon.com/images/I/41Ir+M3JZDL._SL500_.jpg"
        },
        "product_page_url": null,
        "product_site_launch_date": null,
        "program_participation": null,
        "provided_review": null,
        "publication_datetime": "2022-04-26T07:00:00Z",
        "publication_name": null,
        "publisher_name": "Blackstone Publishing",
        "publisher_summary": "<p><b>The highly anticipated new thriller from the bestselling author of </b><b><i>The Perfect Marriage</i></b><b>. </b></p> <p><b>Opulence. Sex. Betrayal \u2026 Sometimes friendship can be deadly.</b></p> <p>Meet the women of Buckhead\u2014a place of expensive cars, huge houses, and competitive friendships.</p> <p><b>Shannon</b> was once the queen bee of Buckhead. But she\u2019s been unceremoniously dumped by Bryce, her politician husband. When Bryce replaces her with a much younger woman, Shannon sets out to take revenge \u2026</p> <p><b>Crystal </b>has stepped into Shannon\u2019s old shoes. A young, innocent Texan girl, she simply has no idea what she\u2019s up against \u2026</p> <p><b>Olivia </b>has waited years to take Shannon\u2019s crown as the unofficial queen of Buckhead. Finally, her moment has come. But to take her rightful place, she will need to use every backstabbing, manipulative, underhand trick in the book \u2026</p> <p><b>Jenny </b>owns Glow, the most exclusive salon in town. Jenny knows all her clients\u2019 secrets and darkest desires. But will she ever tell?</p> <p>Who amongst these women will be clever enough to survive Buckhead\u2014and who will wind up dead? They say that friendships can be complex, but no one said it could ever be this deadly.</p>",
        "purchase_date": "2022-07-22T01:52:47.000Z",
        "rating": {
            "num_reviews": 17,
            "overall_distribution": {
                "average_rating": 4.359447004608295,
                "display_average_rating": "4.4",
                "display_stars": 4.5,
                "num_five_star_ratings": 125,
                "num_four_star_ratings": 58,
                "num_one_star_ratings": 3,
                "num_ratings": 217,
                "num_three_star_ratings": 24,
                "num_two_star_ratings": 7
            },
            "performance_distribution": {
                "average_rating": 4.555555555555555,
                "display_average_rating": "4.6",
                "display_stars": 4.5,
                "num_five_star_ratings": 134,
                "num_four_star_ratings": 46,
                "num_one_star_ratings": 3,
                "num_ratings": 198,
                "num_three_star_ratings": 15,
                "num_two_star_ratings": 0
            },
            "story_distribution": {
                "average_rating": 4.285714285714286,
                "display_average_rating": "4.3",
                "display_stars": 4.5,
                "num_five_star_ratings": 109,
                "num_four_star_ratings": 52,
                "num_one_star_ratings": 6,
                "num_ratings": 196,
                "num_three_star_ratings": 23,
                "num_two_star_ratings": 6
            }
        },
        "read_along_support": null,
        "relationships": null,
        "release_date": "2022-04-26",
        "review_status": null,
        "runtime_length_min": 562,
        "sample_url": "https://samples.audible.com/bk/blak/018332/bk_blak_018332_sample.mp3",
        "season_number": null,
        "series": null,
        "sku": "BK_BLAK_018332CA",
        "sku_lite": "BK_BLAK_018332",
        "social_media_images": {
            "facebook": "https://m.media-amazon.com/images/I/41Ir+M3JZDL._SL10_UR1600,800_CR200,50,1200,630_CLa%7C1200,630%7C41Ir+M3JZDL.jpg%7C0,0,1200,630+82,82,465,465_PJAdblSocialShare-Gradientoverlay-largeasin-0to70,TopLeft,0,0_PJAdblSocialShare-AudibleLogo-Large,TopLeft,600,270_OU01_ZBLISTENING%20ON,617,216,52,500,AudibleSansMd,30,255,255,255.jpg",
            "twitter": "https://m.media-amazon.com/images/I/41Ir+M3JZDL._SL10_UR1600,800_CR200,50,1024,512_CLa%7C1024,512%7C41Ir+M3JZDL.jpg%7C0,0,1024,512+67,67,376,376_PJAdblSocialShare-Gradientoverlay-twitter-largeasin-0to60,TopLeft,0,0_PJAdblSocialShare-AudibleLogo-Medium,TopLeft,490,223_OU01_ZBLISTENING%20ON,483,152,55,450,AudibleSansMd,32,255,255,255.jpg"
        },
        "status": "Active",
        "subscription_asins": null,
        "subtitle": null,
        "text_to_speech": null,
        "thesaurus_subject_keywords": [
            "literature-and-fiction"
        ],
        "title": "One of Us Is Dead",
        "voice_description": null,
        "ws4v_companion_asin": null
    },
    "response_groups": [
        "claim_code_url",
        "ws4v",
        "sample",
        "is_downloaded",
        "is_finished",
        "percent_complete",
        "always-returned",
        "product_extended_attrs",
        "contributors",
        "product_plans",
        "series",
        "review_attrs",
        "product_plan_details",
        "origin",
        "rating",
        "pdf_url",
        "media",
        "product_attrs",
        "relationships",
        "product_desc",
        "reviews",
        "provided_review",
        "price",
        "origin_asin",
        "categories",
        "category_ladders",
        "sku",
        "badge_types",
        "is_returnable"
    ]
}
mkb79 commented 2 years ago

That’s really strange. Requesting the whole library via Library.from_api_full_sync will end in some data are None. Under normal circumstances, this happens if no or the wrong response_groups has been specified.

Using the Library.from_api_full_sync will fetch the library in batches (bunches). This is by default 1,000. Happens the beginning of the loose of the data (title, subtitle, etc.) at the beginning of a new bunch? I can’t looking into that currently, my iPhone screen is too small.

johnlescault commented 2 years ago

Honestly it's not that big of a deal to me - I just like to use the export to see where I am on syncing my library.

On another note - what is the current limit for downloaded books per day? It seems extremely random where sometimes I max out at 70, other times at 250 so I can't seem to figure it out. I generally let it go till I get the "error: 'license_response'"

mkb79 commented 2 years ago

Oh I saw that the export function will sort the results by asin. So they are not in order they are come in from the API response. This way I can’t validate, if the issue begins at the start of a new bunch.

On another note - what is the current limit for downloaded books per day?

That’s something I can’t tell to you. I have around 130 books in my library. So I don’t reach any rate limit yet. The "error: 'license_response'" is a key error and means, that the license_response key is not in the license response. This happens if the license, for some reason, is denied. I will improve the error handling for the licenserequest to output some more information and hopefully to get the reason for rejection.

mkb79 commented 2 years ago

I've implement a better error handling for license requests in the master branch. Maybe you can test this out?

johnlescault commented 2 years ago

Sure. What do I do to install the new version? I assume it's a dev branch?

mkb79 commented 2 years ago

Sure. What do I do to install the new version? I assume it's a dev branch?

  1. Activate your venv
  2. Clone the latest master branch with git clone --branch master https://github.com/mkb79/audible-cli
  3. Switch to the new created directory.
  4. Run pip install --upgrade . (Or pip3, if pip does not exists)
johnlescault commented 2 years ago

Thanks - here is the output. I removed my user ID. The first few errors (the ones with the xml in the message that says Access Denied) seem to happen regardless, but the last ones will work if I wait the "reset" period (License denied)

$ audible -v error download --all --aaxc --cover --cover-size 1215 --chapter --pdf --jobs 3 --bunch-size 200 --timeout 90000
Everyday_Survival_Why_Smart_People_Do_Stupid_Things-AAX_44_128.aaxc: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 110/110 [00:00<00:00, 168B/s]
error: Error downloading /mnt/12tb_1/Audible RIPs/0Audible Plus RAW/Everyday_Survival_Why_Smart_People_Do_Stupid_Things-AAX_44_128.aaxc. Message: <?xml version="1.0" encoding="UTF-8"?><Error><Code>AccessDenied</Code><Message>Access denied</Message></Error>                                                                                                            | 0.00/110 [00:00<?, ?B/s]
The_Great_Debate_Advocates_and_Opponents_of_the_American_Constitution-AAX_22_64.aaxc: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 110/110 [00:00<00:00, 118B/s]
error: Error downloading /mnt/12tb_1/Audible RIPs/0Audible Plus RAW/The_Great_Debate_Advocates_and_Opponents_of_the_American_Constitution-AAX_22_64.aaxc. Message: <?xml version="1.0" encoding="UTF-8"?><Error><Code>AccessDenied</Code><Message>Access denied</Message></Error>██████████████████████████████████████████████████████████████████████████████████████| 110/110 [00:00<00:00, 119B/s]
A_History_of_British_India-AAX_22_64.aaxc: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 110/110 [00:01<00:00, 69.1B/s]
error: Error downloading /mnt/12tb_1/Audible RIPs/0Audible Plus RAW/A_History_of_British_India-AAX_22_64.aaxc. Message: <?xml version="1.0" encoding="UTF-8"?><Error><Code>AccessDenied</Code><Message>Access denied</Message></Error>
error: No COVER found for Absolute Beginner Conversation #5 (German) with given resolution
Books_That_Matter_The_History_of_the_Decline_and_Fall_of_the_Roman_Empire-AAX_22_64.aaxc:   0%|                                                                                                                                                                                                                                                                             | 0.00/110 [00:00<?, ?B/serror: License denied message for B09TD8Q65Y: Customer [] has rights to asin [B09TD8Q65Y] for AYCL.Reason: UNKNOWN.Type: AYCL                                                                                                                                                                                                                                  | 0.00/110 [00:00<?, ?B/s]
error: License denied message for B09TD8Q65Y: Since ClientId is null, skipping client rights validation.AAAClientId[ApolloEnv:AudibleApiExternalRouterService/NA/ACLS/Prod], does not has access to asin[B09TD8Q65Y]..Reason: RequesterEligibility.Type: Client
error: License denied message for B09TD8Q65Y: Customer [] is not part of any plans..Reason: RequesterEligibility.Type: Membership
error: License denied message for B09TD8Q65Y: Ownership: User [] does not has Ownership rights for asin [B09TD8Q65Y]..Reason: RequesterEligibility.Type: Ownership
error: License not granted to customer [] for asin [B09TD8Q65Y]
Books_That_Matter_The_History_of_the_Decline_and_Fall_of_the_Roman_Empire-AAX_22_64.aaxc: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 110/110 [00:00<00:00, 279B/s]
error: Error downloading /mnt/12tb_1/Audible RIPs/0Audible Plus RAW/Books_That_Matter_The_History_of_the_Decline_and_Fall_of_the_Roman_Empire-AAX_22_64.aaxc. Message: <?xml version="1.0" encoding="UTF-8"?><Error><Code>AccessDenied</Code><Message>Access denied</Message></Error>██████████████████████████████████████████████████████████████████████████████████| 110/110 [00:00<00:00, 324B/s]
Renaissance_The_Transformation_of_the_West-AAX_22_64.aaxc: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 110/110 [00:00<00:00, 194B/s]
error: Error downloading /mnt/12tb_1/Audible RIPs/0Audible Plus RAW/Renaissance_The_Transformation_of_the_West-AAX_22_64.aaxc. Message: <?xml version="1.0" encoding="UTF-8"?><Error><Code>AccessDenied</Code><Message>Access denied</Message></Error>
error: License denied message for B09T8XQVYD: Customer [] has rights to asin [B09T8XQVYD] for AYCL.Reason: UNKNOWN.Type: AYCL
error: License denied message for B09T8XQVYD: Since ClientId is null, skipping client rights validation.AAAClientId[ApolloEnv:AudibleApiExternalRouterService/NA/ACLS/Prod], does not has access to asin[B09T8XQVYD]..Reason: RequesterEligibility.Type: Client
error: License denied message for B09T8XQVYD: Ownership: User [] does not has Ownership rights for asin [B09T8XQVYD]..Reason: RequesterEligibility.Type: Ownership
error: License denied message for B09T8XQVYD: Customer [] is not part of any plans..Reason: RequesterEligibility.Type: Membership
error: License not granted to customer [] for asin [B09T8XQVYD]
error: License denied message for B09TDHCSG5: Customer [] has rights to asin [B09TDHCSG5] for AYCL.Reason: UNKNOWN.Type: AYCL
error: License denied message for B09TDHCSG5: Since ClientId is null, skipping client rights validation.AAAClientId[ApolloEnv:AudibleApiExternalRouterService/NA/ACLS/Prod], does not has access to asin[B09TDHCSG5]..Reason: RequesterEligibility.Type: Client
error: License denied message for B09TDHCSG5: Ownership: User [] does not has Ownership rights for asin [B09TDHCSG5]..Reason: RequesterEligibility.Type: Ownership
error: License denied message for B09TDHCSG5: Customer [] is not part of any plans..Reason: RequesterEligibility.Type: Membership
error: License not granted to customer [] for asin [B09TDHCSG5]
mkb79 commented 2 years ago

Can you run audible api -m GET -p "response_groups=product_desc,product_attrs,relationships,customer_rights" -i 4 -c ca library/B09TDHCSG5, audible api -m GET -p "response_groups=product_desc,product_attrs,relationships,customer_rights" -i 4 -c ca library/B09T8XQVYD and audible api -m GET -p "response_groups=product_desc,product_attrs,relationships,customer_rights" -i 4 -c ca library/B09TD8Q65Y?

The customer_rights key is the important part for me.

mkb79 commented 2 years ago

It seams you don’t have the rights to download this titles.

Edit: Do you can download these titles to your Audible APP (for mobile devices or desktop)?

johnlescault commented 2 years ago

Yes I can download these on the android app. I ran the download again, it downloaded books then after a bit gave the error again: Please notice that the last one failed at asin B09TD8Q65Y = Stars of Hockey, and that is the first one that downloaded successfully this second time.

$ audible -v error download --all --aaxc --cover --cover-size 1215 --chapter --pdf --jobs 3 --bunch-size 200 --timeout 90000
Everyday_Survival_Why_Smart_People_Do_Stupid_Things-AAX_44_128.aaxc: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 110/110 [00:00<00:00, 183B/s]
error: Error downloading /mnt/12tb_1/Audible RIPs/0Audible Plus RAW/Everyday_Survival_Why_Smart_People_Do_Stupid_Things-AAX_44_128.aaxc. Message: <?xml version="1.0" encoding="UTF-8"?><Error><Code>AccessDenied</Code><Message>Access denied</Message></Error>sh_India-AAX_22_64.aaxc:   0%|                                                                                                                                                                    | 0.00/110 [00:00<?, ?B/s]
The_Great_Debate_Advocates_and_Opponents_of_the_American_Constitution-AAX_22_64.aaxc: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 110/110 [00:00<00:00, 126B/s]
error: Error downloading /mnt/12tb_1/Audible RIPs/0Audible Plus RAW/The_Great_Debate_Advocates_and_Opponents_of_the_American_Constitution-AAX_22_64.aaxc. Message: <?xml version="1.0" encoding="UTF-8"?><Error><Code>AccessDenied</Code><Message>Access denied</Message></Error>
A_History_of_British_India-AAX_22_64.aaxc: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 110/110 [00:01<00:00, 67.8B/s]
error: Error downloading /mnt/12tb_1/Audible RIPs/0Audible Plus RAW/A_History_of_British_India-AAX_22_64.aaxc. Message: <?xml version="1.0" encoding="UTF-8"?><Error><Code>AccessDenied</Code><Message>Access denied</Message></Error>
error: No COVER found for Absolute Beginner Conversation #5 (German) with given resolution████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 110/110 [00:01<00:00, 67.9B/s]
Books_That_Matter_The_History_of_the_Decline_and_Fall_of_the_Roman_Empire-AAX_22_64.aaxc: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 110/110 [00:00<00:00, 189B/s]
error: Error downloading /mnt/12tb_1/Audible RIPs/0Audible Plus RAW/Books_That_Matter_The_History_of_the_Decline_and_Fall_of_the_Roman_Empire-AAX_22_64.aaxc. Message: <?xml version="1.0" encoding="UTF-8"?><Error><Code>AccessDenied</Code><Message>Access denied</Message></Error>
Renaissance_The_Transformation_of_the_West-AAX_22_64.aaxc: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 110/110 [00:00<00:00, 136B/s]
error: Error downloading /mnt/12tb_1/Audible RIPs/0Audible Plus RAW/Renaissance_The_Transformation_of_the_West-AAX_22_64.aaxc. Message: <?xml version="1.0" encoding="UTF-8"?><Error><Code>AccessDenied</Code><Message>Access denied</Message></Error>
Stars_of_Hockey_Sports_Stars-AAX_44_128.aaxc: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.58M/2.58M [00:04<00:00, 676kB/s]
Tammy_Duckworth-AAX_44_128.aaxc: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3.82M/3.82M [00:09<00:00, 429kB/s]
Earthworms-AAX_44_128.aaxc: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1.89M/1.89M [00:02<00:00, 763kB/s]
Canyons-AAX_44_128.aaxc: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.39M/2.39M [00:03<00:00, 661kB/s]
Barbara_Park-AAX_44_128.aaxc: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6.23M/6.23M [00:08<00:00, 737kB/s]
Amphibians-AAX_44_128.aaxc: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 17.5M/17.5M [00:26<00:00, 682kB/s]
Princes_and_Princesses-AAX_44_128.aaxc: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3.01M/3.01M [00:02<00:00, 1.06MB/s]
Goats-AAX_44_128.aaxc: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.65M/2.65M [00:02<00:00, 1.05MB/s]
Ducks_and_Their_Ducklings_A_4D_Book-AAX_44_128.aaxc: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1.98M/1.98M [00:03<00:00, 618kB/s]
Andy_Murray-AAX_44_128.aaxc: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.91M/2.91M [00:03<00:00, 807kB/s]
Thunder_Rolling_Down_the_Mountain_The_Story_of_Chief_Joseph_and_the_Nez_Perce-AAX_44_128.aaxc: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████| 14.1M/14.1M [00:13<00:00, 1.08MB/s]
Red_Foxes-AAX_44_128.aaxc: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3.16M/3.16M [00:02<00:00, 1.18MB/s]
Stars_of_Basketball_Sports_Stars-AAX_44_128.aaxc: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.69M/2.69M [00:01<00:00, 1.44MB/s]
Nocturnal_Animals-AAX_44_128.aaxc: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3.74M/3.74M [00:04<00:00, 792kB/s]
Rattlesnakes-AAX_44_128.aaxc: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.38M/2.38M [00:05<00:00, 421kB/s]
Johannes_Gutenberg_Inventor_and_Craftsman-AAX_44_128.aaxc: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6.91M/6.91M [00:12<00:00, 572kB/s]
Candace_Parker_Women_in_Sports-AAX_44_128.aaxc: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.98M/2.98M [00:03<00:00, 940kB/s]
Kadir_Nelson-AAX_44_128.aaxc: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7.82M/7.82M [00:18<00:00, 433kB/s]
Terriers_Loyal_Hunting_Companions-AAX_44_128.aaxc: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 23.6M/23.6M [00:36<00:00, 680kB/s]
Dilophosaurus_vs._Ankylosaurus_Weapons_Against_Armor-AAX_44_128.aaxc: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 15.7M/15.7M [00:18<00:00, 869kB/s]
Alexander_Graham_Bell-AAX_44_128.aaxc: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3.36M/3.36M [00:06<00:00, 532kB/s]
John_Danny_Olivas-AAX_44_128.aaxc: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.91M/2.91M [00:04<00:00, 656kB/s]
Pygmy_Marmosets-AAX_44_128.aaxc: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.88M/2.88M [00:03<00:00, 761kB/s]
House_Sparrows-AAX_44_128.aaxc: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.50M/2.50M [00:03<00:00, 663kB/s]
The_Worst_Tsunamis_of_All_Time-AAX_44_128.aaxc: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 26.2M/26.2M [00:34<00:00, 804kB/s]
Guinea_Pigs-AAX_44_128.aaxc: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1.81M/1.81M [00:03<00:00, 557kB/s]
Thomas_Edison_Physicist_and_Inventor-AAX_44_128.aaxc: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7.14M/7.14M [00:17<00:00, 417kB/s]
Andrew_Jackson_Heroic_Leader_or_Cold-hearted_Ruler-AAX_44_128.aaxc: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 22.3M/22.3M [00:38<00:00, 605kB/s]
Stephenie_Meyer_Author_of_the_Twilight_Series-AAX_44_128.aaxc: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 23.9M/23.9M [00:44<00:00, 560kB/s]
Mini_Mind_Controllers_Fungi_Bacteria_and_Other_Tiny_Zombie_Makers-AAX_44_128.aaxc: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 19.5M/19.5M [00:36<00:00, 567kB/s]
Outrunning_the_Nazis_The_Brave_Escape_of_Resistance_Fighter_Sven_Somme-AAX_44_128.aaxc: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20.8M/20.8M [00:35<00:00, 612kB/s]
Hillary_Clinton-AAX_44_128.aaxc: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3.50M/3.50M [00:03<00:00, 1.21MB/s]
Eleanor_Roosevelt-AAX_44_128.aaxc: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3.75M/3.75M [00:04<00:00, 933kB/s]
Benjamin_Banneker_Self-Educated_Scientist-AAX_44_128.aaxc: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7.12M/7.12M [00:09<00:00, 799kB/s]
The_1918_Flu_Pandemic-AAX_44_128.aaxc: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 14.5M/14.5M [00:21<00:00, 705kB/s]
Nikki_Grimes-AAX_44_128.aaxc: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7.46M/7.46M [00:10<00:00, 713kB/s]
Justin_Bieber-AAX_44_128.aaxc: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 23.0M/23.0M [00:48<00:00, 501kB/s]
George_W._Bush-AAX_44_128.aaxc: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3.68M/3.68M [00:05<00:00, 693kB/s]
Rey_Mysterio_High-Flying_Luchador-AAX_44_128.aaxc: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 37.8M/37.8M [01:04<00:00, 619kB/s]
Papillons-AAX_44_128.aaxc: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.28M/2.28M [00:06<00:00, 377kB/s]
Jay-Z_Hip-Hop_Icon-AAX_44_128.aaxc: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 11.9M/11.9M [00:24<00:00, 506kB/s]
Suzanne_Collins_Author_of_the_Hunger_Games_Trilogy_(Famous_Female_Authors)-AAX_44_128.aaxc: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 22.3M/22.3M [00:31<00:00, 746kB/s]
Kings_and_Queens-AAX_44_128.aaxc: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3.39M/3.39M [00:07<00:00, 453kB/s]
Amelia_Earhart_Legendary_Aviator-AAX_44_128.aaxc: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 13.4M/13.4M [00:21<00:00, 654kB/s]
The_Life_and_Times_of_George_Washington_and_the_American_Revolution-AAX_44_128.aaxc: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 8.78M/8.78M [00:10<00:00, 849kB/s]
Jeff_Kinney-AAX_44_128.aaxc: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6.55M/6.55M [00:13<00:00, 498kB/s]
CM_Punk_Straight_Edge_Heel-AAX_44_128.aaxc: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46.5M/46.5M [01:22<00:00, 591kB/s]
Dogs_and_Their_Puppies_A_4D_Book-AAX_44_128.aaxc: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1.62M/1.62M [00:04<00:00, 365kB/s]
Terrors_from_the_Deep_True_Stories_of_Surviving_Shark_Attacks-AAX_44_128.aaxc: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 19.3M/19.3M [00:33<00:00, 611kB/s]
Harriet_Tubman_and_the_Underground_Railroad-AAX_44_128.aaxc: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 9.70M/9.70M [00:22<00:00, 449kB/s]
Reptiles-AAX_44_128.aaxc: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 19.7M/19.7M [00:29<00:00, 692kB/s]
Veronica_Roth_Author_of_the_Divergent_Trilogy-AAX_44_128.aaxc: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 23.2M/23.2M [00:38<00:00, 627kB/s]
Michelle_Obama-AAX_44_128.aaxc: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3.39M/3.39M [00:03<00:00, 980kB/s]
Baby_Animals_in_Burrows-AAX_44_128.aaxc: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.28M/2.28M [00:03<00:00, 650kB/s]
All_Kinds_of_Gardens-AAX_44_128.aaxc: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1.68M/1.68M [00:02<00:00, 592kB/s]
Regal_Tangs_Sea_Life-AAX_44_128.aaxc: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.50M/2.50M [00:03<00:00, 809kB/s]
Cows_and_Their_Calves_A_4D_Book_(Animal_Offspring)-AAX_44_128.aaxc: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1.86M/1.86M [00:03<00:00, 533kB/s]
Cat_Shows_Competing_for_Top_Prize_(Cats_Rule)-AAX_44_128.aaxc: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 21.5M/21.5M [00:22<00:00, 1.00MB/s]
Abby_Wambach-AAX_44_128.aaxc: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.84M/2.84M [00:04<00:00, 635kB/s]
Rain_Showers-AAX_44_128.aaxc: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1.73M/1.73M [00:03<00:00, 458kB/s]
Brachiosaurus_and_Other_Big_Long-Necked_Dinosaurs_The_Need-to-Know_Facts-AAX_44_128.aaxc: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████| 13.1M/13.1M [00:13<00:00, 1.03MB/s]
Living_or_Nonliving_Life_Science-AAX_44_128.aaxc: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3.63M/3.63M [00:06<00:00, 588kB/s]
George_Washington_The_Rise_of_Americas_First_President-AAX_44_128.aaxc: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 16.3M/16.3M [00:23<00:00, 723kB/s]
Aaron_Rodgers_Famous_Athletes-AAX_44_128.aaxc: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3.15M/3.15M [00:04<00:00, 674kB/s]
Search_and_Rescue_Dogs-AAX_44_128.aaxc: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.10M/2.10M [00:04<00:00, 454kB/s]
Repurpose_It_Invent_New_Uses_for_Old_Stuff-AAX_44_128.aaxc: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 27.5M/27.5M [00:42<00:00, 676kB/s]
Alexander_Graham_Bell_and_the_Telephone-AAX_44_128.aaxc: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 16.7M/16.7M [00:24<00:00, 713kB/s]
North_American_Black_Bears-AAX_44_128.aaxc: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3.12M/3.12M [00:06<00:00, 530kB/s]
Stars_of_Baseball_Sports_Stars-AAX_44_128.aaxc: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.65M/2.65M [00:04<00:00, 656kB/s]
Booker_T._Washington_Great_American_Educator-AAX_44_128.aaxc: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 16.7M/16.7M [00:23<00:00, 734kB/s]
Learning_About_Rocks-AAX_44_128.aaxc: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.93M/2.93M [00:04<00:00, 708kB/s]
Brain_Eaters_Creatures_with_Zombelike_Diets-AAX_44_128.aaxc: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 21.1M/21.1M [00:24<00:00, 892kB/s]
Pet_Guinea_Pigs_Up_Close-AAX_44_128.aaxc: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.70M/2.70M [00:04<00:00, 683kB/s]
Jerry_Pinkney-AAX_44_128.aaxc: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6.91M/6.91M [00:13<00:00, 529kB/s]
Benedict_Arnold_Battlefield_Hero_or_Selfish_Traitor-AAX_44_128.aaxc: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 23.6M/23.6M [00:37<00:00, 664kB/s]
Deer_Hunting_for_Kids-AAX_44_128.aaxc: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 17.0M/17.0M [00:27<00:00, 640kB/s]
Lake_Placid_Miracle_When_U.S._Hockey_Stunned_the_World-AAX_44_128.aaxc:  20%|████████████████████████▍                                                                                                    | 3.38M/17.3M [00:06<00:19, 743kB/s]error: License denied message for B09V6WFFTK: Customer [] has rights to asin [B09V6WFFTK] for AYCL.Reason: UNKNOWN.Type: AYCL█████████████████████████████████████████████████████████████  | 16.8M/17.0M [00:27<00:01, 153kB/s]
error: License denied message for B09V6WFFTK: Since ClientId is null, skipping client rights validation.AAAClientId[ApolloEnv:AudibleApiExternalRouterService/NA/ACLS/Prod], does not has access to asin[B09V6WFFTK]..Reason: RequesterEligibility.Type: Client
error: License denied message for B09V6WFFTK: Customer [] is not part of any plans..Reason: RequesterEligibility.Type: Membership
error: License denied message for B09V6WFFTK: Ownership: User [] does not has Ownership rights for asin [B09V6WFFTK]..Reason: RequesterEligibility.Type: Ownership
error: License not granted to customer [] for asin [B09V6WFFTK]
Lake_Placid_Miracle_When_U.S._Hockey_Stunned_the_World-AAX_44_128.aaxc:  47%|██████████████████████████████████████████████████████████▌                                                                 | 8.18M/17.3M [00:10<00:06, 1.57MB/s]error: License denied message for B09V6ZL6MK: Customer [] has rights to asin [B09V6ZL6MK] for AYCL.Reason: UNKNOWN.Type: AYCL
error: License denied message for B09V6ZL6MK: Ownership: User [] does not has Ownership rights for asin [B09V6ZL6MK]..Reason: RequesterEligibility.Type: Ownership
error: License denied message for B09V6ZL6MK: Since ClientId is null, skipping client rights validation.AAAClientId[ApolloEnv:AudibleApiExternalRouterService/NA/ACLS/Prod], does not has access to asin[B09V6ZL6MK]..Reason: RequesterEligibility.Type: Client
error: License denied message for B09V6ZL6MK: Customer [] is not part of any plans..Reason: RequesterEligibility.Type: Membership
error: License not granted to customer [] for asin [B09V6ZL6MK]
Lake_Placid_Miracle_When_U.S._Hockey_Stunned_the_World-AAX_44_128.aaxc: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 17.3M/17.3M [00:18<00:00, 965kB/s]
error: License denied message for B09V6XQJWJ: Customer [] has rights to asin [B09V6XQJWJ] for AYCL.Reason: UNKNOWN.Type: AYCL
error: License denied message for B09V6XQJWJ: Since ClientId is null, skipping client rights validation.AAAClientId[ApolloEnv:AudibleApiExternalRouterService/NA/OneBox/ACLS/Prod], does not has access to asin[B09V6XQJWJ]..Reason: RequesterEligibility.Type: Client
error: License denied message for B09V6XQJWJ: Ownership: User [] does not has Ownership rights for asin [B09V6XQJWJ]..Reason: RequesterEligibility.Type: Ownership
error: License denied message for B09V6XQJWJ: Customer [] is not part of any plans..Reason: RequesterEligibility.Type: Membership
error: License not granted to customer [] for asin [B09V6XQJWJ]
johnlescault commented 2 years ago

I'm not sure if you want me to run those commands you requested anymore as I have now successfully downloaded those (I assume not). So i have replaced the asin with the new ones (see the next post for the output of that)

$ audible api -m GET -p "response_groups=product_desc,product_attrs,relationships,customer_rights" -i 4 -c ca library/B09V6WFFTK
{

        "customer_rights": {
            "is_consumable": true,
            "is_consumable_indefinitely": false,
            "is_consumable_offline": true,
            "is_consumable_until": "2027-01-01T12:00:00Z"
        },
$ audible api -m GET -p "response_groups=product_desc,product_attrs,relationships,customer_rights" -i 4 -c ca library/B09V6ZL6MK 
{

        "customer_rights": {
            "is_consumable": true,
            "is_consumable_indefinitely": false,
            "is_consumable_offline": true,
            "is_consumable_until": "2027-01-01T12:00:00Z"
        },
audible api -m GET -p "response_groups=product_desc,product_attrs,relationships,customer_rights" -i 4 -c ca library/B09V6XQJWJ
{
        "customer_rights": {
            "is_consumable": true,
            "is_consumable_indefinitely": false,
            "is_consumable_offline": true,
            "is_consumable_until": "2027-01-01T12:00:00Z"
        },
mkb79 commented 2 years ago

It seams you have the rights for the books. But one thing is striking. You got the xml error first before the license denied error comes.

Maybe you can verify something for me? Do you have the voucher file for the books, where you got the Message: <?xml version="1.0" encoding="UTF-8"?><Error><Code>AccessDenied</Code><Message>Access denied</Message></Error>? If so, can you take a look to the refresh_date and removal_date in the voucher file. If they are expired?

mkb79 commented 2 years ago

I've made some changes to this branch. This will improve the reuse of existing voucher files! Can you test this out?

mkb79 commented 2 years ago

@johnlescault I've found the reason for the xml Access Denied message. A offline url given by a license request response is only valid for 60 minutes. After expiration you've got these error message, if you try to download the file. I've fixed this in this branch. Maybe this could be the reason for your other issue with the license request denied error.

johnlescault commented 2 years ago

Hi sorry for the delay in getting back to you.

I installed the new branch, got the following errors:

$ audible -v error download --all --aaxc --cover --cover-size 1215 --chapter --pdf --jobs 3 --bunch-size 200 --timeout 90000
error: License not granted to customer [x] for asin [B071HP5P91]
error: License not granted to customer [x] for asin [B071RRW518]
error: License not granted to customer [x] for asin [B0719GGLJ3]

Just so you don't have to check yourself, asin B071HP5P91 = The_Great_Debate_Advocates_and_Opponents_of_the_American_Constitution-AAX_22_64 (one of the ones giving the XML errors). So that part is definately fixed, however I still believe there is a limit per day causing this as when I try tomorrow to download, it will work.

For your question regarding what files I have, specific to The_Great_Debate book here they are: The_Great_Debate_Advocates_and_Opponents_of_the_American_Constitution.pdf The_Great_Debate_Advocates_and_Opponents_of_the_AmericanConstitution(1215).jpg The_Great_Debate_Advocates_and_Opponents_of_the_American_Constitution-AAX_22_64.voucher The_Great_Debate_Advocates_and_Opponents_of_the_American_Constitution-chapters.json

mkb79 commented 2 years ago

Fortunately, the XML errors are gone. Do you know how many voucher files you could download before the License not granted … errors appear? Can you try again with -v debug instead of -v error. Maybe there are some important debug messages which can help me to understand what’s going on.

Thank you very much for your help.

PS: Do you take account about the new start and end date option for the library export and list command?!

johnlescault commented 2 years ago

This morning when I ran the first download it was 76, but I believe it may be a rolling 24 hour period (or 12 hours) as I will most likely have some more downloads by tonight.

error: 'license_response':  10%|███████████████████████████████                                                                                                                                                                                                                                                                                                    | 218k/2.21M [00:02<00:17, 116kB/s]
error: 'license_response'
error: 'license_response'
^CThe download ended with the following result:
New aaxc files: 76
New chapter files: 76
New cover files: 76
New voucher files: 76

debug gives the following: (output after all the books it skipped)

debug: Download url in /mnt/12tb_1/Audible RIPs/0Audible Plus RAW/Everyday_Survival_Why_Smart_People_Do_Stupid_Things-AAX_44_128.voucher is expired. Refreshing license
debug: Download url in /mnt/12tb_1/Audible RIPs/0Audible Plus RAW/The_Great_Debate_Advocates_and_Opponents_of_the_American_Constitution-AAX_22_64.voucher is expired. Refreshing license
debug: Download url in /mnt/12tb_1/Audible RIPs/0Audible Plus RAW/A_History_of_British_India-AAX_22_64.voucher is expired. Refreshing license
debug: License denied message for B071RRW518: Customer [x] has rights to asin [B071RRW518] for AYCL.Reason: UNKNOWN.Type: AYCL
debug: License denied message for B071RRW518: Since ClientId is null, skipping client rights validation.AAAClientId[ApolloEnv:AudibleApiExternalRouterService/NA/ACLS/Prod], does not has access to asin[B071RRW518]..Reason: RequesterEligibility.Type: Client
debug: License denied message for B071RRW518: Ownership: User [x] does not has Ownership rights for asin [B071RRW518]..Reason: RequesterEligibility.Type: Ownership
debug: License denied message for B071RRW518: Customer [x] is not part of any plans..Reason: RequesterEligibility.Type: Membership
error: License not granted to customer [x] for asin [B071RRW518]
debug: License denied message for B071HP5P91: Customer [x] has rights to asin [B071HP5P91] for AYCL.Reason: UNKNOWN.Type: AYCL
debug: License denied message for B071HP5P91: Since ClientId is null, skipping client rights validation.AAAClientId[ApolloEnv:AudibleApiExternalRouterService/NA/ACLS/Prod], does not has access to asin[B071HP5P91]..Reason: RequesterEligibility.Type: Client
debug: License denied message for B071HP5P91: Ownership: User [x] does not has Ownership rights for asin [B071HP5P91]..Reason: RequesterEligibility.Type: Ownership
debug: License denied message for B071HP5P91: Customer [x] is not part of any plans..Reason: RequesterEligibility.Type: Membership
error: License not granted to customer [x] for asin [B071HP5P91]
debug: License denied message for B0719GGLJ3: Customer [x] has rights to asin [B0719GGLJ3] for AYCL.Reason: UNKNOWN.Type: AYCL
debug: License denied message for B0719GGLJ3: Since ClientId is null, skipping client rights validation.AAAClientId[ApolloEnv:AudibleApiExternalRouterService/NA/ACLS/Prod], does not has access to asin[B0719GGLJ3]..Reason: RequesterEligibility.Type: Client
debug: License denied message for B0719GGLJ3: Customer [x] is not part of any plans..Reason: RequesterEligibility.Type: Membership
debug: License denied message for B0719GGLJ3: Ownership: User [x] does not has Ownership rights for asin [B0719GGLJ3]..Reason: RequesterEligibility.Type: Ownership
error: License not granted to customer [x] for asin [B0719GGLJ3]
mkb79 commented 2 years ago

That's really strange. You got Customer [x] has rights to asin [B071RRW518] for AYCL but then User [x] does not has Ownership rights for asin [B071RRW518] and Customer [x] is not part of any plans. If you got this errors again, can you please run

audible api -p "response_groups=delinquency_status,customer_benefits,customer_segment,subscription_details_payment_instrument,plan_summary,subscription_details,directed_ids" -p "source=Credit" -i 4 account/information

and verify that you are member in any plan?!

johnlescault commented 2 years ago

I ran that command, and the "status" is Active so I assume that is all good. I can still download on my Android, so I assume the limit is device based? All the different virtual environments I run all point to the same login info so I assume to the audible server it looks like the same device.

I have a VM I could test it on with a fresh install (of the dev branch you made + a new "device), give me a couple hours and I'll let you know how that goes.

johnlescault commented 2 years ago

After writing that message I thought of instead of going through the trouble of doing it from a VM I just created a new profile in audible-cli using the same credentials, simulating a second device. This does not seem to have worked. Prior to doing that, I ran another download though and got the following amounts (not the same as last time):

New aaxc files: 102
New chapter files: 96
New cover files: 96
New voucher files: 103
johnlescault commented 2 years ago

I take it back. My android device is not letting me download once I hit that "limit". I was sure it was a week ago though. Must be account based (maybe something had changed).

mkb79 commented 2 years ago

This is not a solution, at least we now know why. A rate limit. However, this realization raises further questions. When does the rate limit take effect? I've redownloaded my library and that library from a family member over night. ~450 aaxc files could be downloaded without any errors. But all this titles where buyed (no AYCL). Maybe you can try on the end only, if you can download a buyed item, if you reached your rate limit again.

johnlescault commented 2 years ago

I don't think the limit is a easy one to figure out.

I believe my first "download run" goes much longer than when I am continually trying. It seems once I hit that max, I only get between 70 and 150 books at a time every 12 to 24 hours.

It could be done by file size rather than file count, which would make it hard to calculate as well.

I'm not sure it's worth totally understanding the limit other than for you to be aware it's there for any future tickets that get created on github - if it ever happens. That being said, if you want me to test anything further I'm totally willing to help.

FYI: I don't believe cover files count to the max as I just downloaded 400+ while I was "locked out"

mkb79 commented 2 years ago

I still suspect that it only concerns AYCL titles. I think I will set up a counter for testing purposes, where you can help to test ;)

mkb79 commented 2 years ago

I've created this new branch to count aycl files. Can you test this out and report please. To make sure you have the correct branch, it will print out Using audible_cli with AYCL counter at the beginning of the command output. Thank you.

johnlescault commented 2 years ago

Last night around 10pm (for time keeping). Didn't seem to get near as many as I normally do.

$ audible -v error download --all --aaxc --cover --chapter --pdf --jobs 3 --bunch-size 200 --timeout 90000
Using audible_cli with AYCL counter
error: No COVER found for Absolute Beginner Conversation #5 (German) with given resolution
error: Currently downloaded aycl voucher files: 1
error: Currently downloaded aycl voucher files: 2
error: Currently downloaded aycl voucher files: 3
Fearless_Spies_and_Daring_Deeds_of_World_War_II-AAX_44_128.aaxc: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 57.6M/57.6M [01:55<00:00, 522kB/s]
error: Currently downloaded aycl files: 1Pearl_Harbor-AAX_44_128.aaxc:  63%|███████████████████████████████████████████████████████████████████████████████▎                                              | 53.2M/84.5M [01:55<00:51, 642kB/s]
Smooth_Sea_and_a_Fighting_Chance_The_Story_of_the_Sinking_of_Titanic-AAX_44_128.aaxc:  74%|██████████████████████████████████████████████████████████████████████████████████▍                            | 59.0M/79.4M [02:08<00:23, 925kB/serror: Currently downloaded aycl voucher files: 4arbor-AAX_44_128.aaxc:  73%|███████████████████████████████████████████████████████████████████████████████████████████▊                                  | 61.6M/84.5M [02:07<00:27, 865kB/s]
Smooth_Sea_and_a_Fighting_Chance_The_Story_of_the_Sinking_of_Titanic-AAX_44_128.aaxc: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████| 79.4M/79.4M [02:52<00:00, 484kB/s]
error: Currently downloaded aycl files: 2Pearl_Harbor-AAX_44_128.aaxc:  97%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎   | 82.0M/84.5M [02:51<00:04, 616kB/s]
Day_of_Infamy_The_Story_of_the_Attack_on_Pearl_Harbor-AAX_44_128.aaxc: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 84.5M/84.5M [02:55<00:00, 504kB/s]
error: Currently downloaded aycl files: 3Pearl_Harbor-AAX_44_128.aaxc: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊| 84.3M/84.5M [02:55<00:00, 881kB/s]
Time_Voyage-AAX_44_128.aaxc:  39%|█████████████████████████████████████████████████████████████████                                                                                                       | 23.5M/60.7M [00:46<00:44, 876kB/serror: Currently downloaded aycl voucher files: 5
The_Case_of_the_Stolen_Space_Suit-AAX_44_128.aaxc:   3%|███▊                                                                                                                                              | 1.74M/65.6M [00:03<01:42, 654kB/serror: Currently downloaded aycl voucher files: 6
Time_Voyage-AAX_44_128.aaxc: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 60.7M/60.7M [01:52<00:00, 567kB/s]
error: Currently downloaded aycl files: 4_44_128.aaxc:  37%|████████████████████████████████████████████████████▋                                                                                         | 27.2M/73.3M [00:57<01:40, 479kB/s]
The_Case_of_the_Stolen_Space_Suit-AAX_44_128.aaxc:  52%|████████████████████████████████████████████████████████████████████████████▏                                                                     | 34.2M/65.6M [01:09<00:41, 787kB/serror: Currently downloaded aycl voucher files: 7.aaxc:  45%|███████████████████████████████████████████████████████████████▎                                                                              | 32.7M/73.3M [01:05<00:51, 833kB/s]
The_Case_of_the_Stolen_Space_Suit-AAX_44_128.aaxc: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 65.6M/65.6M [02:16<00:00, 504kB/s]
error: Currently downloaded aycl files: 5_44_128.aaxc:  88%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▍                | 64.8M/73.3M [02:11<00:16, 530kB/s]
The_Glass_Voice-AAX_44_128.aaxc:  38%|█████████████████████████████████████████████████████████████▉                                                                                                      | 30.6M/81.1M [01:05<02:03, 427kB/serror: Currently downloaded aycl voucher files: 8.aaxc:  96%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▍     | 70.4M/73.3M [02:19<00:03, 861kB/s]
The_Prisoners_of_the_Thirteenth_Floor-AAX_44_128.aaxc: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 73.3M/73.3M [02:25<00:00, 529kB/s]
error: Currently downloaded aycl files: 6_44_128.aaxc: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 73.3M/73.3M [02:25<00:00, 462kB/s]
Overboard-AAX_44_128.aaxc:  17%|█████████████████████████████▏                                                                                                                                            | 9.54M/55.6M [00:12<00:49, 981kB/s]error: Currently downloaded aycl voucher files: 9
The_Glass_Voice-AAX_44_128.aaxc: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 81.1M/81.1M [02:47<00:00, 507kB/s]
error: Currently downloaded aycl files: 7█████████████████████████████████████████████████████████████████████████████████████████▋                                                                       | 32.4M/58.2M [01:19<00:52, 520kB/s]
Overboard-AAX_44_128.aaxc:  97%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████     | 54.0M/55.6M [01:37<00:01, 847kB/serror: Currently downloaded aycl voucher files: 10██████████████████████████████████████████████████████████████████████████████████████████▏                                                              | 35.5M/58.2M [01:23<00:28, 823kB/s]
Overboard-AAX_44_128.aaxc: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 55.6M/55.6M [01:40<00:00, 582kB/s]
error: Currently downloaded aycl files: 8███████████████████████████████████████████████████████████████████████████████████████████████████████▎                                                         | 37.3M/58.2M [01:26<00:24, 883kB/s]
Getting_to_the_Bottom_of_Global_Warming_An_Isabel_Soto_Investigation-AAX_44_128.aaxc:   1%|█▏                                                                                                              | 156k/14.1M [00:00<00:46, 317kB/s]error: Currently downloaded aycl voucher files: 11███████████████████████████████████████████████████████████████████████████████████████████████████████████████▊                                       | 44.0M/58.2M [01:31<00:11, 1.35MB/s]
Getting_to_the_Bottom_of_Global_Warming_An_Isabel_Soto_Investigation-AAX_44_128.aaxc: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████| 14.1M/14.1M [00:28<00:00, 526kB/s]
error: Currently downloaded aycl files: 9████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊| 58.2M/58.2M [01:58<00:00, 485kB/s]
An_Unsinkable_Ship-AAX_44_128.aaxc: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 58.2M/58.2M [01:59<00:00, 509kB/s]
error: Currently downloaded aycl files: 10
                                                                                                                                                                                                                                             error: Currently downloaded aycl voucher files: 12
Swamp_Sting_Carlys_Angels-AAX_44_128.aaxc:   4%|██████▉                                                                                                                                                    | 490k/10.7M [00:00<00:18, 579kB/s]error: Currently downloaded aycl voucher files: 13
Swamp_Sting_Carlys_Angels-AAX_44_128.aaxc: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10.7M/10.7M [00:22<00:00, 491kB/s]
error: Currently downloaded aycl files: 118.aaxc:  10%|███████████████                                                                                                                                    | 6.29M/61.4M [00:20<01:57, 491kB/s]
Dandelion_and_the_Witch-AAX_44_128.aaxc:  41%|███████████████████████████████████████████████████████████████▋                                                                                            | 33.6M/82.3M [00:56<01:40, 507kB/serror: Currently downloaded aycl voucher files: 14  14%|████████████████████▋                                                                                                                              | 8.63M/61.4M [00:25<01:27, 630kB/s]
Double_Trouble_Jimmy_Sniffles-AAX_44_128.aaxc: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6.28M/6.28M [00:16<00:00, 393kB/s]
error: Currently downloaded aycl files: 128.aaxc:  27%|████████████████████████████████████████▏                                                                                                          | 16.8M/61.4M [00:43<01:27, 532kB/s]
Dandelion_and_the_Witch-AAX_44_128.aaxc:  60%|█████████████████████████████████████████████████████████████████████████████████████████████▎                                                              | 49.2M/82.3M [01:19<00:52, 665kB/serror: Currently downloaded aycl voucher files: 15  33%|████████████████████████████████████████████████▌                                                                                                  | 20.3M/61.4M [00:49<00:57, 755kB/s]
The_Dung_Beetle_Bandits-AAX_44_128.aaxc: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10.4M/10.4M [00:22<00:00, 484kB/s]
error: Currently downloaded aycl files: 138.aaxc:  51%|██████████████████████████████████████████████████████████████████████████▍                                                                        | 31.1M/61.4M [01:12<01:06, 480kB/s]
Dandelion_and_the_Witch-AAX_44_128.aaxc:  80%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏                              | 66.0M/82.3M [01:48<00:30, 551kB/serror: Currently downloaded aycl voucher files: 16  57%|███████████████████████████████████████████████████████████████████████████████████▍                                                               | 34.8M/61.4M [01:18<00:34, 797kB/s]
Dandelion_and_the_Witch-AAX_44_128.aaxc: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 82.3M/82.3M [02:17<00:00, 626kB/s]
error: Currently downloaded aycl files: 148.aaxc:  76%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████▌                                   | 46.6M/61.4M [01:41<00:32, 480kB/s]
Beauty_and_the_Dreaded_Sea_Beast-AAX_44_128.aaxc:  92%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊           | 12.2M/13.2M [00:27<00:01, 727kB/serror: Currently downloaded aycl voucher files: 17  83%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌                        | 51.2M/61.4M [01:47<00:12, 859kB/s]
Beauty_and_the_Dreaded_Sea_Beast-AAX_44_128.aaxc: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 13.2M/13.2M [00:29<00:00, 470kB/s]
error: Currently downloaded aycl files: 158.aaxc:  85%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋                     | 52.4M/61.4M [01:49<00:08, 1.09MB/s]
Wild_Hike-AAX_44_128.aaxc:   7%|████████████▌                                                                                                                                                             | 2.49M/33.8M [00:05<01:01, 530kB/serror: Currently downloaded aycl voucher files: 18  96%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏     | 58.9M/61.4M [01:55<00:02, 1.10MB/s]
The_Case_of_the_Stolen_Sculpture-AAX_44_128.aaxc: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 61.4M/61.4M [01:59<00:00, 539kB/s]
error: Currently downloaded aycl files: 168.aaxc: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊| 61.3M/61.4M [01:58<00:00, 803kB/s]
Wild_Hike-AAX_44_128.aaxc:  33%|████████████████████████████████████████████████████████▏                                                                                                                | 11.2M/33.8M [00:16<00:20, 1.18MB/serror: Currently downloaded aycl voucher files: 19
The_Scary_Night_A_Robot_and_Rico_Story-AAX_44_128.aaxc: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4.33M/4.33M [00:13<00:00, 348kB/s]
error: Currently downloaded aycl files: 17_44_128.aaxc:   4%|█████▎                                                                                                                                       | 1.13M/30.0M [00:02<00:36, 830kB/s]
Wild_Hike-AAX_44_128.aaxc:  53%|██████████████████████████████████████████████████████████████████████████████████████████▉                                                                               | 18.1M/33.8M [00:25<00:20, 819kB/serror: Currently downloaded aycl voucher files: 20.aaxc:  18%|█████████████████████████▍                                                                                                                   | 5.41M/30.0M [00:08<00:33, 779kB/s]
Wild_Hike-AAX_44_128.aaxc: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 33.8M/33.8M [00:56<00:00, 630kB/s]
error: Currently downloaded aycl files: 18_44_128.aaxc:  68%|████████████████████████████████████████████████████████████████████████████████████████████████▍                                            | 20.5M/30.0M [00:38<00:15, 625kB/s]
Nuclear_Distraction_Recon_Academy-AAX_44_128.aaxc: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 13.5M/13.5M [00:31<00:00, 443kB/s]
error: Currently downloaded aycl files: 19_44_128.aaxc:  75%|████████████████████████████████████████████████████████████████████████████████████████████████████████▍                                   | 22.4M/30.0M [00:40<00:07, 1.00MB/s]
Nuclear_Distraction_Recon_Academy-AAX_44_128.aaxc: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊| 13.4M/13.5M [00:30<00:00, 724kB/serror: Currently downloaded aycl voucher files: 21.aaxc:  96%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋     | 28.8M/30.0M [00:45<00:00, 1.61MB/s]
Blizzard_A_Tale_of_Snow-blind_Survival-AAX_44_128.aaxc: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 30.0M/30.0M [00:48<00:00, 653kB/s]
error: Currently downloaded aycl files: 20_44_128.aaxc:  98%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊  | 29.5M/30.0M [00:46<00:00, 1.60MB/s]
The_Lava_Crown_Troll_Hunters-AAX_44_128.aaxc:   0%|                                                                                                                                                               | 0.00/70.9M [00:00<?, ?B/s]error: Currently downloaded aycl voucher files: 22
The_Lava_Crown_Troll_Hunters-AAX_44_128.aaxc:   6%|████████▌                                                                                                                                             | 4.07M/70.9M [00:04<01:01, 1.13MB/serror: Currently downloaded aycl voucher files: 23███████████████                                                                                                                                          | 1.38M/9.65M [00:02<00:11, 730kB/s]
Caught_in_a_Pickle-AAX_44_128.aaxc: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 9.65M/9.65M [00:21<00:00, 476kB/s]
error: Currently downloaded aycl files: 21███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 9.60M/9.65M [00:21<00:00, 576kB/s]
The_Case_of_the_Missing_Mom_Museum_Mysteries-AAX_44_128.aaxc: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 61.6M/61.6M [01:27<00:00, 740kB/s]
error: Currently downloaded aycl files: 22
The_Lava_Crown_Troll_Hunters-AAX_44_128.aaxc: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 70.9M/70.9M [01:52<00:00, 658kB/s]
error: Currently downloaded aycl files: 23
error: Currently downloaded aycl voucher files: 24
Gulf_Coast_Moonlight_Blackbird_Beach_Book_5-AAX_44_128.aaxc:  30%|████████████████████████████████████████▏                                                                                               | 90.8M/307M [01:08<02:02, 1.85MB/s]error: Two Firsts: Bertha Wilson and Claire L'Heureux Dubé at the Supreme Court of Canada (A Feminist History Society, Book 9) is not downloadable.
Gulf_Coast_Moonlight_Blackbird_Beach_Book_5-AAX_44_128.aaxc: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 307M/307M [04:04<00:00, 1.32MB/s]
error: Currently downloaded aycl files: 24
error: Voucher /mnt/12tb_1/Audible RIPs/0Audible Plus RAW/What_If_There_Were_No_Lemmings_A_Book_About_the_Tundra_Ecosystem_(Food_Chain_Reactions)-AAX_44_128.voucher need a refresh. Please remove this file and try again.
error: Voucher /mnt/12tb_1/Audible RIPs/0Audible Plus RAW/Tuckerbean_on_the_Moon-AAX_44_128.voucher need a refresh. Please remove this file and try again.
^CThe download ended with the following result:
New aaxc files: 24
New chapter files: 20
New cover files: 2204
New pdf files: 1
New voucher files: 24
New aycl files: 24
New aycl voucher files: 24
/usr/lib/python3.8/asyncio/events.py:81: RuntimeWarning: coroutine 'download_cover' was never awaited
  self._context.run(self._callback, *self._args)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
/usr/lib/python3.8/asyncio/events.py:81: RuntimeWarning: coroutine 'download_pdf' was never awaited
  self._context.run(self._callback, *self._args)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
/usr/lib/python3.8/asyncio/events.py:81: RuntimeWarning: coroutine 'download_chapters' was never awaited
  self._context.run(self._callback, *self._args)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
/usr/lib/python3.8/asyncio/events.py:81: RuntimeWarning: coroutine 'download_aaxc' was never awaited
  self._context.run(self._callback, *self._args)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

Aborted!
mkb79 commented 2 years ago

The last two errors you got before you cancel the execution have nothing todo with a rate limit. The meaning is: These two voucher files are downloaded for some weeks. You can remove them and rerun the execution or simply don't halt on these errors. I will implement a automatically refresh for such cases soon!

Update: I've implemented an automatically refresh for such errors in the count-aycl-files branch!

johnlescault commented 2 years ago

The last two errors you got before you cancel the execution have nothing todo with a rate limit. The meaning is: These two voucher files are downloaded for some weeks. You can remove them and rerun the execution or simply don't halt on these errors.

The errors were there for 10 hours, it was definately stopped already.

I ran a new one since 6am now (it is 8:40am now) and got the following output (it is stuck again):

$ audible -v error download --all --aaxc --cover --chapter --pdf --jobs 3 --bunch-size 200 --timeout 90000
Using audible_cli with AYCL counter
error: No COVER found for Absolute Beginner Conversation #5 (German) with given resolution
error: Two Firsts: Bertha Wilson and Claire L'Heureux Dubé at the Supreme Court of Canada (A Feminist History Society, Book 9) is not downloadable.
error: Voucher /mnt/12tb_1/Audible RIPs/0Audible Plus RAW/What_If_There_Were_No_Lemmings_A_Book_About_the_Tundra_Ecosystem_(Food_Chain_Reactions)-AAX_44_128.voucher need a refresh. Please remove this file and try again.
error: Voucher /mnt/12tb_1/Audible RIPs/0Audible Plus RAW/Tuckerbean_on_the_Moon-AAX_44_128.voucher need a refresh. Please remove this file and try again.

I will update and test out the refresh!

mkb79 commented 2 years ago

I've extend the --ignore-errors option for the download command on my latest commit. Next time you got an error the program will continue with the next item if you use it.

johnlescault commented 2 years ago

Is this a new update or the same (count-aycl-files branch) one from when I commented last?

mkb79 commented 2 years ago

That's a new one with extended ignore error option (if provided)!

johnlescault commented 2 years ago

Ok - I ran the new one with --ignore error, it gave me something that I assume is an HTML error page (over 4000 lines).

I think the books that say "is not downloadable" are audible plus books that haven't been released yet - it seems audible now allows you to add to library before released which I think is new and my script added them.

mkb79 commented 2 years ago

I think the books that say "is not downloadable" are audible plus books that haven't been released yet

That’s the reason for this error. Try to download them as aaxc, successfully raises an error that it is not downloadable. But if he try to download the pdf, there is no such error detection. He will then open a page like this which will be outputted in the cli.

I can’t add a not released book to my library. How do you do it?

Edit: I've added this item via the API now. I don't found a solution on the website (without paying additional money or spend a credit).

mkb79 commented 2 years ago

The asin B09TRVD2B5 (True Heart Intuitive Tarot) have multiple dates for the release. A publication_datetime with 2022-11-11T08:00:00Z, a preorder_release_date with 2022-11-11T08:00:00Z and a issue_date with 2022-11-11.

I think the first one is the right to check the release date?! What do you think?

johnlescault commented 2 years ago

I can’t add a not released book to my library. How do you do it?

On the .ca website it shows "Included in your membership This title will be released on 2022-11-11, but you can add it to your Library now."

I have a tampermonkey script that adds them, it just looks for the "Add to library" button on it's own and loops through all the pages. Didn't know it was possible over the API! That would be much easier... Might have to figure out how to do that.

johnlescault commented 2 years ago

The asin B09TRVD2B5 (True Heart Intuitive Tarot) have multiple dates for the release. A publication_datetime with 2022-11-11T08:00:00Z, a preorder_release_date with 2022-11-11T08:00:00Z and a issue_date with 2022-11-11.

I think the first one is the right to check the release date?! What do you think?

I mean they all point to the same day, except two are datetime vs one being just date. Is there any way to have the program just ignore anything not yet released? Maybe it can throw an error, but just move on?

johnlescault commented 2 years ago

Is there a reason that every time I run the script (I should be all caught up in downloads now) I seem to catch 1 or 2 new books?

I get similar results to the following (without adding new books) New aaxc files: 2 New voucher files: 1 New aycl files: 2 New aycl voucher files: 1

I've done this about 4-5 times now and seems like its finding random new books...

Edit: after running those 4-5 times it seems to have finally found them all.

mkb79 commented 2 years ago

I have a tampermonkey script that adds them, it just looks for the "Add to library" button on it's own and loops through all the pages. Didn't know it was possible over the API! That would be much easier... Might have to figure out how to do that.

You can add a title via this endpoint. I've tested this only with included titles. To purchase a title and add them to the library, you can use this endpoint.

I mean they all point to the same day, except two are datetime vs one being just date.

In case of the book mentioned, the dates are equal. But is there a difference in publication_datetime vs. preorder_release_date in other books?

Is there any way to have the program just ignore anything not yet released?

I will implement this. But which key from above I should use if they are not identical?

Is there a reason that every time I run the script (I should be all caught up in downloads now) I seem to catch 1 or 2 new books?

There can be multiple reasons for this.

  1. The book failed to download before
  2. The aaxc files is moved out of the download folder
  3. These are podcasts. I have some podcasts, which release new episodes often each day.

You can try this out next time by providing the --ignore-podcasts option or provide the same end date via the --end-date option. This way you can expel reason number 3.

johnlescault commented 2 years ago

I think I would use publication_datetime. Seems like it would be more streamline, especially considering it seems like pre-order is new.

Thanks. I don't have any podcasts in the library but will add that option.

I've also noticed another issue, my downloads get "stuck" it seems quiet often on large download files. I am running -v debug as I was hoping it would show anything but nothing.

debug: Currently downloaded chapters: 1
debug: Currently downloaded voucher files: 1
error: Currently downloaded aycl voucher files: 1
Voucher file saved to /mnt/12tb_1/Audible RIPs/0Audible Plus RAW/Parnos_Company_The_Black_Sheep_of_Soulan_Book_1-AAX_44_128.voucher.
debug: Currently saved voucher files: 1
Parnos_Company_The_Black_Sheep_of_Soulan_Book_1-AAX_44_128.aaxc:  59%|██████████████████████████████████████████████████████████████████████████████▏                                                     | 614M/1.01G [08:00<05:33, 1.33MB/s]

This has been stuck at 614M for the past 6 hours now.

I have bad internet here, so I assume that may be the issue. Would there be a way to make the script check if the download hasn't changed in say something like 10minutes, it either retries, restarts or skips the file and throw an error so we can monitor?

mkb79 commented 2 years ago

I think I would use publication_datetime.

Great. That’s my intention too.

Okay. I will try to implement such a function.

mkb79 commented 2 years ago

I've added a check for the publication date in the latest count-aycl-branch. If this is working for you I will move all changes to the master branch. Should I let in the AYCL counter?!

johnlescault commented 2 years ago

Everything seems to be working good! I would say AYCL counter should probably be there for the -v debug option only? I found it very useful, but I'm not sure all users would think that!