| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. |
| 2 | 5 |
| 3 import urllib,sys | 6 import urllib,sys |
| 4 | 7 |
| 5 | 8 |
| 6 url = 'http://safebrowsing.clients.google.com/safebrowsing/downloads?client=goog
leclient&appver=1.0&pver=2.1' | 9 url = 'http://safebrowsing.clients.google.com/safebrowsing/downloads?client=goog
leclient&appver=1.0&pver=2.1' |
| 7 | 10 |
| 8 if len(sys.argv) == 1: | 11 if len(sys.argv) == 1: |
| 9 data = 'goog-phish-shavar;\ngoog-malware-shavar;\n' | 12 data = 'goog-phish-shavar;\ngoog-malware-shavar;\n' |
| 10 else: | 13 else: |
| 11 post_data_file = sys.argv[1] | 14 post_data_file = sys.argv[1] |
| (...skipping 14 matching lines...) Expand all Loading... |
| 26 continue | 29 continue |
| 27 | 30 |
| 28 chunk_url = 'http://' + line[2:] | 31 chunk_url = 'http://' + line[2:] |
| 29 filename = chunk_url[chunk_url.rfind('/') + 1:] | 32 filename = chunk_url[chunk_url.rfind('/') + 1:] |
| 30 filename = "%03d" % counter + filename[0:filename.rfind('_')] | 33 filename = "%03d" % counter + filename[0:filename.rfind('_')] |
| 31 counter += 1 | 34 counter += 1 |
| 32 | 35 |
| 33 urllib.urlretrieve(chunk_url, filename) | 36 urllib.urlretrieve(chunk_url, filename) |
| 34 | 37 |
| 35 response_file.close() | 38 response_file.close() |
| OLD | NEW |