Removed my hardcoded path I had lazily set.
Browse files- youtube/youtube.py +2 -2
youtube/youtube.py
CHANGED
@@ -71,7 +71,7 @@ class Video(object):
|
|
71 |
"""
|
72 |
response = urlopen(self.url)
|
73 |
#TODO: Allow a destination path to be specified.
|
74 |
-
dst_file = open(
|
75 |
meta_data = response.info()
|
76 |
file_size = int(meta_data.getheaders("Content-Length")[0])
|
77 |
print "Downloading: %s Bytes: %s" % (self.filename, file_size)
|
@@ -126,7 +126,7 @@ class YouTube(object):
|
|
126 |
generated based on the name of the video.
|
127 |
"""
|
128 |
if not self._filename:
|
129 |
-
self._filename =
|
130 |
return self._filename
|
131 |
|
132 |
@filename.setter
|
|
|
71 |
"""
|
72 |
response = urlopen(self.url)
|
73 |
#TODO: Allow a destination path to be specified.
|
74 |
+
dst_file = open(self.filename, 'wb')
|
75 |
meta_data = response.info()
|
76 |
file_size = int(meta_data.getheaders("Content-Length")[0])
|
77 |
print "Downloading: %s Bytes: %s" % (self.filename, file_size)
|
|
|
126 |
generated based on the name of the video.
|
127 |
"""
|
128 |
if not self._filename:
|
129 |
+
self._filename = safe_filename(self.title)
|
130 |
return self._filename
|
131 |
|
132 |
@filename.setter
|