chbrown / overdrive

Bash script to download mp3s from the OverDrive audiobook service
451 stars 66 forks source link

Check that files in MEDIA array exist #41

Closed chbrown closed 2 years ago

chbrown commented 3 years ago

Current behavior is just to assume all supplied paths are good; if a path is missing, xmllint will fail with a cryptic error message:

$ overdrive download DoesNotExist.odm
Generating random ClientID=B49967C8-61F8-4365-88E0-F5C822B13235
warning: failed to load external entity "DoesNotExist.odm"

This is an unusual error case, but when it does arise, the fatal "warning" can be confusing / misleading, and the proper solution of explicitly checking for existence as a preliminary step is trivial.

See, e.g., #40, comments 3–4.