From d4525c1f66e7b3e940b68341c23ff2b3d1988fb8 Mon Sep 17 00:00:00 2001 From: boyska Date: Fri, 24 Sep 2021 23:28:49 +0200 Subject: [PATCH] more logging --- feed | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/feed b/feed index b145aff..eda2207 100755 --- a/feed +++ b/feed @@ -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)