Comments (4)
I'm still getting an error related to the long filename but the error code is 63 so the exception is not being caught.
'python3 -m odmpy -v dl -c -k -f -j OrsonScottCardsIntergalacticMedicineS9781482999198.odm'
File "/Users/diego/Downloads/odmpy-master/odmpy/odm.py", line 282, in run
os.makedirs(book_folder)
File "/usr/local/Cellar/[email protected]/3.8.6/Frameworks/Python.framework/Versions/3.8/lib/python3.8/os.py", line 223, in makedirs
mkdir(name, mode)
OSError: [Errno 63] File name too long: "./Orson Scott Card's Intergalactic Medicine Show - Orson Scott Card, Edmund R. Schubert, Wayne Wightman, Stefan Rudnicki, Gabrielle De Cuir, Roxanne Hernandez, Arthur Morey, Emily Janice Card, Paul Boehmer, Various Narrators, Claire Bloom, Susan Hanfield, Mary Robinette Kowal, Eric James Stone, Aliette de Bodard, Others"
Seems like the error codes are not standard in different OSs Popular Errno Codes by Platform
I changed the OSError value to 63
Lines 283 to 286 in 69ba511
The error gets caught and the execution continues but the directory isn't created.
File "/Users/diego/Downloads/odmpy-master/odmpy/odm.py", line 299, in run
with open(cover_filename, 'wb') as outfile:
FileNotFoundError: [Errno 2] No such file or directory: "./Orson Scott Card's Intergalactic Medicine Show/cover.jpg"
I added a new line to create the directory after the error gets caught like this
book_folder = os.path.join(
args.download_dir, u'{}'.format(title.replace(os.sep, '-')))
os.makedirs(book_folder)
And the download progresses as expected.
Saved "./Orson Scott Card's Intergalactic Medicine Show/orson-scott-cards-intergalactic-medicine-show-part-12.mp3"
It fails to create the merged mp3 file since it is trying to use the full name for the output file.
./Orson Scott Card's Intergalactic Medicine Show/Orson Scott Card's Intergalactic Medicine Show - Orson Scott Card, Edmund R. Schubert, Wayne Wightman, Stefan Rudnicki, Gabrielle De Cuir, Roxanne Hernandez, Arthur Morey, Emily Janice Card, Paul Boehmer, Various Narrators, Claire Bloom, Susan Hanfield, Mary Robinette Kowal, Eric James Stone, Aliette de Bodard, Others.mp3: File name too long
ffmpeg exited with the code: 1
from odmpy.
This is an OS error because the filename is too long (over 300 characters in this case) so the OS can't create the directory.
I checked this particular odm file and since the book is a compilation there is not author tag, they are all attributed as Contributor, Narrators and one Editor.
It should be easy to handle this error but I'm not sure what the proper way to name the folder and file would be in this case.
One option would be to arbitrarily cut the directory name to a safe value.
A better one would be to use the Editor's name in the cases where the Author tag is missing. I checked several compilations in the library catalog and they seem to prefer to use the Editor's name where the author would usually be listed. For example John Joseph Adams is the editor of several sci fi collections and his name appears under the title in the search results.
I personally prefer the following convention "Author Name - Book Name.ext" or "Editor Name - Book Name.ext" in the case of compilations.
from odmpy.
I've chosen to drop all authors from the book folder name when OS error 36 occurs. It's probably not the most ideal solution but hopefully a reasonable enough fix for an edge case like this.
In the reported case, the book folder will now just be audiobooks/Orson Scott Card's Intergalactic Medicine Show/
.
from odmpy.
@Diegus83 Thanks for the catch. Added a couple more fixes to address the issues you raised.
from odmpy.
Related Issues (20)
- Feature: Download books that can only be read with the Libby app HOT 3
- Is the latest version of this project 0.8.0 or 0.80? HOT 2
- Intermittenly, odmpy libby has time data value error HOT 2
- odmpy libby download issue HOT 2
- odmpy crashes when downloading audiobooks on 0.8.1 HOT 2
- How can i use it? I do not know python. HOT 2
- Long chapters are split into too-small chapters with duplicate names HOT 2
- Invalid date string HOT 4
- The --selectid option gets only the last ID in the list HOT 8
- [Feature] Multiple Subfolders
- 403 error upon using odmlibby HOT 11
- Breaking Changes HOT 1
- 403 Client Error HOT 4
- Error 1002 Hash Mismatch - HTTP Error while downloading license.
- Unable to access Libby through odmpy due to Traceback error HOT 1
- Magazines not downloading -- Error below HOT 1
- Program 'failed to create process'
- 403 Forbidden Error HOT 28
- audio books not downloading HOT 23
- OSError: [Errno 36] File name too long HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from odmpy.