Browse Source

more logging

boyska 2 years ago
parent
commit
d4525c1f66
1 changed files with 6 additions and 1 deletions
  1. 6 1
      feed

+ 6 - 1
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)