Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions infoq_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import requests
import cssselect
import lxml.html
import unicodedata
from slugify import slugify

if sys.version_info.major == 3:
text_type = str
Expand Down Expand Up @@ -68,7 +68,7 @@

# presentation folder path
if isinstance(title, text_type):
normalized_title = unicodedata.normalize('NFKD', title)
normalized_title = slugify(title)
else:
normalized_title = text_type(title)
presentation_directory = os.path.join(download_directory, normalized_title)
Expand Down Expand Up @@ -119,7 +119,7 @@
else:
bytes_downloaded = 0

r = requests.get(video_url, stream=True,
r = requests.get('http:%s' % video_url, stream=True,
headers={'Range': 'bytes={0}-'.format(bytes_downloaded)})
content_length = int(r.headers['content-length']) + bytes_downloaded

Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
requests
lxml
cssselect
cssselect
python-slugify