more logging
This commit is contained in:
parent
7af0cfbe18
commit
d4525c1f66
1 changed files with 6 additions and 1 deletions
7
feed
7
feed
|
@ -510,6 +510,7 @@ def retrieve(url, args):
|
||||||
|
|
||||||
|
|
||||||
def audio_passes_filters(audio, args):
|
def audio_passes_filters(audio, args):
|
||||||
|
logging.debug(audio.end_date)
|
||||||
if not audio.valid:
|
if not audio.valid:
|
||||||
return False
|
return False
|
||||||
if args.max_len and audio.duration > args.max_len:
|
if args.max_len and audio.duration > args.max_len:
|
||||||
|
@ -545,8 +546,10 @@ def main():
|
||||||
|
|
||||||
audio_by_source = OrderedDict()
|
audio_by_source = OrderedDict()
|
||||||
for i, url in enumerate(sources):
|
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)]
|
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
|
audio_by_source[url] = url_audios
|
||||||
if not url_audios:
|
if not url_audios:
|
||||||
weights[i] = 0
|
weights[i] = 0
|
||||||
|
@ -558,6 +561,8 @@ def main():
|
||||||
for source_url in sources:
|
for source_url in sources:
|
||||||
audios += audio_by_source[source_url]
|
audios += audio_by_source[source_url]
|
||||||
|
|
||||||
|
logging.debug("Found %d audios", len(audios))
|
||||||
|
|
||||||
# sort
|
# sort
|
||||||
if args.sort_by == "random":
|
if args.sort_by == "random":
|
||||||
random.shuffle(audios)
|
random.shuffle(audios)
|
||||||
|
|
Loading…
Reference in a new issue