Skip to content

Commit cc1570e

Browse files
committed
Fix empty downloaded files
1 parent 5f63559 commit cc1570e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

CanvasSync/utilities/instructure_api.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,13 @@ def download_item_information(self, url):
136136
url = url.split(self.settings.domain)[-1]
137137
return self.get_json(url)
138138

139-
def download_file_payload(self, donwload_url):
139+
def download_file_payload(self, download_url):
140140
"""
141141
Returns the payload of a specified file in the Canvas system
142142
143143
donwload_url : string | The API download url pointing to a file in the Canvas system
144144
"""
145-
url = donwload_url.split(self.settings.domain)[-1]
146-
return self._get(url).content
145+
return requests.get(download_url).content
147146

148147
def get_assignments_in_course(self, course_id):
149148
"""

0 commit comments

Comments
 (0)