Skip to content

Commit

Permalink
added title into file name
Browse files Browse the repository at this point in the history
  • Loading branch information
soraxas committed Nov 12, 2018
1 parent fe9e452 commit 6e7bc39
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion echo360/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def download_all(self):
videos_to_be_download = []
for video in reversed(filtered_videos): # reverse so we download newest first
lecture_number = self._find_pos(videos, video)
title = "Lecture {}".format(lecture_number + 1)
title = "Lecture {} [{}]".format(lecture_number + 1, video.title)
filename = self._get_filename(self._course.course_id, video.date,
title)
videos_to_be_download.append((filename, video))
Expand Down
6 changes: 6 additions & 0 deletions echo360/videos.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ def __init__(self, video_json, driver):

date = dateutil.parser.parse(video_json["startTime"]).date()
self._date = date.strftime("%Y-%m-%d")
self._title = video_json['title']

except KeyError as e:
self._blow_up("Unable to parse video data from JSON (course_data)",
e)
Expand Down Expand Up @@ -103,6 +105,10 @@ def date(self):
def url(self):
return self._url

@property
def title(self):
return self._title

@staticmethod
def get_date(video_json):
try:
Expand Down

0 comments on commit 6e7bc39

Please sign in to comment.