r0oth3x49 / udemy-dl

A cross-platform python based utility to download courses from udemy for personal offline use.
MIT License
4.85k stars 1.2k forks source link

Traceback (Most Recent Call Last) #36

Closed coozgan closed 6 years ago

coozgan commented 6 years ago

Hello, Im having this problem, I am having error like this can you help me?

Traceback (most recent call last):
  File "udemy-dl.py", line 896, in <module>
    main()
  File "udemy-dl.py", line 529, in main
    config       = use_cached_creds()
  File "C:\Users\cooz\Desktop\udemy-dl\udemy\_utils.py", line 40, in use_cached_credentials
    creds = json.load(fout)
  File "C:\Users\cooz\AppData\Local\Programs\Python\Python36-32\lib\json\__init__.py", line 299, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "C:\Users\cooz\AppData\Local\Programs\Python\Python36-32\lib\json\__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "C:\Users\cooz\AppData\Local\Programs\Python\Python36-32\lib\json\decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\cooz\AppData\Local\Programs\Python\Python36-32\lib\json\decoder.py", line 355, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid \escape: line 5 column 18 (char 117)
r0oth3x49 commented 6 years ago

@coozgan details required. what command you are using & all other things?

coozgan commented 6 years ago

Hey, I used the python udemy-dl.py https://www.udemy.com/COURSE_NAME I use the configuration provided to input my credentials.

r0oth3x49 commented 6 years ago

@coozgan delete the configuration file and then try to download

coozgan commented 6 years ago

Hello @r0oth3x49 , I made it work thanks. But was there a way that I can use it with configuration? Thanks by the way. Also, if you just don't mind. can you tweak a bit of the saved links, as it saves the keyword not the actual link. Thanks. Have a great day!

r0oth3x49 commented 6 years ago

@coozgan yes there is a way. initially use -c or --config command also mention in README how you can cache your credentials. Example:

python udemy-dl.py -u USERNAME -p P4SSWORD COURSE_URL --config

OR

python udemy-dl.py COURSE_URL --config

untitled

this command will create a configuration file for you which then you can edit using any text editor configuration file will looks like. untitled1

Note You can edit only these and do not remove inverted commas (") you should write inside like "1080"

When you will run the script again it will use the configuration file. untitled

and it will be great if you explain a bit the second thing you want me to done. not getting your point. Also, if you just don't mind. can you tweak a bit of the saved links, as it saves the keyword not the actual link.

coozgan commented 6 years ago

Here is how your external links work; it saves links as text and it only prints the keywords like this

- b'Dual-Booting-explained'  /*This is not a link*/
- b'Exploiting-dram-rowhammer-Could-be-used-on-VMs-in-the-future-' /*This is not a link*/
- b'https://googleprojectzero.blogspot.co.uk/2015/03/exploiting-dram-rowhammer-bug-to-gain.html' /*This is the only link/
- b'How-to-run-your-Applications-in-a-Mac-OS-X-sandbox-to-enhance-security'  /*This is not a link*/

I commented it as not link because its a keyword.

r0oth3x49 commented 6 years ago

@coozgan are talking about external-links.txt file created by this script or when you simply use --save-links command. if external-links.txt then it simply writes the content given by udemy in ExternalLink asset. one thing i can add that skipping those external links.

r0oth3x49 commented 6 years ago

@coozgan i m closing this issue and i will w8 for more suggestion about changing the way you suggested.