evmer / perlego-downloader

Download books from Perlego.com in PDF format
MIT License
106 stars 52 forks source link

JSONDecodeError("Expecting value", s, err.value) from None #8

Closed paletisuresh closed 1 year ago

paletisuresh commented 1 year ago

I am new to python and don't know anything. Getting below error can you please help out on this

C:\Users\dell\Downloads\perlego-downloader-main>python3 downloader.py Traceback (most recent call last): File "C:\Users\dell\Downloads\perlego-downloader-main\downloader.py", line 38, in data_content = json.loads(json.loads(data['data']['content'])) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2032.0_x64qbz5n2kfra8p0\lib\json\init.py", line 346, in loads return _default_decoder.decode(s) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2032.0_x64qbz5n2kfra8p0\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2032.0_x64__qbz5n2kfra8p0\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)

evmer commented 1 year ago

Hello, can you please post the book id so I can investigate the issue? Thank you.

paletisuresh commented 1 year ago

Bookid: 3526154 thanks for your reply

On Mon, 12 Sep, 2022, 4:00 pm evmer, @.***> wrote:

Hello, can you please post the book id so I can investigate the issue? Thank you.

— Reply to this email directly, view it on GitHub https://github.com/evmer/perlego-downloader/issues/8#issuecomment-1243536486, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJYN3BMM7ICOK7W6AEQADLV54A3RANCNFSM6AAAAAAQKGH3I4 . You are receiving this because you authored the thread.Message ID: @.***>

evmer commented 1 year ago

@paletisuresh thanks for reporting this to me. This is definitely a bug and it'll be fixed soon

evmer commented 1 year ago

Bug should be fixed now, let me know

paletisuresh commented 1 year ago

Awesome now its working fine but getting below error after downloading Bookid: 3255865

C:\Users\dell\Downloads\perlego-downloader-main (1)\perlego-downloader-main>python3 downloader.py chapters 0 downloaded chapters 1-2 downloaded chapters 3 downloaded chapters 4 downloaded chapters 5 downloaded chapters 6 downloaded chapters 7 downloaded chapters 8 downloaded chapters 9 downloaded chapters 10 downloaded chapters 11 downloaded chapters 12 downloaded chapters 13 downloaded chapters 14 downloaded chapters 15 downloaded chapters 16 downloaded chapters 17 downloaded chapters 18 downloaded chapters 19 downloaded chapters 20 downloaded chapters 21 downloaded chapters 22 downloaded chapters 23 downloaded chapters 24 downloaded chapters 25 downloaded chapters 26 downloaded chapters 27 downloaded chapters 28 downloaded chapters 29 downloaded chapters 30 downloaded chapters 31 downloaded chapters 32 downloaded chapters 33 downloaded chapters 34 downloaded chapters 35 downloaded chapters 36 downloaded chapters 37 downloaded chapters 38 downloaded chapters 39 downloaded chapters 40 downloaded chapters 41 downloaded chapters 42 downloaded chapters 43 downloaded chapters 44 downloaded chapters 45 downloaded chapters 46 downloaded chapters 47 downloaded chapters 48 downloaded chapters 49 downloaded chapters 50 downloaded chapters 51 downloaded chapters 52 downloaded chapters 53 downloaded chapters 54 downloaded chapters 55 downloaded Traceback (most recent call last): File "C:\Users\dell\Downloads\perlego-downloader-main (1)\perlego-downloader-main\downloader.py", line 218, in asyncio.run(html2pdf()) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2032.0_x64qbz5n2kfra8p0\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2032.0_x64qbz5n2kfra8p0\lib\asyncio\base_events.py", line 646, in run_until_complete return future.result() File "C:\Users\dell\Downloads\perlego-downloader-main (1)\perlego-downloader-main\downloader.py", line 148, in html2pdf browser = await launch(options={ File "C:\Users\dell\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyppeteer\launcher.py", line 307, in launch return await Launcher(options, **kwargs).launch() File "C:\Users\dell\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyppeteer\launcher.py", line 148, in launch self.proc = subprocess.Popen( # type: ignore File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2032.0_x64qbz5n2kfra8p0\lib\subprocess.py", line 969, in init self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2032.0_x64qbz5n2kfra8p0\lib\subprocess.py", line 1438, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, OSError: [WinError 14001] The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail

C:\Users\dell\Downloads\perlego-downloader-main (1)\perlego-downloader-main>

On Mon, Sep 12, 2022 at 8:56 PM evmer @.***> wrote:

Bug should be fixed now, let me know

— Reply to this email directly, view it on GitHub https://github.com/evmer/perlego-downloader/issues/8#issuecomment-1243908431, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJYN3BY3MF4TUJO4FSWBC3V55DRRANCNFSM6AAAAAAQKGH3I4 . You are receiving this because you were mentioned.Message ID: @.***>

q7z commented 1 year ago

Same issue here for me:

Traceback (most recent call last):
  File "C:\Users\ofzah\Videos\per\downloader.py", line 203, in <module>
    asyncio.run(html2pdf())
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\asyncio\base_events.py", line 647, in run_until_complete
    return future.result()
  File "C:\Users\ofzah\Videos\per\downloader.py", line 132, in html2pdf
    browser = await launch(options={
  File "C:\Users\ofzah\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pyppeteer\launcher.py", line 307, in launch
    return await Launcher(options, **kwargs).launch()
  File "C:\Users\ofzah\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pyppeteer\launcher.py", line 148, in launch
    self.proc = subprocess.Popen(  # type: ignore
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 1420, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
OSError: [WinError 14001] The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail
paletisuresh commented 1 year ago

solved above error with pyppeteer-install.exe

now getting new error

Traceback (most recent call last): File "C:\Users\dell\Downloads\perlego-downloader-main (1)\perlego-downloader-main\downloader.py", line 218, in asyncio.run(html2pdf()) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2032.0_x64qbz5n2kfra8p0\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2032.0_x64qbz5n2kfra8p0\lib\asyncio\base_events.py", line 646, in run_until_complete return future.result() File "C:\Users\dell\Downloads\perlego-downloader-main (1)\perlego-downloader-main\downloader.py", line 148, in html2pdf browser = await launch(options={ File "C:\Users\dell\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyppeteer\launcher.py", line 307, in launch return await Launcher(options, **kwargs).launch() File "C:\Users\dell\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyppeteer\launcher.py", line 168, in launch self.browserWSEndpoint = get_ws_endpoint(self.url) File "C:\Users\dell\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyppeteer\launcher.py", line 227, in get_ws_endpoint raise BrowserError('Browser closed unexpectedly:\n') pyppeteer.errors.BrowserError: Browser closed unexpectedly:

Exception ignored in atexit callback: <function Launcher.launch.._close_process at 0x000001B5385A6D40> Traceback (most recent call last): File "C:\Users\dell\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyppeteer\launcher.py", line 153, in _close_process self._loop.run_until_complete(self.killChrome()) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2032.0_x64__qbz5n2kfra8p0\lib\asyncio\base_events.py", line 621, in run_until_complete self._check_closed() File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2032.0_x64__qbz5n2kfra8p0\lib\asyncio\base_events.py", line 515, in _check_closed raise RuntimeError('Event loop is closed') RuntimeError: Event loop is closed sys:1: RuntimeWarning: coroutine 'Launcher.killChrome' was never awaited RuntimeWarning: Enable tracemalloc to get the object allocation traceback

On Mon, Sep 12, 2022 at 9:18 PM Oliver Marseus @.***> wrote:

Same issue here for me: Traceback (most recent call last): File "C:\Users\ofzah\Videos\per\downloader.py", line 203, in asyncio.run(html2pdf()) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64qbz5n2kfra8p0\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64qbz5n2kfra8p0\lib\asyncio\base_events.py", line 647, in run_until_complete return future.result() File "C:\Users\ofzah\Videos\per\downloader.py", line 132, in html2pdf browser = await launch(options={ File "C:\Users\ofzah\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pyppeteer\launcher.py", line 307, in launch return await Launcher(options, *kwargs).launch() File "C:\Users\ofzah\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pyppeteer\launcher.py", line 148, in launch self.proc = subprocess.Popen( # type: ignore File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 951, in init* self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 1420, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, OSError: [WinError 14001] The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail

— Reply to this email directly, view it on GitHub https://github.com/evmer/perlego-downloader/issues/8#issuecomment-1243937650, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJYN3FORLXKKLVU6ZEWWRLV55GGNANCNFSM6AAAAAAQKGH3I4 . You are receiving this because you were mentioned.Message ID: @.***>

evmer commented 1 year ago

@paletisuresh I patched the script, can you please retry and ping me if the issue persists?

paletisuresh commented 1 year ago

getting new error

Traceback (most recent call last): File "C:\Users\dell\Downloads\Compressed\perlego-downloader-main\downloader.py", line 218, in asyncio.run(html2pdf()) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2032.0_x64qbz5n2kfra8p0\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2032.0_x64qbz5n2kfra8p0\lib\asyncio\base_events.py", line 646, in run_until_complete return future.result() File "C:\Users\dell\Downloads\Compressed\perlego-downloader-main\downloader.py", line 147, in html2pdf browser = await launch(options={ File "C:\Users\dell\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyppeteer\launcher.py", line 307, in launch return await Launcher(options, **kwargs).launch() File "C:\Users\dell\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyppeteer\launcher.py", line 168, in launch self.browserWSEndpoint = get_ws_endpoint(self.url) File "C:\Users\dell\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyppeteer\launcher.py", line 227, in get_ws_endpoint raise BrowserError('Browser closed unexpectedly:\n') pyppeteer.errors.BrowserError: Browser closed unexpectedly:

evmer commented 1 year ago

@paletisuresh can you post the full error message? I need to know the part after "Browser closed unexpectedly:".

paletisuresh commented 1 year ago

nothing after that

Traceback (most recent call last): File "C:\Users\dell\Downloads\Compressed\perlego-downloader-main\downloader.py", line 218, in asyncio.run(html2pdf()) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2032.0_x64qbz5n2kfra8p0\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2032.0_x64qbz5n2kfra8p0\lib\asyncio\base_events.py", line 646, in run_until_complete return future.result() File "C:\Users\dell\Downloads\Compressed\perlego-downloader-main\downloader.py", line 147, in html2pdf browser = await launch(options={ File "C:\Users\dell\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyppeteer\launcher.py", line 307, in launch return await Launcher(options, **kwargs).launch() File "C:\Users\dell\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyppeteer\launcher.py", line 168, in launch self.browserWSEndpoint = get_ws_endpoint(self.url) File "C:\Users\dell\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyppeteer\launcher.py", line 227, in get_ws_endpoint raise BrowserError('Browser closed unexpectedly:\n') pyppeteer.errors.BrowserError: Browser closed unexpectedly:

C:\Users\dell\Downloads\Compressed\perlego-downloader-main>

evmer commented 1 year ago

@paletisuresh can you please debug the issue following these instructions? https://github.com/davidteather/TikTok-Api/issues/178

You can also try with the proposed solution:

Install chrome on your computer as well as download chromedriver and add it to your system path.

paletisuresh commented 1 year ago

I followed the steps, still getting same error

C:\Users\dell\Downloads\Compressed\perlego-downloader-main>python3 pyscript.py C:\Users\dell\AppData\Local\pyppeteer\pyppeteer\local-chromium\588429\chrome-win32\chrome.exe --disable-background-networking --disable-background-timer-throttling --disable-breakpad --disable-browser-side-navigation --disable-client-side-phishing-detection --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=site-per-process --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --disable-translate --metrics-recording-only --no-first-run --safebrowsing-disable-auto-update --enable-automation --password-store=basic --use-mock-keychain --headless --hide-scrollbars --mute-audio --disable-gpu about:blank --remote-debugging-port=58219 --user-data-dir=C:\Users\dell\AppData\Local\pyppeteer\pyppeteer.dev_profile\tmp3ionk0ww

C:\Users\dell\Downloads\Compressed\perlego-downloader-main>C:\Users\dell\AppData\Local\pyppeteer\pyppeteer\local-chromium\588429\chrome-win32\chrome.exe --disable-background-networking --disable-background-timer-throttling --disable-breakpad --disable-browser-side-navigation --disable-client-side-phishing-detection --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=site-per-process --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --disable-translate --metrics-recording-only --no-first-run --safebrowsing-disable-auto-update --enable-automation --password-store=basic --use-mock-keychain --headless --hide-scrollbars --mute-audio --disable-gpu about:blank --remote-debugging-port=58219 --user-data-dir=C:\Users\dell\AppData\Local\pyppeteer\pyppeteer.dev_profile\tmp3ionk0ww

C:\Users\dell\Downloads\Compressed\perlego-downloader-main>python3 downloader.py chapters 0 downloaded chapters 1 downloaded chapters 2 downloaded chapters 3 downloaded chapters 4 downloaded chapters 5 downloaded chapters 6 downloaded chapters 7 downloaded chapters 8-9 downloaded chapters 10 downloaded chapters 11 downloaded chapters 12 downloaded chapters 13 downloaded chapters 14 downloaded chapters 15 downloaded chapters 16 downloaded chapters 17 downloaded chapters 18 downloaded chapters 19 downloaded chapters 20 downloaded chapters 21 downloaded chapters 22 downloaded chapters 23 downloaded chapters 24 downloaded chapters 25 downloaded chapters 26 downloaded chapters 27 downloaded chapters 28 downloaded Traceback (most recent call last): File "C:\Users\dell\Downloads\Compressed\perlego-downloader-main\downloader.py", line 218, in asyncio.run(html2pdf()) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2032.0_x64qbz5n2kfra8p0\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2032.0_x64qbz5n2kfra8p0\lib\asyncio\base_events.py", line 646, in run_until_complete return future.result() File "C:\Users\dell\Downloads\Compressed\perlego-downloader-main\downloader.py", line 147, in html2pdf browser = await launch(options={ File "C:\Users\dell\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyppeteer\launcher.py", line 307, in launch return await Launcher(options, **kwargs).launch() File "C:\Users\dell\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyppeteer\launcher.py", line 168, in launch self.browserWSEndpoint = get_ws_endpoint(self.url) File "C:\Users\dell\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyppeteer\launcher.py", line 227, in get_ws_endpoint raise BrowserError('Browser closed unexpectedly:\n') pyppeteer.errors.BrowserError: Browser closed unexpectedly:

C:\Users\dell\Downloads\Compressed\perlego-downloader-main>

evmer commented 1 year ago

Discussion moved to #9

Original bug is solved so I close this issue