| @@ -25,11 +25,11 @@ CONFIG: dict[str, DbConfig] = { 'mysql': { 'driver': 'mysql', | |||||
| DB = DatabaseManager (CONFIG) | DB = DatabaseManager (CONFIG) | ||||
| Model.set_connection_resolver (DB) | Model.set_connection_resolver (DB) | ||||
| KIRIBAN_VIEWS_COUNTS: set[int] = { *range (1_000, 10_000, 1_000), | |||||
| *range (10_000, 1_000_001, 10_000), | |||||
| 194, 245, 510, 810, 114_514, 1_940, 2_450, 5_100, | |||||
| 19_400, 24_500, 51_000, 93_194, 2_424, 242_424, 1_919, 4_545, | |||||
| 194_245, 245_194, 510_245 } | |||||
| KIRIBAN_VIEWS_COUNTS: list[int] = sorted ({ *range (1_000, 10_000, 1_000), | |||||
| *range (10_000, 1_000_001, 10_000), | |||||
| 194, 245, 510, 810, 114_514, 1_940, 2_450, 5_100, | |||||
| 19_400, 24_500, 51_000, 93_194, 2_424, 242_424, 1_919, | |||||
| 4_545, 194_245, 245_194, 510_245 }) | |||||
| class VideoInfo (TypedDict): | class VideoInfo (TypedDict): | ||||
| contentId: str | contentId: str | ||||
| @@ -143,6 +143,8 @@ def get_kiriban_list ( | |||||
| .where ('views_count', '>=', kiriban_views_count) | .where ('views_count', '>=', kiriban_views_count) | ||||
| .get ()) }) | .get ()) }) | ||||
| for code in targets: | for code in targets: | ||||
| if code in [kiriban[1]['contentId'] for kiriban in kiriban_list]: | |||||
| continue | |||||
| video_info = get_video_info (code) | video_info = get_video_info (code) | ||||
| if video_info is not None: | if video_info is not None: | ||||
| kiriban_list.append ((kiriban_views_count, video_info, | kiriban_list.append ((kiriban_views_count, video_info, | ||||