Update utf8 errro

This commit is contained in:
sigvartmh
2017-05-16 13:20:20 +02:00
parent 6e9104712c
commit 0b54e6887b
2 changed files with 3 additions and 2 deletions

2
app.py
View File

@@ -15,7 +15,7 @@ def download(btn):
selected = app.getCheckBox(courses[label]) selected = app.getCheckBox(courses[label])
if selected: if selected:
course_links[label]=courses[label] course_links[label]=courses[label]
print(course_links) #print(course_links.encode('utf-8'))
print("Download selected") print("Download selected")
scraper.download_links(course_links) scraper.download_links(course_links)

View File

@@ -146,9 +146,10 @@ class itslearning_scraper():
except: except:
filename = title filename = title
self.failure += 1 self.failure += 1
print("File created with name:",filename)
filename = slugify(filename) filename = slugify(filename)
print("File created with name:",filename)
filename = os.path.join(os.path.abspath(os.path.curdir),filename) filename = os.path.join(os.path.abspath(os.path.curdir),filename)
print("File created with path:",filename)
with open(filename, 'wb') as f: with open(filename, 'wb') as f:
for chunk in r.iter_content(chunk_size=1024): for chunk in r.iter_content(chunk_size=1024):
if chunk: if chunk: