rojter-tech / pluradl.py

Automated download of Pluralsight courses
MIT License
2 stars 0 forks source link

Failed to parse JSON #44

Open piasKolpolok opened 4 years ago

piasKolpolok commented 4 years ago

During downloading course i get this error. Here is the log.

Downloading JSON metadata ERROR: 6f081482-14d5-47e6-8ab9-6a37d22e79be-7: Failed to parse JSON (caused by JSONDecodeError('Expecting value: line 1 column 1 (char 0)')); please report this issue on https://github.com/rojter-tech/pluradl.py/issues . Make sure you are using the latest version; see https://github.com/rojter-tech/pluradl.py/wiki on how to update. Be sure to call plura-dl with the --verbose flag and include its complete output. Traceback (most recent call last): File "/Users/someone/Pluralsight/pluradl.py/plura_dl/extractor/common.py", line 899, in _parse_json return json.loads(json_string) File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/init.py", line 348, in loads return _default_decoder.decode(s) File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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) Traceback (most recent call last): File "/Users/someone/Pluralsight/pluradl.py/plura_dl/extractor/common.py", line 899, in _parse_json return json.loads(json_string) File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/init.py", line 348, in loads return _default_decoder.decode(s) File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/someone/Pluralsight/pluradl.py/plura_dl/PluraDL.py", line 797, in extract_info ie_result = ie.extract(url) File "/Users/someone/Pluralsight/pluradl.py/plura_dl/extractor/common.py", line 530, in extract ie_result = self._real_extract(url) File "/Users/someone/Pluralsight/pluradl.py/plura_dl/extractor/pluralsight.py", line 288, in _real_extract course = self._download_course(course_name, url, display_id) File "/Users/someone/Pluralsight/pluradl.py/plura_dl/extractor/pluralsight.py", line 93, in _download_course headers={'Referer': url}) File "/Users/someone/Pluralsight/pluradl.py/plura_dl/extractor/common.py", line 892, in _download_json expected_status=expected_status) File "/Users/someone/Pluralsight/pluradl.py/plura_dl/extractor/common.py", line 876, in _download_json_handle fatal=fatal), urlh File "/Users/someone/Pluralsight/pluradl.py/plura_dl/extractor/common.py", line 903, in _parse_json raise ExtractorError(errmsg, cause=ve) plura_dl.utils.ExtractorError: 6f081482-14d5-47e6-8ab9-6a37d22e79be-7: Failed to parse JSON (caused by JSONDecodeError('Expecting value: line 1 column 1 (char 0)')); please report this issue on https://github.com/rojter-tech/pluradl.py/issues . Make sure you are using the latest version; see https://github.com/rojter-tech/pluradl.py/wiki on how to update. Be sure to call plura-dl with the --verbose flag and include its complete output.

Something went wrong. The download request for 'course-title' was forced to terminate. Double check that https://app.pluralsight.com/library/courses/ethical-hacking-hacking-internet-of-things exists or that your subscription is valid for accessing its content.

Please, check. I have another question if I restart the pluradl.py again will it download all the downloaded course again or it will check the directory "_failed" ,"_inprogress" and "_finished" to make decision which course has been downloaded or failed or in inprogress and will start download after that.

rojter-tech commented 4 years ago

The download request for 'course-title' was forced to terminate.

The problem here is problaby that "course-title" is not a valid course.

piasKolpolok commented 4 years ago

"course-title" is a dummy name. I was downloading this course "swift-in-depth" it's a valid course. @rojter-tech

rojter-tech commented 4 years ago

@piasKolpolok And the link provided suggests "ethical-hacking-hacking-internet-of-things", wich btw was correct specified by the extractor, so this possibility is ruled out. This smells like a bug.

piasKolpolok commented 4 years ago

Hi @rojter-tech I have found another problem. When network connection goes off, it cancels the whole course and move to next course without waiting for the network connection comes back. I think when there is no internet it should wait until network connection comes alive again. Here is the log.

[download] 35.2% of 4.99MiB at 131.78KiB/s ETA 00:25 ERROR: giving up after 0 retries File "pluradl.py", line 303, in main() File "pluradl.py", line 299, in main download_courses(courses) File "pluradl.py", line 259, in download_courses if pluradl(course): File "pluradl.py", line 160, in pluradl return invoke_download(course_id, course_url, coursepath) File "pluradl.py", line 96, in invoke_download pdl.download([course_url]) File "/Users/someone/Plu2/pluradl.py/plura_dl/PluraDL.py", line 2019, in download url, force_generic_extractor=self.params.get('force_generic_extractor', False)) File "/Users/someone/Plu2/pluradl.py/plura_dl/PluraDL.py", line 808, in extract_info return self.process_ie_result(ie_result, download, extra_info) File "/Users/someone/Plu2/pluradl.py/plura_dl/PluraDL.py", line 1008, in process_ie_result extra_info=extra) File "/Users/someone/Plu2/pluradl.py/plura_dl/PluraDL.py", line 901, in process_ie_result new_result, download=download, extra_info=extra_info) File "/Users/someone/Plu2/pluradl.py/plura_dl/PluraDL.py", line 863, in process_ie_result return self.process_video_result(ie_result, download=download) File "/Users/someone/Plu2/pluradl.py/plura_dl/PluraDL.py", line 1644, in process_video_result self.process_info(new_info) File "/Users/someone/Plu2/pluradl.py/plura_dl/PluraDL.py", line 1926, in process_info success = dl(filename, info_dict) File "/Users/someone/Plu2/pluradl.py/plura_dl/PluraDL.py", line 1865, in dl return fd.download(name, info) File "/Users/someone/Plu2/pluradl.py/plura_dl/downloader/common.py", line 366, in download return self.real_download(filename, info_dict) File "/Users/someone/Plu2/pluradl.py/plura_dl/downloader/http.py", line 353, in real_download self.report_error('giving up after %s retries' % retries) File "/Users/someone/Plu2/pluradl.py/plura_dl/downloader/common.py", line 165, in report_error self.ydl.report_error(*args, **kargs) File "/Users/someone/Plu2/pluradl.py/plura_dl/PluraDL.py", line 625, in report_error self.trouble(error_message, tb) File "/Users/someone/Plu2/pluradl.py/plura_dl/PluraDL.py", line 587, in trouble tb_data = traceback.format_list(traceback.extract_stack())

Something went wrong. The download request for 'android-apps-kotlin-custom-views' was forced to terminate. Double check that https://app.pluralsight.com/library/courses/android-apps-kotlin-custom-views exists or that your subscription is valid for accessing its content.

Moving content to /Users/someone/Plu2/pluradl.py/courses/_failed/android-apps-kotlin-custom-views Moving to next course playlist

radam9 commented 4 years ago

I got the same issue with this course "play-by-play-owasp-top-ten-2017"


[pluralsight:course] play-by-play-owasp-top-ten-2017: Downloading JSON metadata
[pluralsight:course] play-by-play-owasp-top-ten-2017: Downloading JSON metadata
ERROR: play-by-play-owasp-top-ten-2017: Failed to parse JSON  (caused by JSONDecodeError('Expecting value: line 1 column 1 (char 0)')); please report this issue on https://github.com/rojter-tech/pluradl.py/issues . Make sure you are using the latest version; see  https://github.com/rojter-tech/pluradl.py/wiki  on how to update. Be sure to call plura-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "C:\pluralsight\pluradl.py\plura_dl\extractor\common.py", line 899, in _parse_json
    return json.loads(json_string)
  File "C:\Program Files\Python37\lib\json\__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "C:\Program Files\Python37\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Program Files\Python37\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)
Traceback (most recent call last):
  File "C:\pluralsight\pluradl.py\plura_dl\extractor\common.py", line 899, in _parse_json
    return json.loads(json_string)
  File "C:\Program Files\Python37\lib\json\__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "C:\Program Files\Python37\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Program Files\Python37\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)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\pluralsight\pluradl.py\plura_dl\PluraDL.py", line 797, in extract_info
    ie_result = ie.extract(url)
  File "C:\pluralsight\pluradl.py\plura_dl\extractor\common.py", line 530, in extract
    ie_result = self._real_extract(url)
  File "C:\pluralsight\pluradl.py\plura_dl\extractor\pluralsight.py", line 467, in _real_extract
    course = self._download_course(course_id, url, course_id)
  File "C:\pluralsight\pluradl.py\plura_dl\extractor\pluralsight.py", line 93, in _download_course
    headers={'Referer': url})
  File "C:\pluralsight\pluradl.py\plura_dl\extractor\common.py", line 892, in _download_json
    expected_status=expected_status)
  File "C:\pluralsight\pluradl.py\plura_dl\extractor\common.py", line 876, in _download_json_handle
    fatal=fatal), urlh
  File "C:\pluralsight\pluradl.py\plura_dl\extractor\common.py", line 903, in _parse_json
    raise ExtractorError(errmsg, cause=ve)
plura_dl.utils.ExtractorError: play-by-play-owasp-top-ten-2017: Failed to parse JSON  (caused by JSONDecodeError('Expecting value: line 1 column 1 (char 0)')); please report this issue on https://github.com/rojter-tech/pluradl.py/issues . Make sure you are using the latest version; see  https://github.com/rojter-tech/pluradl.py/wiki  on how to update. Be sure to call plura-dl with the --verbose flag and include its complete output.

Something went wrong.
The download request for 'play-by-play-owasp-top-ten-2017' was forced to terminate.
Double check that https://app.pluralsight.com/library/courses/play-by-play-owasp-top-ten-2017
exists or that your subscription is valid for accessing its content.

Moving content to C:\pluralsight\pluradl.py\courses\_failed\play-by-play-owasp-top-ten-2017```