Browse Source

botiboti

main
みてるぞ 1 month ago
parent
commit
4f2056b347
1 changed files with 3 additions and 4 deletions
  1. +3
    -4
      nico.py

+ 3
- 4
nico.py View File

@@ -130,9 +130,6 @@ def get_kiriban_list (
latest_fetched_at = cast (date, (VideoHistory
.where ('fetched_at', '<=', base_date)
.max ('fetched_at')))
previous_fetched_at = cast (date, (VideoHistory
.where ('fetched_at', '<', latest_fetched_at)
.max ('fetched_at')))

for kiriban_views_count in KIRIBAN_VIEWS_COUNTS:
targets = { vh.video.code for vh in (VideoHistory
@@ -143,7 +140,9 @@ def get_kiriban_list (
if code in [kiriban[1]['contentId'] for kiriban in kiriban_list]:
continue
previous_views_count = cast (int, (VideoHistory
.where ('code', code)
.where_has ('videos',
lambda q: q.where (
'code', code))
.where ('fetched_at', '<', latest_fetched_at)
.max ('views_count')))
if previous_views_count >= kiriban_views_count:


Loading…
Cancel
Save