GithubHelp home page GithubHelp logo

Comments (8)

chaosAD avatar chaosAD commented on July 26, 2024

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.

jesusgt avatar jesusgt commented on July 26, 2024

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.

chaosAD avatar chaosAD commented on July 26, 2024

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.

agkini avatar agkini commented on July 26, 2024

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.

chaosAD avatar chaosAD commented on July 26, 2024

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.

jesusgt avatar jesusgt commented on July 26, 2024

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.

chaosAD avatar chaosAD commented on July 26, 2024

I have just fixed that issue. Try this latest commit.

from springer_free_books.

jesusgt avatar jesusgt commented on July 26, 2024

Hi there. Many thanks again chaosAD.
All working here after the latest commit.

from springer_free_books.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.