Jose Diaz-Gonzalez commited on
Commit
6ec654e
·
1 Parent(s): b272f24

Add missing whitespace between operators

Browse files
Files changed (5) hide show
  1. pytube/api.py +1 -1
  2. pytube/models.py +1 -1
  3. pytube/utils.py +3 -3
  4. scripts/pytubectl +1 -1
  5. setup.py +1 -1
pytube/api.py CHANGED
@@ -219,7 +219,7 @@ class YouTube(object):
219
  def _findBetween(self, s, first, last):
220
  try:
221
  start = s.index(first) + len(first)
222
- end = s.index( last, start )
223
  return s[start:end]
224
  except ValueError:
225
  return ""
 
219
  def _findBetween(self, s, first, last):
220
  try:
221
  start = s.index(first) + len(first)
222
+ end = s.index(last, start)
223
  return s[start:end]
224
  except ValueError:
225
  return ""
pytube/models.py CHANGED
@@ -30,7 +30,7 @@ class Video(object):
30
  self.filename = filename
31
  self.__dict__.update(**attributes)
32
 
33
- def download(self, path=None, chunk_size=8*1024,
34
  on_progress=None, on_finish=None):
35
  """
36
  Downloads the file of the URL defined within the class
 
30
  self.filename = filename
31
  self.__dict__.update(**attributes)
32
 
33
+ def download(self, path=None, chunk_size=8 * 1024,
34
  on_progress=None, on_finish=None):
35
  """
36
  Downloads the file of the URL defined within the class
pytube/utils.py CHANGED
@@ -60,7 +60,7 @@ def sizeof(bytes):
60
  for factor, suffix in alternative:
61
  if bytes >= factor:
62
  break
63
- amount = int(bytes/factor)
64
  if isinstance(suffix, tuple):
65
  singular, multiple = suffix
66
  if amount == 1:
@@ -83,6 +83,6 @@ def print_status(progress, file_size, start):
83
 
84
  percentDone = int(progress) * 100. / file_size
85
  done = int(50 * progress / int(file_size))
86
- stdout.write("\r [%s%s][%3.2f%%] %s at %s/s\r " % ('=' * done, ' ' * (50-done), percentDone,
87
- sizeof(file_size), sizeof(progress//(clock() - start))))
88
  stdout.flush()
 
60
  for factor, suffix in alternative:
61
  if bytes >= factor:
62
  break
63
+ amount = int(bytes / factor)
64
  if isinstance(suffix, tuple):
65
  singular, multiple = suffix
66
  if amount == 1:
 
83
 
84
  percentDone = int(progress) * 100. / file_size
85
  done = int(50 * progress / int(file_size))
86
+ stdout.write("\r [%s%s][%3.2f%%] %s at %s/s\r " % ('=' * done, ' ' * (50 - done), percentDone,
87
+ sizeof(file_size), sizeof(progress // (clock() - start))))
88
  stdout.flush()
scripts/pytubectl CHANGED
@@ -30,7 +30,7 @@ def _main():
30
  try:
31
  yt.url = args.url
32
  res_formts = yt.videos
33
- res_formts = ["%s %s"% (str(res_formts[index].extension), str(res_formts[index].resolution)) for index, video in enumerate(res_formts)]
34
  except YouTubeError:
35
  print "Incorrect video URL."
36
  sys.exit(1)
 
30
  try:
31
  yt.url = args.url
32
  res_formts = yt.videos
33
+ res_formts = ["%s %s" % (str(res_formts[index].extension), str(res_formts[index].resolution)) for index, video in enumerate(res_formts)]
34
  except YouTubeError:
35
  print "Incorrect video URL."
36
  sys.exit(1)
setup.py CHANGED
@@ -18,7 +18,7 @@ setup(
18
  packages=packages,
19
  download_url="https://github.com/NFicano/pytube/tarball/0.1.16",
20
  license="MIT License",
21
- scripts = ['scripts/pytubectl'],
22
  classifiers=[
23
  "Development Status :: 4 - Beta",
24
  "Environment :: Console",
 
18
  packages=packages,
19
  download_url="https://github.com/NFicano/pytube/tarball/0.1.16",
20
  license="MIT License",
21
+ scripts=['scripts/pytubectl'],
22
  classifiers=[
23
  "Development Status :: 4 - Beta",
24
  "Environment :: Console",