Comments (8)
Try this temporary project here.
I have added a new option where you can specify the maximum filename length using -m
option. The command below sets it to a maximum of 100 and downloads only the Primer on the Rheumatic Diseases
book.
python main.py -m 100 -i 17
If you omit the option, it defaults to 145. Please try to find the best length that works. Let me know.
from springer_free_books.
Sorry ChaosAD. I think I spoke too early.
After cloning from the temporary project (https://github.com/chaosAD/springer_free_books.git), and trying the -m option, the script throws out an error about not recognising the "-m" argument.
There's a different behaviour from the new script though, it continues downloading onto the next book when it encounters one with a name too long (the old one did not).
`(.venv)[BaCKuPS][~/springer_free_books]$ python main.py -m 120 -i 182 184 261 310 311 17
usage: main.py [-h] [-f FOLDER] [--pdf] [--epub] [-c CATEGORY [CATEGORY ...]]
[-i BOOK_INDEX [BOOK_INDEX ...]] [-v]
main.py: error: unrecognized arguments: -m 120
`
from springer_free_books.
You cloned from the wrong branch. You should have used the link I gave you. But anyway, I have fixed this issue in PR #79. Since it needs time for Alex to accept my PR, I suggest you clone it from my repository below:
https://github.com/chaosAD/springer_free_books/tree/95380990cc5c0db9b05308f9f930ea433e10884b
The new code determine the maximum filename length automatically, so you don't issue the -m
option anymore. Let me know if you encounter anymore issue.
Note: If you are downloading books by indices (-i
option), you need to take note that the index numbering now is different than the older Python script. Check this PR #74 to learn more.
from springer_free_books.
Thanks to whoever fixed this, unfortunately looks like this code is reverted because it wasn't working in Python3?
I got:
TypeError: Unicode-objects must be encoded before hashing
Someone reverted it a few minutes ago.
from springer_free_books.
Yes, Alex reverted it because it wasn't working on Python3. He showed me the same error as you did. Could you try this commit? Let me know if it works.
from springer_free_books.
Still no luck here with the last commit suggested:
`(.venv) [BaCKuPS][~/springer_free_books]$ python main.py
407 titles ready to be downloaded...
Traceback (most recent call last):
File "main.py", line 72, in
download_books(books, folder, patches)
File "/home/xuxo/springer_free_books/helper.py", line 98, in download_books
max_length = get_max_filename_length(folder)
File "/home/xuxo/springer_free_books/helper.py", line 163, in get_max_filename_length
name = get_random_string(mid)
File "/home/xuxo/springer_free_books/helper.py", line 153, in get_random_string
for i in range(0, (length / 128 + 1)):
TypeError: 'float' object cannot be interpreted as an integer
`
from springer_free_books.
I have just fixed that issue. Try this latest commit.
from springer_free_books.
Hi there. Many thanks again chaosAD.
All working here after the latest commit.
from springer_free_books.
Related Issues (20)
- object of type 'float' has no len() HOT 1
- Problem with run_VirtualEnv.bat HOT 1
- Duplicate downloading the pdf files as epub
- Possible Introduction of reCaptcha by Springer? HOT 1
- Error: probably not a valid book HOT 7
- Please share the archive HOT 2
- Somebody please mirror and make a torrent HOT 3
- [Feature Request] Springer's 1000 open-access books HOT 2
- Link to the downloaded books HOT 3
- Use specific User-Agent to bypass Google captcha HOT 1
- in windows : import pandas report error ImportError: DLL load failed while importing aggregations:找不到指定模块
- excel file indices missing - can't download specific books HOT 8
- AttributeError: 'Int64Index' object has no attribute 'array' HOT 4
- HTTP Error 404: Not Found HOT 4
- Where are the downloaded files? HOT 2
- HTTP Error 404 Not Found but I was able to manually download spreadsheet HOT 4
- I just found all the download links HOT 15
- KeyError: 'content-length' HOT 8
- Problem with Docker/Raspberry Pi
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 springer_free_books.