Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

German downloads #1

Closed
Wunderharke opened this issue Apr 2, 2020 · 2 comments
Closed

German downloads #1

Wunderharke opened this issue Apr 2, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@Wunderharke
Copy link

Wunderharke commented Apr 2, 2020

Is there any way to download German books and audios as well?
Could you add another flag to choose the language maybe?

I also ran into JSONDecodeErrors at some point in the program. I don't know when and why this happens exactly.

[.] Scraping book at https://www.blinkist.com/en/books/disrupted-en

Traceback (most recent call last):
  File ".\main.py", line 62, in <module>
    audio_files = scraper.scrape_book_audio(driver, book_json)
  File "[...]\scraper.py", line 223, in scrape_book_audio
    audio_url = audio_request.json()['url']
  File "[...]\Anaconda3\lib\site-packages\requests\models.py", line 889, in json
    self.content.decode(encoding), **kwargs
  File "[...]\Anaconda3\lib\json\__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "[...]\Anaconda3\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "[...]\Anaconda3\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

PS: you should add Chrome browser to dependencies, as chomedriver needs Chrome browser to be installed.

@leoncvlt leoncvlt self-assigned this Apr 2, 2020
@leoncvlt leoncvlt added bug Something isn't working enhancement New feature or request labels Apr 2, 2020
@leoncvlt
Copy link
Owner

leoncvlt commented Apr 3, 2020

thanks for the feedback! b2c062e Adds support for German language with the --language argument, alongside with the --match-language option in case you want to download only books in german 🍻

As for the decoding error, I could not replicate that, but the latest commit 43aa262 should at least make it fail gracefully and not stop the scraping process. If you manage to replicate the error in a consistent way please give me a shout on #2

@leoncvlt leoncvlt closed this as completed Apr 3, 2020
@leoncvlt leoncvlt reopened this Apr 3, 2020
@leoncvlt leoncvlt removed the bug Something isn't working label Apr 3, 2020
@Wunderharke
Copy link
Author

Wunderharke commented Apr 3, 2020

Hi @leoncvlt,

thanks for the fast response and that easy to use language option!

The error above might just be a caching error, I canceled and restated scraping a few times.
I'll use a new repo clone this time and will report back at #2 if I run into this again.

leoncvlt pushed a commit that referenced this issue May 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants