From 92ee51e56c8bd3c1f5fc1d38887d63b66bb6bbd7 Mon Sep 17 00:00:00 2001 From: TiynGER Date: Tue, 10 Nov 2020 11:51:56 +0100 Subject: [PATCH] bugfixes: now all courses in the curr semester get downloaded - limit for courses was set to low to display current courses - unused variable docs was removed from local function --- src/crawler.py | 2 +- src/studip.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/crawler.py b/src/crawler.py index 14feffb..c61a266 100644 --- a/src/crawler.py +++ b/src/crawler.py @@ -67,7 +67,7 @@ class Crawler: self.create_dir(base_dir) curr_courses = self.studip.get_curr_courses( self.studip.get_uid(), self.studip.get_curr_semester()) - log.info('crawling all current courses' + curr_courses) + log.info('crawling all current courses') os.chdir(base_dir) for course in curr_courses: log.debug('course is ' + curr_courses[course]) diff --git a/src/studip.py b/src/studip.py index c4b514a..ad83392 100755 --- a/src/studip.py +++ b/src/studip.py @@ -4,6 +4,7 @@ import logging as log #from tqdm import tqdm import requests as req from requests.auth import HTTPBasicAuth +import json class Studip: @@ -72,7 +73,7 @@ class Studip: Returns: string: id of the current semester """ - rsp = self.auth_req('/api.php/user/' + user_id + '/courses') + rsp = self.auth_req('/api.php/user/' + user_id + '/courses?limit=1000') ord_sems = self.get_ordered_semesters() courses = rsp.json()['collection'] course_list = {} @@ -158,7 +159,6 @@ class Studip: """ rsp = self.auth_req('/api.php/folder/' + folder) subdirs = rsp.json()['subfolders'] - docs = rsp.json()['file_refs'] res_subdirs = {} for subdir in subdirs: sub_id = subdir['id']