BUGFIX - Updating user-agents.txt and timthubs
parent
ad3cf3c6dd
commit
dd794cfcea
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
|
@ -47,10 +47,14 @@ def format_url(url):
|
||||||
name : unzip_file()
|
name : unzip_file()
|
||||||
description : unzip a file, used for user-agents.txt and timthumbs.txt
|
description : unzip a file, used for user-agents.txt and timthumbs.txt
|
||||||
"""
|
"""
|
||||||
# TODO improve this , os.system is a dirty method
|
|
||||||
def unzip_file(filename):
|
def unzip_file(filename):
|
||||||
os.system('mv '+ filename + ' ' + filename + ".gz")
|
with open(filename, 'r') as f:
|
||||||
os.system('gzip -d '+ filename+".gz")
|
data = f.read()
|
||||||
|
|
||||||
|
# Check for a buggy .gz
|
||||||
|
if not "/timthumb.php" in data and not "Mozilla/5.0" in data:
|
||||||
|
os.system('mv '+ filename + ' ' + filename + ".gz")
|
||||||
|
os.system('gzip -d '+ filename+".gz")
|
||||||
|
|
||||||
"""
|
"""
|
||||||
name : database_update()
|
name : database_update()
|
||||||
|
|
Loading…
Reference in New Issue