Puyodead1 / udemy-downloader

A Udemy downloader that can download courses, with DRM support.
MIT License
1.26k stars 291 forks source link

[Bug]: Error while downloading #222

Closed thedtech closed 2 months ago

thedtech commented 3 months ago

What happened?

Script is throwing error in the beginning after extracting info dialogues. This error occurs with this particular course in my case (Can be with other courses also) : https://www.udemy.com/course/react-the-complete-guide-incl-redux/

This course doesn't have any DRM.

Expected Result

It should download normally like other courses.

Branch

master/main

What operating systems are you seeing the problem on?

Windows

Relevant log output

C:\uDL>main.py -c https://www.udemy.com/course/react-the-complete-guide-incl-redux/ --download-assets --download-captions --download-quizzes --id-as-course-name --log-level ERROR
Traceback (most recent call last):
  File "C:\Python3\Lib\site-packages\requests\models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python3\Lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python3\Lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python3\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:\uDL\main.py", line 2068, in <module>
    main()
  File "C:\uDL\main.py", line 1951, in main
    course_json = udemy._extract_course_json(course_url, course_id, portal_name)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\uDL\main.py", line 770, in _extract_course_json
    resp = self._extract_large_course_content(url=url)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\uDL\main.py", line 788, in _extract_large_course_content
    resp = self.session._get(_next).json()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python3\Lib\site-packages\requests\models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Other information

Screenshot (4) Screenshot (5)

Puyodead1 commented 3 months ago

are you passing a bearer token? and use https://www.udemy.com/course/react-the-complete-guide-incl-redux/learn

thedtech commented 3 months ago

are you passing a bearer token? and use https://www.udemy.com/course/react-the-complete-guide-incl-redux/learn

Yes, I am using the token. Even after using https://www.udemy.com/course/react-the-complete-guide-incl-redux/learn, Error is same. If you want, I can provide credentials for test.

Screenshot (6)

mcs-nuuk commented 2 months ago

I've got the same issue unfortunately.

Puyodead1 commented 2 months ago

are you passing a bearer token? and use https://www.udemy.com/course/react-the-complete-guide-incl-redux/learn

Yes, I am using the token. Even after using https://www.udemy.com/course/react-the-complete-guide-incl-redux/learn, Error is same. If you want, I can provide credentials for test.

Screenshot (6)

I can look into it, but yes i will need at least a bearer token to test with. you can email me puyodead@proton.me

thedtech commented 2 months ago

are you passing a bearer token? and use https://www.udemy.com/course/react-the-complete-guide-incl-redux/learn

Yes, I am using the token. Even after using https://www.udemy.com/course/react-the-complete-guide-incl-redux/learn, Error is same. If you want, I can provide credentials for test.

Screenshot (6)

I can look into it, but yes i will need at least a bearer token to test with. you can email me puyodead@proton.me

Done! Please check your email.

Puyodead1 commented 2 months ago

are you passing a bearer token? and use https://www.udemy.com/course/react-the-complete-guide-incl-redux/learn

Yes, I am using the token. Even after using https://www.udemy.com/course/react-the-complete-guide-incl-redux/learn, Error is same. If you want, I can provide credentials for test. Screenshot (6)

I can look into it, but yes i will need at least a bearer token to test with. you can email me puyodead@proton.me

Done! Please check your email.

I'm looking into this, but this issue only occurs on the master branch, I suggest switching to feat/refactor

Puyodead1 commented 2 months ago

should be resolved in c7329b1d59edb747a400a800fa49735091acb02c