ptrstn / dailyblink

Downloads the Audio and Text of the Free Daily book from Blinkist.com
MIT License
43 stars 6 forks source link

Windows 10 | 1.0.1 (python 3.9.9) Index out of range #25

Closed kotzer3 closed 2 years ago

kotzer3 commented 2 years ago

Version of dailyblink: 1.0.1 Python version: 3.9.9 Operating system: Win10 Pro German 20H2 Build 19042.985

python -m dailyblink
Downloading the free daily Blinks...
Traceback (most recent call last):
  File "C:\Users\tbr\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\tbr\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\tbr\AppData\Roaming\Python\Python39\site-packages\dailyblink\__main__.py", line 54, in <module>
    main()
  File "C:\Users\tbr\AppData\Roaming\Python\Python39\site-packages\dailyblink\__main__.py", line 50, in main
    blinkist_scraper.download_daily_blinks(args.language, base_path)
  File "C:\Users\tbr\AppData\Roaming\Python\Python39\site-packages\dailyblink\core.py", line 32, in download_daily_blinks
    self._attempt_daily_blinks_download(languages, base_path)
  File "C:\Users\tbr\AppData\Roaming\Python\Python39\site-packages\dailyblink\core.py", line 51, in _attempt_daily_blinks_download
    self._download_daily_blinks(language_code, base_path)
  File "C:\Users\tbr\AppData\Roaming\Python\Python39\site-packages\dailyblink\core.py", line 58, in _download_daily_blinks
    blink_info = self._get_daily_blink_info(language=language_code)
  File "C:\Users\tbr\AppData\Roaming\Python\Python39\site-packages\dailyblink\core.py", line 116, in _get_daily_blink_info
    return _create_blink_info(response.text)
  File "C:\Users\tbr\AppData\Roaming\Python\Python39\site-packages\dailyblink\core.py", line 161, in _create_blink_info
    daily_book_href = soup.find_all("a", {"class": "daily-book__cta"})[0]["href"]
IndexError: list index out of range

Hi Peter, am very sorry, (and don't know) if still related to same problem (#21) but after upgrading to newest version (1.0.1) Index out of range :/

I already updated the dailyblink by the commands you provided in #20 via:

pip uninstall dailyblink
pip install --user git+https://github.com/ptrstn/dailyblink

I saw, that todays github actionjob still without any errors:

here full stack (and hopefully the version infos you need?)

Microsoft Windows [Version 10.0.19042.985]
(c) Microsoft Corporation. Alle Rechte vorbehalten.

C:\Users\tbr>python --version
Python 3.9.9

C:\Users\tbr>python -m dailyblink -version
usage: __main__.py [-h] [--version] [-p PATH] [-l {en,de} [{en,de} ...]]
__main__.py: error: unrecognized arguments: -version

C:\Users\tbr>python -m dailyblink --version
__main__.py 1.0.1

C:\Users\tbr>python -m dailyblink
Downloading the free daily Blinks...
Traceback (most recent call last):
  File "C:\Users\tbr\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\tbr\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\tbr\AppData\Roaming\Python\Python39\site-packages\dailyblink\__main__.py", line 54, in <module>
    main()
  File "C:\Users\tbr\AppData\Roaming\Python\Python39\site-packages\dailyblink\__main__.py", line 50, in main
    blinkist_scraper.download_daily_blinks(args.language, base_path)
  File "C:\Users\tbr\AppData\Roaming\Python\Python39\site-packages\dailyblink\core.py", line 32, in download_daily_blinks
    self._attempt_daily_blinks_download(languages, base_path)
  File "C:\Users\tbr\AppData\Roaming\Python\Python39\site-packages\dailyblink\core.py", line 51, in _attempt_daily_blinks_download
    self._download_daily_blinks(language_code, base_path)
  File "C:\Users\tbr\AppData\Roaming\Python\Python39\site-packages\dailyblink\core.py", line 58, in _download_daily_blinks
    blink_info = self._get_daily_blink_info(language=language_code)
  File "C:\Users\tbr\AppData\Roaming\Python\Python39\site-packages\dailyblink\core.py", line 116, in _get_daily_blink_info
    return _create_blink_info(response.text)
  File "C:\Users\tbr\AppData\Roaming\Python\Python39\site-packages\dailyblink\core.py", line 161, in _create_blink_info
    daily_book_href = soup.find_all("a", {"class": "daily-book__cta"})[0]["href"]
IndexError: list index out of range

C:\Users\tbr>pip uninstall dailyblink
Found existing installation: dailyblink 1.0.1
Uninstalling dailyblink-1.0.1:
  Would remove:
    c:\users\tbr\appdata\roaming\python\python39\scripts\dailyblink-script.py
    c:\users\tbr\appdata\roaming\python\python39\scripts\dailyblink.exe
    c:\users\tbr\appdata\roaming\python\python39\site-packages\dailyblink-1.0.1-py3.9.egg-info
    c:\users\tbr\appdata\roaming\python\python39\site-packages\dailyblink\*
Proceed (Y/n)? Y
  Successfully uninstalled dailyblink-1.0.1

C:\Users\tbr>pip install --user git+https://github.com/ptrstn/dailyblink
Collecting git+https://github.com/ptrstn/dailyblink
  Cloning https://github.com/ptrstn/dailyblink to c:\users\tbr\appdata\local\temp\pip-req-build-ogxr61no
  Running command git clone --filter=blob:none -q https://github.com/ptrstn/dailyblink 'C:\Users\tbr\AppData\Local\Temp\pip-req-build-ogxr61no'
  Resolved https://github.com/ptrstn/dailyblink to commit f1792f9c1d3de6e12a72e265957fdb03e702fc0b
  Preparing metadata (setup.py) ... done
Requirement already satisfied: requests in c:\users\tbr\appdata\roaming\python\python39\site-packages (from dailyblink==1.0.1) (2.26.0)
Requirement already satisfied: beautifulsoup4 in c:\users\tbr\appdata\roaming\python\python39\site-packages (from dailyblink==1.0.1) (4.10.0)
Requirement already satisfied: mutagen in c:\users\tbr\appdata\roaming\python\python39\site-packages (from dailyblink==1.0.1) (1.45.1)
Requirement already satisfied: cloudscraper in c:\users\tbr\appdata\roaming\python\python39\site-packages (from dailyblink==1.0.1) (1.2.58)
Requirement already satisfied: soupsieve>1.2 in c:\users\tbr\appdata\roaming\python\python39\site-packages (from beautifulsoup4->dailyblink==1.0.1) (2.3.1)
Requirement already satisfied: pyparsing>=2.4.7 in c:\users\tbr\appdata\roaming\python\python39\site-packages (from cloudscraper->dailyblink==1.0.1) (3.0.6)
Requirement already satisfied: requests-toolbelt>=0.9.1 in c:\users\tbr\appdata\roaming\python\python39\site-packages (from cloudscraper->dailyblink==1.0.1) (0.9.1)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\tbr\appdata\roaming\python\python39\site-packages (from requests->dailyblink==1.0.1) (2021.10.8)
Requirement already satisfied: idna<4,>=2.5 in c:\users\tbr\appdata\roaming\python\python39\site-packages (from requests->dailyblink==1.0.1) (3.3)
Requirement already satisfied: charset-normalizer~=2.0.0 in c:\users\tbr\appdata\roaming\python\python39\site-packages (from requests->dailyblink==1.0.1) (2.0.7)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\tbr\appdata\roaming\python\python39\site-packages (from requests->dailyblink==1.0.1) (1.26.7)
Using legacy 'setup.py install' for dailyblink, since package 'wheel' is not installed.
Installing collected packages: dailyblink
    Running setup.py install for dailyblink ... done
Successfully installed dailyblink-1.0.1

C:\Users\tbr>python -m dailyblink --version
__main__.py 1.0.1

C:\Users\tbr>python -m dailyblink
Downloading the free daily Blinks...
Traceback (most recent call last):
  File "C:\Users\tbr\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\tbr\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\tbr\AppData\Roaming\Python\Python39\site-packages\dailyblink\__main__.py", line 54, in <module>
    main()
  File "C:\Users\tbr\AppData\Roaming\Python\Python39\site-packages\dailyblink\__main__.py", line 50, in main
    blinkist_scraper.download_daily_blinks(args.language, base_path)
  File "C:\Users\tbr\AppData\Roaming\Python\Python39\site-packages\dailyblink\core.py", line 32, in download_daily_blinks
    self._attempt_daily_blinks_download(languages, base_path)
  File "C:\Users\tbr\AppData\Roaming\Python\Python39\site-packages\dailyblink\core.py", line 51, in _attempt_daily_blinks_download
    self._download_daily_blinks(language_code, base_path)
  File "C:\Users\tbr\AppData\Roaming\Python\Python39\site-packages\dailyblink\core.py", line 58, in _download_daily_blinks
    blink_info = self._get_daily_blink_info(language=language_code)
  File "C:\Users\tbr\AppData\Roaming\Python\Python39\site-packages\dailyblink\core.py", line 116, in _get_daily_blink_info
    return _create_blink_info(response.text)
  File "C:\Users\tbr\AppData\Roaming\Python\Python39\site-packages\dailyblink\core.py", line 161, in _create_blink_info
    daily_book_href = soup.find_all("a", {"class": "daily-book__cta"})[0]["href"]
IndexError: list index out of range

C:\Users\tbr>
ptrstn commented 2 years ago

I've seen this bug too, but it mysteriously disappears and reappears occasionally. I'm not quite sure why this is happening. I suspect some sort of caching issue that I haven't been able to figure out yet.

ptrstn commented 2 years ago

Security is getting tighter.

@kotzer3 Can you try again with version v1.1.0 ?

kotzer3 commented 2 years ago

Nice,. good work.

updated to 1.1.0 - working like a charm ❤️

C:\Users\tbr>pip uninstall dailyblink
Found existing installation: dailyblink 1.0.1
Uninstalling dailyblink-1.0.1:
  Would remove:
    c:\users\tbr\appdata\roaming\python\python39\scripts\dailyblink-script.py
    c:\users\tbr\appdata\roaming\python\python39\scripts\dailyblink.exe
    c:\users\tbr\appdata\roaming\python\python39\site-packages\dailyblink-1.0.1-py3.9.egg-info
    c:\users\tbr\appdata\roaming\python\python39\site-packages\dailyblink\*
Proceed (Y/n)? Y
  Successfully uninstalled dailyblink-1.0.1

C:\Users\tbr>pip install --user git+https://github.com/ptrstn/dailyblink
Collecting git+https://github.com/ptrstn/dailyblink
  Cloning https://github.com/ptrstn/dailyblink to c:\users\tbr\appdata\local\temp\pip-req-build-lqiyat43
  Running command git clone --filter=blob:none -q https://github.com/ptrstn/dailyblink 'C:\Users\tbr\AppData\Local\Temp\pip-req-build-lqiyat43'
  Resolved https://github.com/ptrstn/dailyblink to commit 75aeec74061b4c8987b40dde2c2c4b412c8fc221
  Preparing metadata (setup.py) ... done
Requirement already satisfied: requests in c:\users\tbr\appdata\roaming\python\python39\site-packages (from dailyblink==1.1.0) (2.26.0)
Requirement already satisfied: beautifulsoup4 in c:\users\tbr\appdata\roaming\python\python39\site-packages (from dailyblink==1.1.0) (4.10.0)
Requirement already satisfied: mutagen in c:\users\tbr\appdata\roaming\python\python39\site-packages (from dailyblink==1.1.0) (1.45.1)
Requirement already satisfied: cloudscraper in c:\users\tbr\appdata\roaming\python\python39\site-packages (from dailyblink==1.1.0) (1.2.58)
Requirement already satisfied: soupsieve>1.2 in c:\users\tbr\appdata\roaming\python\python39\site-packages (from beautifulsoup4->dailyblink==1.1.0) (2.3.1)
Requirement already satisfied: pyparsing>=2.4.7 in c:\users\tbr\appdata\roaming\python\python39\site-packages (from cloudscraper->dailyblink==1.1.0) (3.0.6)
Requirement already satisfied: requests-toolbelt>=0.9.1 in c:\users\tbr\appdata\roaming\python\python39\site-packages (from cloudscraper->dailyblink==1.1.0) (0.9.1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\tbr\appdata\roaming\python\python39\site-packages (from requests->dailyblink==1.1.0) (1.26.7)
Requirement already satisfied: charset-normalizer~=2.0.0 in c:\users\tbr\appdata\roaming\python\python39\site-packages (from requests->dailyblink==1.1.0) (2.0.7)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\tbr\appdata\roaming\python\python39\site-packages (from requests->dailyblink==1.1.0) (2021.10.8)
Requirement already satisfied: idna<4,>=2.5 in c:\users\tbr\appdata\roaming\python\python39\site-packages (from requests->dailyblink==1.1.0) (3.3)
Using legacy 'setup.py install' for dailyblink, since package 'wheel' is not installed.
Installing collected packages: dailyblink
    Running setup.py install for dailyblink ... done
Successfully installed dailyblink-1.1.0

C:\Users\tbr>python -m dailyblink -version
usage: __main__.py [-h] [--version] [-p PATH] [-l {en,de} [{en,de} ...]]
__main__.py: error: unrecognized arguments: -version

C:\Users\tbr>python -m dailyblink --version
__main__.py 1.1.0

C:\Users\tbr>python -m dailyblink
dailyblink v1.1.0, Windows AMD64 64bit WindowsPE
Downloading the free daily Blinks on 2022-01-26 15:46:14...

Retrying...
Attempt 1/10... FAILED
Attempt 2/10... FAILED
Attempt 3/10...
english (en):
Permission to Glow - Kristoffer Carter

Saving book text...
Saving book cover...
Saving audio track #1 - What’s in it for me? Learn how to unleas...
Saving audio track #2 - To grow as a leader, focus on your inner...
Saving audio track #3 - Living your vocation brings peace....
Saving audio track #4 - To behave with intention, give yourself ...
Saving audio track #5 - To benefit from their insights, give you...
Saving audio track #6 - Befriend your fear so you can give yours...
Saving audio track #7 - To increase your own power, give yoursel...
Saving audio track #8 - Practicing the four permissions is a jou...
Saving audio track #9 - Final summary...
Creating playlist file...

german (de):
Hidden Champions – Die neuen Spielregeln im chinesischen Jahrhundert - Hermann Simon

Saving book text...
Saving book cover...
Saving audio track #1 - Was drin ist für dich: Eine umfassende A...
Saving audio track #2 - Was sind Hidden Champions?...
Saving audio track #3 - Ein Phänomen des deutschsprachigen Raums...
Saving audio track #4 - Die Globalisierung holpert...
Saving audio track #5 - USA oder China? Beides!...
Saving audio track #6 - Pflichtübungen: Nachhaltigkeit und Digit...
Saving audio track #7 - Business-Ökosysteme und Innovationen sic...
Saving audio track #8 - Das richtige Mindset...
Saving audio track #9 - Neue Herausforderungen...
Saving audio track #10 - Fazit...
Creating playlist file...

All blinks were saved under C:\Users\tbr\Musik\blinks

C:\Users\tbr>