def Start(): HTTP.ClearCache() HTTP.CacheTime = CACHE_1MINUTE * 20 HTTP.Headers['User-Agent'] = PAutils.getUserAgent() HTTP.Headers['Accept-Encoding'] = 'gzip' requests.packages.urllib3.disable_warnings()
def Start(): HTTP.ClearCache() HTTP.CacheTime = CACHE_1MINUTE * 20 HTTP.Headers['User-Agent'] = PAutils.getUserAgent(True) HTTP.Headers['Accept-Encoding'] = 'gzip' requests.packages.urllib3.disable_warnings() dateNowObj = datetime.now() debug_dir = os.path.realpath('debug_data') if os.path.exists(debug_dir): for directoryName in os.listdir(debug_dir): debugDateObj = parse(directoryName) if abs((dateNowObj - debugDateObj).days) > 3: debugLogs = os.path.join(debug_dir, directoryName) shutil.rmtree(debugLogs) Log('Deleted debug data: %s' % directoryName)