Browse Source

Log search result stats

main
fluffy 6 months ago
parent
commit
5c0231469a
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      beatbot.py

+ 3
- 0
beatbot.py View File

@@ -43,6 +43,9 @@ def bot():
f'https://www.youtube.com/results?search_query={search_term}')
video_ids = re.findall(r'watch\?v=([^"]{11})"', query.text)

LOGGER.info("%s: got %d videos (%d new)", search_term,
len(video_ids), len(set(video_ids) - seen_vids))

if query.status_code != 200 or not video_ids:
LOGGER.warning("YouTube search %s returned %d",
query.url, query.status_code)


Loading…
Cancel
Save