|
@@ -256,17 +256,17 @@ def process_segment(item, audios=None, calibration=None):
|
|
audios_counter = 0
|
|
audios_counter = 0
|
|
results = []
|
|
results = []
|
|
|
|
|
|
- try:
|
|
|
|
- for path, name, ts in audios_iterable:
|
|
|
|
- short_path = os.path.join(station, name)
|
|
|
|
- audios_counter += os.path.isfile(path)
|
|
|
|
- values = []
|
|
|
|
|
|
+ for path, name, ts in audios_iterable:
|
|
|
|
+ short_path = os.path.join(station, name)
|
|
|
|
+ audios_counter += os.path.isfile(path)
|
|
|
|
+ values = []
|
|
|
|
|
|
- if not os.path.isfile(path):
|
|
|
|
- log.error('[process_segment] file not found: {}'\
|
|
|
|
- .format(short_path))
|
|
|
|
- continue
|
|
|
|
|
|
+ if not os.path.isfile(path):
|
|
|
|
+ log.error('[process_segment] file not found: {}'\
|
|
|
|
+ .format(short_path))
|
|
|
|
+ continue
|
|
|
|
|
|
|
|
+ try:
|
|
for match in dejavu.recognize(recognizer, path, segment_size,
|
|
for match in dejavu.recognize(recognizer, path, segment_size,
|
|
ads_filter=[md5hash]):
|
|
ads_filter=[md5hash]):
|
|
results.append({
|
|
results.append({
|
|
@@ -285,8 +285,8 @@ def process_segment(item, audios=None, calibration=None):
|
|
station,
|
|
station,
|
|
))
|
|
))
|
|
|
|
|
|
- except CouldntDecodeError as ex:
|
|
|
|
- log.error('[process_segment] {}'.format(ex))
|
|
|
|
|
|
+ except CouldntDecodeError as ex:
|
|
|
|
+ log.error('[process_segment] {}'.format(ex))
|
|
|
|
|
|
try:
|
|
try:
|
|
response = client.put_schedule_results(
|
|
response = client.put_schedule_results(
|