audible-cli icon indicating copy to clipboard operation
audible-cli copied to clipboard

Download by author?

Open taxilian opened this issue 1 year ago • 5 comments

Hey,

I've been using this tool for awhile -- it's fantastic, thank you so much for your work on it. Would it be possible to add support for downloading by author? Series would be even better, but I'm guessing that'd be a long shot =]

I'd be willing to take a stab at implementing it and submitting a PR, but some idea of if it's plausible and direction on where in the code to start would help.

Thanks!

taxilian avatar Feb 09 '24 16:02 taxilian

@taxilian Hi, Yeah adding support for author or/and series, like the title option, is possible. Your help is welcome.

I'm thinking adding a method in audible_cli.models.BaseList would be the best place. An example method for searching a title is audible_cli.models.BaseList.search_item_by_title.

The authors can be accessed via the authors attribute of a BaseItem. It will give you a list like [{'asin': 'B004AQ1W8Y', 'name': 'James Corey'}, {'asin': None, 'name': 'Jürgen Langowski - Übersetzer'}]

The series can be found using series attribute of a BaseItem. The result is [{'asin': 'B07CT7ZML4', 'sequence': '9', 'title': 'The Expanse-Serie', 'url': '/pd/The-Expanse-Serie-Hoerbuch/B07CT7ZML4'}] or None.

After implementing the new method, the download command can be extended to find the author or Serie like it does for the title.

mkb79 avatar Feb 09 '24 17:02 mkb79

... huh. well, I think I can probably add "series" in easily enough, but authors is always None on every book. any idea why?

taxilian avatar Feb 13 '24 02:02 taxilian

https://github.com/mkb79/audible-cli/commit/ad28dfbe6129b4f5642cb123b2b196b01b6d81fc -- Here is my attempt to implement it, but since authors is always None it doesn't ever find anything. Series appears to be working, though

taxilian avatar Feb 13 '24 02:02 taxilian

@taxilian

but since authors is always None it doesn't ever find anything

The reason for this is the missing contributors in the response_groups. You have to add it on Line 828 in cmd_download.py. I'm sorry I forgot to mention it before.

mkb79 avatar Feb 13 '24 05:02 mkb79

Yep, that fixed it and it works now =] PR created

taxilian avatar Feb 13 '24 15:02 taxilian