]> gitweb @ CieloNegro.org - youtube-dl.git/blobdiff - youtube-dl
Restore INTERNAL version number
[youtube-dl.git] / youtube-dl
index 591b7fc33f4f212335e33f3683695528e428f206..6730898ac757dc4d267944459dcb014d080a292a 100755 (executable)
@@ -114,6 +114,7 @@ class FileDownloader(object):
        ignoreerrors:   Do not stop on download errors.
        ratelimit:      Download speed limit, in bytes/sec.
        nooverwrites:   Prevent overwriting files.
+       continuedl:     Try to continue downloads if possible.
        """
 
        params = None
@@ -182,13 +183,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):
@@ -397,8 +398,8 @@ class FileDownloader(object):
                                raise
                        data = urllib2.urlopen(basic_request)
                        content_length = data.info()['Content-Length']
-                       if content_length is not None and content_length == resume_len:
-                               self.report_file_already_downloaded(self.name)
+                       if content_length is not None and long(content_length) == resume_len:
+                               self.report_file_already_downloaded(stream.name)
                                return
                        else:
                                self.report_unable_to_resume()
@@ -895,7 +896,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 +905,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