more logging

This commit is contained in:
boyska 2021-09-24 23:28:49 +02:00
parent 7af0cfbe18
commit d4525c1f66

7
feed
View file

@ -510,6 +510,7 @@ def retrieve(url, args):
def audio_passes_filters(audio, args):
logging.debug(audio.end_date)
if not audio.valid:
return False
if args.max_len and audio.duration > args.max_len:
@ -545,8 +546,10 @@ def main():
audio_by_source = OrderedDict()
for i, url in enumerate(sources):
url_audios = retrieve(url, args)
url_audios = list(retrieve(url, args))
logging.debug("Found %d audios in %s", len(url_audios), url)
url_audios = [au for au in url_audios if audio_passes_filters(au, args)]
logging.debug("%d of those are passing filters", len(url_audios))
audio_by_source[url] = url_audios
if not url_audios:
weights[i] = 0
@ -558,6 +561,8 @@ def main():
for source_url in sources:
audios += audio_by_source[source_url]
logging.debug("Found %d audios", len(audios))
# sort
if args.sort_by == "random":
random.shuffle(audios)