Skip to content
This repository was archived by the owner on Aug 1, 2021. It is now read-only.
This repository was archived by the owner on Aug 1, 2021. It is now read-only.

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) #529

Closed
@xd003

Description

@xd003

Describe the bug
I tried to get info of all lectures and also tried downloading the lectures but getting the same error always. The login through cookies is successful but its unable to fetch any info from udemy

To Reproduce
Steps to reproduce the behavior:

  1. udemy course url: https://www.udemy.com/course/the-web-developer-bootcamp

  2. Comand Used: ( Getting these errors on every command for this course )

python3 udemy-dl.py https://www.udemy.com/course/the-web-developer-bootcamp -k cookie.txt --info
python3 udemy-dl.py https://www.udemy.com/course/the-web-developer-bootcamp/ -k cookie.txt -q 720 -o "/home/xd003/udemy"

[xd003@xd003 udemy-dl]$ python3 udemy-dl.py https://www.udemy.com/course/the-web-developer-bootcamp -k cookie.txt --info

              __                               ____  
   __  ______/ /__  ____ ___  __  __      ____/ / /  
  / / / / __  / _ \/ __ `__ \/ / / /_____/ __  / /   
 / /_/ / /_/ /  __/ / / / / / /_/ /_____/ /_/ / /    
 \__,_/\__,_/\___/_/ /_/ /_/\__, /      \__,_/_/     
                           /____/
                                 Version : 0.5
                                 Author  : Nasir Khan (r0ot h3x49)
                                 Github  : https://github.com/r0oth3x49

[*] : Trying to login using cookies ...
[+] : Logged in successfully.
Traceback (most recent call last):on .. 
  File "udemy-dl.py", line 1453, in <module>
    main()
  File "udemy-dl.py", line 968, in main
    udemy.course_list_down(chapter_number=options.chapter, lecture_number=options.lecture, unsafe=options.unsafe)
  File "udemy-dl.py", line 143, in course_list_down
    course = udemy.course(url=self.url, username=self.username, password=self.password, cookies=self.cookies)
  File "/home/xd003/udemy-dl/udemy/_udemy.py", line 38, in course
    return Udemy(url, username, password, cookies, basic, callback)
  File "/home/xd003/udemy-dl/udemy/_internal.py", line 44, in __init__
    super(InternUdemyCourse, self).__init__(*args, **kwargs)
  File "/home/xd003/udemy-dl/udemy/_shared.py", line 258, in __init__
    self._fetch_course()
  File "/home/xd003/udemy-dl/udemy/_internal.py", line 56, in _fetch_course
    self._info              =       self._real_extract(self._url)
  File "/home/xd003/udemy-dl/udemy/_extract.py", line 469, in _real_extract
    course_json = self._extract_course_json(url, course_id, portal_name)
  File "/home/xd003/udemy-dl/udemy/_extract.py", line 270, in _extract_course_json
    resp = self._extract_large_course_content(url=url)
  File "/home/xd003/udemy-dl/udemy/_extract.py", line 234, in _extract_large_course_content
    data = self._session._get(url).json()
  File "/usr/lib/python3.8/site-packages/requests/models.py", line 898, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.8/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)

Screenshots
If applicable, add screenshots to help explain your problem.
g

Python Environment (please complete the following information):

  • OS Platform: Manjaro Linux x86_64
  • Python Version: 3.8.3

Update - i tried this same command on another course i have in my account and didnt got error on it . I dont know if that matters but this course on which i have got this error is kinda big in size - it has 41 chapters/sections and 405 lectures

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions