john commited on
Commit
d966a0d
·
1 Parent(s): d5e450b

added prefix_number option to the tests

Browse files
pytube/contrib/playlist.py CHANGED
@@ -66,7 +66,7 @@ class Playlist(object):
66
  complete_url = base_url + video_id
67
  self.video_urls.append(complete_url)
68
 
69
- def download_all(self, download_path=None, file_number_prefix=True):
70
  """Download all the videos in the the playlist. Initially, download
71
  resolution is 720p (or highest available), later more option
72
  should be added to download resolution of choice
@@ -90,7 +90,7 @@ class Playlist(object):
90
  while True:
91
  prefix = str(i)
92
  if len(prefix) < digits:
93
- for f in range(digits - len(prefix)):
94
  prefix = "0" + prefix
95
  prefix += " "
96
  i += 1
 
66
  complete_url = base_url + video_id
67
  self.video_urls.append(complete_url)
68
 
69
+ def download_all(self, download_path=None, prefix_number=True):
70
  """Download all the videos in the the playlist. Initially, download
71
  resolution is 720p (or highest available), later more option
72
  should be added to download resolution of choice
 
90
  while True:
91
  prefix = str(i)
92
  if len(prefix) < digits:
93
+ for _ in range(digits - len(prefix)):
94
  prefix = "0" + prefix
95
  prefix += " "
96
  i += 1
tests/test_playlist.py CHANGED
@@ -50,3 +50,5 @@ def test_download():
50
  )
51
  ob.download_all()
52
  ob.download_all('.')
 
 
 
50
  )
51
  ob.download_all()
52
  ob.download_all('.')
53
+ ob.download_all(prefix_number=False)
54
+ ob.download_all('.', prefix_number=False)