Coder Social home page Coder Social logo

ilyakharlamov / bookmate_downloader Goto Github PK

View Code? Open in Web Editor NEW
63.0 7.0 20.0 37 KB

Download books as epub from bookmate.com

License: MIT License

Python 96.86% Dockerfile 3.14%
bookmate bookmate-downloader epub python python3 download downloader ebook

bookmate_downloader's Introduction

⭐️ My Stack:

Java Kotlin Postgres Python bash vim

📫 How to reach me

Linkedin: ilyakharlamov GitHub ilyakharlamov

bookmate_downloader's People

Contributors

dejanzelic avatar dependabot[bot] avatar ilyakharlamov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bookmate_downloader's Issues

Turkish Books

Thanks for codes.. Turkish books are not downloaded.
code

Is possible to adapt the code to Perlego?

I'm a personal fan of this script. Recently I've discovered Perlego, which has a great collection that compliment the one of Bookmate. I think their system is quite similar to bookmate. It would be possible to make a version adapted to this service?

Error on Book Download

Hello, thank you for this project.

Unfortunately, I have problems downloading a book with this script:

ERROR bookmate_downloader.process_opf():191 cannot download from 'https://reader.bookmate.com/p/a/4/d/dJAgbfVH/contents/OEBPS/cover.jpg'

I tried different books (i.e. this one: https://reader.bookmate.com/fDd3Kbpv )

python3 src/python3/bookmate_downloader.py --bookid fDd3Kbpv on Mac OS X.

Do you have an idea, what the problem could be?

Thanks 🙏

Error

SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats

Hello! I got this error
I did all steps, python3 src/python3/bookmate_downloader.py --bookid KFHDG3bp
after wrote down bookmate id and got the error. Can you help please?

I don't know python

Can't open requirements.txt

$ pip install -r requirements.txt

ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'

Perlego

hello there
i would like to know if you can build another repo for Perlego as well.
do you think is it possible?

best

Crypto replace required on some(?) systems

As a user of Linux Mint and python 3.10.6...

Kernel: 5.15.0-56-generic x86_64 bits: 64 compiler: gcc v: 11.3.0 Desktop: Xfce 4.16.0
    tk: Gtk 3.24.23 wm: xfwm dm: LightDM Distro: Linux Mint 21.1 Vera base: Ubuntu 22.04 jammy

...I came across a problem in using the script:

Traceback (most recent call last):
  File "/home/.../bookmate_downloader/src/python3/bookmate_downloader.py", line 249, in <module>
    book.download()
  File "/home/.../bookmate_downloader/src/python3/bookmate_downloader.py", line 133, in download
    metadata = self.decrypt_metadata(encrypted_metadata, self.secret)
  File "/home/.../bookmate_downloader/src/python3/bookmate_downloader.py", line 148, in decrypt_metadata
    metadata[key] = self.decrypt(secret, bytess(val))
  File "/home/.../bookmate_downloader/src/python3/bookmate_downloader.py", line 156, in decrypt
    bts = self.rawDecryptBytes(data[16:], key, data[:16])
  File "/home/.../bookmate_downloader/src/python3/bookmate_downloader.py", line 166, in rawDecryptBytes
    cipher = AES.new(key, AES.MODE_CBC, iv)
  File "/home/.../.local/lib/python3.10/site-packages/Crypto/Cipher/AES.py", line 95, in new
    return AESCipher(key, *args, **kwargs)
  File "/home/.../.local/lib/python3.10/site-packages/Crypto/Cipher/AES.py", line 59, in __init__
    blockalgo.BlockAlgo.__init__(self, _AES, key, *args, **kwargs)
  File "/home/.../.local/lib/python3.10/site-packages/Crypto/Cipher/blockalgo.py", line 141, in __init__
    self._cipher = factory.new(key, *args, **kwargs)
SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats

This SO answer helped me: https://stackoverflow.com/a/73713926

pip uninstall pycrypto
pip install pycryptodome

requirements короче надо обновить наверное. Или дополнить описание.

Epub formatting issue - "Opening and ending tag mismatch"

Output epub files have a formatting issue, which most reader apps complain about or simply don't open the file. Only Calibre's e-book reader was able to open it. By checking the file, I came up with these issues:

  • iBooks app stated it as "Opening and ending tag mismatch: link line 0 and head"
  • Using epub validator tool, I came up with many "Error while parsing file: The element type "link" must be terminated by the matching end-tag" errors.

Apparently, some html tags, particularly "link" tags don't have corresponding closing tags. The only way of fixing the file is using ebook converter tools and converting the file again to epub file, which proves that the book itself isn't damaged, only minor formatting issues prevent it from being a valid epub file.

Secret is not none assertion

I started to have strange behavior of downloader - as I now try to download ebook it fails with assertion error stating that Secret is not none.

Under same account on different notebook (same WSL Ubuntu) it works ok with same ebooks.

Is it same kind of device specific blocking?

Incomplete ebooks due to "cannot download from '%s'", url

Hello

I had used this program in the past, but I want it to use it again recently. Now almost every time I run it triggers this error, follow from some different .html urls:

DeprecationWarning: The 'warn' function is deprecated, use 'warning' instead
logging.warn("cannot download from '%s'", url)
2022-01-01 21:33:35,855 (root) WARNING bookmate_downloader.process_opf():193 cannot download from 'https://reader.bookmate.com/p/a/4/d/ziDkQidl/contents/OEBPS/9in8y53x.html'
or
2022-01-01 21:37:48,851 (root) WARNING bookmate_downloader.process_opf():193 cannot download from 'https://reader.bookmate.com/p/a/4/d/ziDkQidl/contents/OEBPS/bookmate.css'

Because of this, it downloads incomplete versions of the ebooks

In advance, thank you for your answer =)

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.