Browse Source

#20

feature/020
みてるぞ 2 weeks ago
parent
commit
f34ff2a0f6
1 changed files with 39 additions and 39 deletions
  1. +39
    -39
      update_db.py

+ 39
- 39
update_db.py View File

@@ -34,45 +34,6 @@ logging.basicConfig (
format = '%(asctime)s %(levelname)s %(message)s')


class SearchNicoResult (TypedDict):
videos: list['VideoResult']
is_complete: bool


class UpdateContext (TypedDict):
api_data: list['VideoResult']
comments_by_video_code: dict[str, list['CommentResult']]
deletable: bool


class VideoSearchParam (TypedDict):
q: str
targets: str
_sort: str
fields: str
_limit: int
jsonFilter: str


class VideoResult (TypedDict):
contentId: str
userId: int | None
title: str
tags: str
description: str | None
viewCounter: int
startTime: str


class CommentResult (TypedDict):
no: int
userId: str
body: str
postedAt: str
nicoruCount: int
vposMs: int


def main (
) -> None:
now = datetime.now ()
@@ -389,5 +350,44 @@ def normalise (
unicodedata.normalize ('NFKC', text.strip ())).lower ()


class SearchNicoResult (TypedDict):
videos: list['VideoResult']
is_complete: bool


class UpdateContext (TypedDict):
api_data: list['VideoResult']
comments_by_video_code: dict[str, list['CommentResult']]
deletable: bool


class VideoSearchParam (TypedDict):
q: str
targets: str
_sort: str
fields: str
_limit: int
jsonFilter: str


class VideoResult (TypedDict):
contentId: str
userId: int | None
title: str
tags: str
description: str | None
viewCounter: int
startTime: str


class CommentResult (TypedDict):
no: int
userId: str
body: str
postedAt: str
nicoruCount: int
vposMs: int


if __name__ == '__main__':
main ()

Loading…
Cancel
Save