|
|
@ -4,6 +4,7 @@ import logging as log
|
|
|
|
#from tqdm import tqdm
|
|
|
|
#from tqdm import tqdm
|
|
|
|
import requests as req
|
|
|
|
import requests as req
|
|
|
|
from requests.auth import HTTPBasicAuth
|
|
|
|
from requests.auth import HTTPBasicAuth
|
|
|
|
|
|
|
|
import json
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Studip:
|
|
|
|
class Studip:
|
|
|
@ -72,7 +73,7 @@ class Studip:
|
|
|
|
Returns:
|
|
|
|
Returns:
|
|
|
|
string: id of the current semester
|
|
|
|
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()
|
|
|
|
ord_sems = self.get_ordered_semesters()
|
|
|
|
courses = rsp.json()['collection']
|
|
|
|
courses = rsp.json()['collection']
|
|
|
|
course_list = {}
|
|
|
|
course_list = {}
|
|
|
@ -158,7 +159,6 @@ class Studip:
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
rsp = self.auth_req('/api.php/folder/' + folder)
|
|
|
|
rsp = self.auth_req('/api.php/folder/' + folder)
|
|
|
|
subdirs = rsp.json()['subfolders']
|
|
|
|
subdirs = rsp.json()['subfolders']
|
|
|
|
docs = rsp.json()['file_refs']
|
|
|
|
|
|
|
|
res_subdirs = {}
|
|
|
|
res_subdirs = {}
|
|
|
|
for subdir in subdirs:
|
|
|
|
for subdir in subdirs:
|
|
|
|
sub_id = subdir['id']
|
|
|
|
sub_id = subdir['id']
|
|
|
|