BUGFIX - Updating user-agents.txt and timthubs

pull/25/head
Swissky 2018-10-09 14:09:06 +02:00
parent ad3cf3c6dd
commit dd794cfcea
6 changed files with 3314 additions and 554 deletions

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

View File

@ -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()