def match_ratio(file_db_path, title, lock): val = 1 # 表示正常的 with lock: filedb = FileBsd('hash', file_db_path) if secondary_filter(title.strip()): val = 2 # 表示过滤的 tit_comp = md5(title.strip()) if filedb.has_key(tit_comp): val = 0 # 表示上一次抓过的 else: filedb.put(tit_comp) filedb.close() return val