Gaarv / kadenze-dl

Small application to download Kadenze (https://www.kadenze.com) videos for courses you enrolled in
MIT License
50 stars 16 forks source link

JSON error? #10

Closed sambilbow closed 5 years ago

sambilbow commented 5 years ago

Sams-iMac:kadenze-dl sam$ cd /Users/sam/Desktop/kadenze-dl/kadenze-dl Sams-iMac:kadenze-dl sam$ python3.7 kadenze-dl.py Signing in www.kadenze.com ... Selected courses for download: real-time-audio-signal-processing-in-faust machine-learning-for-musicians-and-artists-v introduction-to-programming-for-the-visual-arts-with-p5-js-vi creative-programming-for-audiovisual-art-i programming-max-structuring-interactive-software-for-digital-arts-i exploring-the-mixed-reality-landscape Parsing course: real-time-audio-signal-processing-in-faust Traceback (most recent call last): File "kadenze-dl.py", line 10, in main() File "kadenze-dl.py", line 6, in main client.download_all_courses_videos() File "/Users/sam/Desktop/kadenze-dl/kadenze-dl/kadenzeclient.py", line 83, in download_all_courses_videos self.download_course_videos(course) File "/Users/sam/Desktop/kadenze-dl/kadenze-dl/kadenzeclient.py", line 63, in download_course_videos sessions = self.list_sessions(course) File "/Users/sam/Desktop/kadenze-dl/kadenze-dl/kadenzeclient.py", line 34, in list_sessions sessions = helpers.get_sessions_from_json(response) File "/Users/sam/Desktop/kadenze-dl/kadenze-dl/helpers.py", line 33, in get_sessions_from_json json_string = json.loads(response) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/init.py", line 348, in loads return _default_decoder.decode(s) File "/Library/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 "/Library/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) Sams-iMac:kadenze-dl sam$

This is after changing the path, putting my correct login details, installing requirements.txt.

I have also tried using "python kadenze-dl.py" however it spits out a syntax error if I do so, so I used python3.7 to ensure its using the latest version

Sams-iMac:kadenze-dl sam$ python kadenze-dl.py Traceback (most recent call last): File "kadenze-dl.py", line 1, in <module> from kadenzeclient import KadenzeClient File "/Users/sam/Desktop/kadenze-dl/kadenze-dl/kadenzeclient.py", line 2, in <module> import helpers File "/Users/sam/Desktop/kadenze-dl/kadenze-dl/helpers.py", line 71 print(s, end='', flush=True) ^ SyntaxError: invalid syntax

Gaarv commented 5 years ago

I haven't tried 3.7 yet but it could be a change on the site. Im not home for a couple days, I will check that this week end, thanks for the report.

Gaarv commented 5 years ago

Okay after a quick review, it seems the cause is "real-time-audio-signal-processing-in-faust" not having started yet (scheduled) so it doesn't have any sessions or videos.

You should disable it for now and listing only those you need. I will work on a fix to detect that kind of course in the next week or so.

Gaarv commented 5 years ago

Fix is available, just update from the repository and you're good to go :)