]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
Remove integer casts and replace them with long integer casts
authorRicardo Garcia <sarbalap+freshmeat@gmail.com>
Wed, 27 May 2009 21:03:56 +0000 (23:03 +0200)
committerRicardo Garcia <sarbalap+freshmeat@gmail.com>
Sun, 31 Oct 2010 10:24:36 +0000 (11:24 +0100)
youtube-dl

index 6afdc0e6a2bbfd2ddf350e3df08fa906687e536b..06ba25d9a8f134797c86ef8cdc232ff68d9451d8 100755 (executable)
@@ -182,13 +182,13 @@ class FileDownloader(object):
                new_min = max(bytes / 2.0, 1.0)
                new_max = min(max(bytes * 2.0, 1.0), 4194304) # Do not surpass 4 MB
                if elapsed_time < 0.001:
-                       return int(new_max)
+                       return long(new_max)
                rate = bytes / elapsed_time
                if rate > new_max:
-                       return int(new_max)
+                       return long(new_max)
                if rate < new_min:
-                       return int(new_min)
-               return int(rate)
+                       return long(new_min)
+               return long(rate)
 
        @staticmethod
        def parse_bytes(bytestr):
@@ -895,7 +895,7 @@ class YoutubeSearchIE(InfoExtractor):
                        return
                else:
                        try:
-                               n = int(prefix)
+                               n = long(prefix)
                                if n <= 0:
                                        self._downloader.trouble(u'ERROR: invalid download number %s for query "%s"' % (n, query))
                                        return
@@ -904,7 +904,7 @@ class YoutubeSearchIE(InfoExtractor):
                                        n = self._max_youtube_results
                                self._download_n_results(query, n)
                                return
-                       except ValueError: # parsing prefix as int fails
+                       except ValueError: # parsing prefix as integer fails
                                self._download_n_results(query, 1)
                                return