Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The --selectid option gets only the last ID in the list #60

Open
wtanksleyjr opened this issue Nov 29, 2023 · 8 comments
Open

The --selectid option gets only the last ID in the list #60

wtanksleyjr opened this issue Nov 29, 2023 · 8 comments

Comments

@wtanksleyjr
Copy link

Describe the problem
When processing a loan export to get the books I hadn't previously downloaded and moved to their final resting place, I find that the --selectid option only downloads one book, the last ID on the list.

To Reproduce
Download your loan file odmpy libby --loans, grab a few IDs from it. Run 'em using the batch mode:

odmpy libby --bookfolderformat './tmp/%(ID)s' --hideprogress --direct --selectid 4790886 4565785

Result:

odmpy Interactive Client for Libby                                                                                                                                                                               ----------------------------------------------------------------------
Non-interactive mode. Downloading loans with IDs 4790886, 4565785...
Opening audiobook "The Lives of Bees"...
Downloading "The Lives of Bees" by "Thomas D. Seeley" in 12 parts...
Error saving ID3: Invalid date string: 2019-05-28T04:00:00+00:00
Saved "tmp/4565785/the-lives-of-bees-part-01.mp3"
Error saving ID3: Invalid date string: 2019-05-28T04:00:00+00:00
Saved "tmp/4565785/the-lives-of-bees-part-02.mp3"
Error saving ID3: Invalid date string: 2019-05-28T04:00:00+00:00
Saved "tmp/4565785/the-lives-of-bees-part-03.mp3"
Error saving ID3: Invalid date string: 2019-05-28T04:00:00+00:00
Saved "tmp/4565785/the-lives-of-bees-part-04.mp3"
Error saving ID3: Invalid date string: 2019-05-28T04:00:00+00:00
Saved "tmp/4565785/the-lives-of-bees-part-05.mp3"
Error saving ID3: Invalid date string: 2019-05-28T04:00:00+00:00
Saved "tmp/4565785/the-lives-of-bees-part-06.mp3"
Error saving ID3: Invalid date string: 2019-05-28T04:00:00+00:00
Saved "tmp/4565785/the-lives-of-bees-part-07.mp3"
Error saving ID3: Invalid date string: 2019-05-28T04:00:00+00:00
Saved "tmp/4565785/the-lives-of-bees-part-08.mp3"
Error saving ID3: Invalid date string: 2019-05-28T04:00:00+00:00
Saved "tmp/4565785/the-lives-of-bees-part-09.mp3"
Error saving ID3: Invalid date string: 2019-05-28T04:00:00+00:00
Saved "tmp/4565785/the-lives-of-bees-part-10.mp3"
Error saving ID3: Invalid date string: 2019-05-28T04:00:00+00:00
Saved "tmp/4565785/the-lives-of-bees-part-11.mp3"
Error saving ID3: Invalid date string: 2019-05-28T04:00:00+00:00
Saved "tmp/4565785/the-lives-of-bees-part-12.mp3"
Downloaded acsm to "tmp/4790886/The Lives of Bees - Thomas D. Seeley.acsm"

No error printed, but it only got the one book. I've tried this with multiple IDs, no success.

Version/Environment
odmpy 0.8.1 [Python 3.10.12-linux]

@collinscochran
Copy link

If you use the same two IDs in a list and reverse their position, does it get the opposite book?

@wtanksleyjr
Copy link
Author

wtanksleyjr commented Dec 28, 2023 via email

@collinscochran
Copy link

No; in fact I'm confused now. It doesn't get either one when I reverse the positions. It's almost like being the first one on the list poisons that ID so it can't be downloaded.

On Thu, Dec 28, 2023 at 6:41 AM collinscochran @.> wrote: If you use the same two IDs in a list and reverse their position, does it get the opposite book? — Reply to this email directly, view it on GitHub <#60 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ7H6MKEF4HODJNQNXH733YLWAJLAVCNFSM6AAAAABAAFFUOOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZRGIZTMNJQGA . You are receiving this because you authored the thread.Message ID: @.>

Very odd, I'm currently using that same workflow (####### ####### ####### etc) to download specific ID's and it seems to work. These are just values you pulled from the id in the loans?

@wtanksleyjr
Copy link
Author

Yes, the IDs in the json loans dump. I'm trying to make this work as a replacement for a python script that does this all automatically (and got taken down from github, probably for that reason, so let's be careful). So you're saying you run --selectid with multiple IDs it does work? Are you maybe not using direct (maybe I should try without)?

@collinscochran
Copy link

collinscochran commented Dec 28, 2023

Yes, the IDs in the json loans dump. I'm trying to make this work as a replacement for a python script that does this all automatically (and got taken down from github, probably for that reason, so let's be careful). So you're saying you run --selectid with multiple IDs it does work? Are you maybe not using direct (maybe I should try without)?

Yeah, try it without the direct and see if it works.

The command I'm running now which works is odmpy libby --selectid 1111111 2222222 3333333 -d /mnt/audiobooks -m --mergeformat m4b --nobookfolder -c

That will run through the list and skip any missing/not available, and leave them in my /mnt/audiobooks folder as m4b's with chapters.

@wtanksleyjr
Copy link
Author

CONFIRMED! Thank you, this gives me enough to press forward - the problem must have been in the combination of --direct and --direct, without the latter it works just fine.

@wtanksleyjr
Copy link
Author

Um, yeah, I meant --direct and --selectid. Sorry.

@collinscochran
Copy link

No problem! I'm doing basically the same thing as you... i scrape for loaned books, if the array of ID changes it compares, then automatically downloads the id returned. Works well so far!

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

No branches or pull requests

2 participants