mirror of
				https://github.com/tiyn/stud.ip-crawler.git
				synced 2025-10-31 11:11:18 +01:00 
			
		
		
		
	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
This commit is contained in:
		| @@ -67,7 +67,7 @@ class Crawler: | |||||||
|         self.create_dir(base_dir) |         self.create_dir(base_dir) | ||||||
|         curr_courses = self.studip.get_curr_courses( |         curr_courses = self.studip.get_curr_courses( | ||||||
|             self.studip.get_uid(), self.studip.get_curr_semester()) |             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) |         os.chdir(base_dir) | ||||||
|         for course in curr_courses: |         for course in curr_courses: | ||||||
|             log.debug('course is ' + curr_courses[course]) |             log.debug('course is ' + curr_courses[course]) | ||||||
|   | |||||||
| @@ -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'] | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user