From 28d1e10d91ce7169d7b847365bbbe2435409295e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 10:11:11 +0000 Subject: [PATCH 01/20] chore(deps): update apscheduler requirement from ~=3.10.4 to ~=3.11.0 Updates the requirements on [apscheduler](https://github.com/agronholm/apscheduler) to permit the latest version. - [Release notes](https://github.com/agronholm/apscheduler/releases) - [Changelog](https://github.com/agronholm/apscheduler/blob/3.11.0/docs/versionhistory.rst) - [Commits](https://github.com/agronholm/apscheduler/compare/3.10.4...3.11.0) --- updated-dependencies: - dependency-name: apscheduler dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 73da8336..000b0082 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,7 @@ pyyaml~=6.0 brotli~=1.1.0 httpx~=0.27.2 qrcode~=8.0 -APScheduler~=3.10.4 +APScheduler~=3.11.0 rsa~=4.9 pillow~=11.0.0 tqdm~=4.67.0 From b1d2a9736593a1ed94d3367fc9e30732ae84d57d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 10:11:33 +0000 Subject: [PATCH 02/20] chore(deps): update tqdm requirement from ~=4.67.0 to ~=4.67.1 Updates the requirements on [tqdm](https://github.com/tqdm/tqdm) to permit the latest version. - [Release notes](https://github.com/tqdm/tqdm/releases) - [Commits](https://github.com/tqdm/tqdm/compare/v4.67.0...v4.67.1) --- updated-dependencies: - dependency-name: tqdm dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 73da8336..4fb7a4a6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ qrcode~=8.0 APScheduler~=3.10.4 rsa~=4.9 pillow~=11.0.0 -tqdm~=4.67.0 +tqdm~=4.67.1 yarl~=1.17.2 pycryptodomex~=3.21.0 qrcode_terminal~=0.8 From 146ef5773384cd2e8bdca372ce20bff6ef868630 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A9=E5=AD=90=E6=96=B9=E8=BE=B0?= Date: Sat, 30 Nov 2024 02:43:30 -0500 Subject: [PATCH 03/20] add default value for new param --- bilibili_api/live.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bilibili_api/live.py b/bilibili_api/live.py index 7d893085..7123d4aa 100644 --- a/bilibili_api/live.py +++ b/bilibili_api/live.py @@ -470,7 +470,7 @@ async def get_room_play_info_v2( await Api(**api, credential=self.credential).update_params(**params).result ) - async def ban_user(self, uid: int, hour: int) -> dict: + async def ban_user(self, uid: int, hour: int = -1) -> dict: """ 封禁用户 From 213291d3d319ac1703218ae1b795988eb0c3d132 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A9=E5=AD=90=E6=96=B9=E8=BE=B0?= Date: Sun, 1 Dec 2024 23:44:58 -0500 Subject: [PATCH 04/20] add visit_id to unban --- bilibili_api/live.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bilibili_api/live.py b/bilibili_api/live.py index 7123d4aa..fc6cd74e 100644 --- a/bilibili_api/live.py +++ b/bilibili_api/live.py @@ -508,6 +508,7 @@ async def unban_user(self, uid: int) -> dict: data = { "room_id": self.room_display_id, "tuid": uid, + "visit_id": "", } return await Api(**api, credential=self.credential).update_data(**data).result From 03126fa33b65270b3d339220f2e7730974c17ea4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 10:27:58 +0000 Subject: [PATCH 05/20] chore(deps): update httpx requirement from ~=0.27.2 to ~=0.28.0 Updates the requirements on [httpx](https://github.com/encode/httpx) to permit the latest version. - [Release notes](https://github.com/encode/httpx/releases) - [Changelog](https://github.com/encode/httpx/blob/master/CHANGELOG.md) - [Commits](https://github.com/encode/httpx/compare/0.27.2...0.28.0) --- updated-dependencies: - dependency-name: httpx dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 73da8336..a55cef0a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ colorama~=0.4.6 lxml~=5.3.0 pyyaml~=6.0 brotli~=1.1.0 -httpx~=0.27.2 +httpx~=0.28.0 qrcode~=8.0 APScheduler~=3.10.4 rsa~=4.9 From 8cd2646fac253f389db56e55d7af6612edfd923e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 10:28:19 +0000 Subject: [PATCH 06/20] chore(deps): update aiohttp requirement from ~=3.11.2 to ~=3.11.9 Updates the requirements on [aiohttp](https://github.com/aio-libs/aiohttp) to permit the latest version. - [Release notes](https://github.com/aio-libs/aiohttp/releases) - [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst) - [Commits](https://github.com/aio-libs/aiohttp/compare/v3.11.2...v3.11.9) --- updated-dependencies: - dependency-name: aiohttp dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 73da8336..a94678dd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -aiohttp~=3.11.2 +aiohttp~=3.11.9 beautifulsoup4~=4.12.3 colorama~=0.4.6 lxml~=5.3.0 From d659e95f9d02ffe0e9f25e3aff3b6d91012384cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A9=E5=AD=90=E6=96=B9=E8=BE=B0?= Date: Thu, 5 Dec 2024 21:19:44 -0500 Subject: [PATCH 07/20] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=A1=A8=E6=83=85?= =?UTF-8?q?=E5=8C=85api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bilibili_api/data/api/live.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/bilibili_api/data/api/live.json b/bilibili_api/data/api/live.json index 042b0a66..c66e405e 100644 --- a/bilibili_api/data/api/live.json +++ b/bilibili_api/data/api/live.json @@ -301,6 +301,24 @@ "csrf,csrf_token": "str: 要给两个" }, "comment": "发送直播间弹幕,有的参数不确定因为自己不搞这块没权限发一些样式的弹幕" + }, + "send_emoticon": { + "url": "https://api.live.bilibili.com/msg/send", + "method": "POST", + "verify": true, + "params": { + "roomid": "int: 真实房间号", + "color": "int: 十进制颜色,有权限限制", + "fontsize": "int: 字体大小,默认 25", + "mode": "int: 弹幕模式,1 飞行 5 顶部 4 底部", + "msg": "str: 表情包代号", + "rnd": "int: 当前时间戳", + "bubble": "int: 默认 0,功能不知", + "dm_type": "int: 默认 1,功能不知", + "emoticonOptions": " 默认 [object object] 功能不知", + "csrf,csrf_token": "str: 要给两个" + }, + "comment": "发送直播间弹幕,有的参数不确定因为自己不搞这块没权限发一些样式的弹幕" }, "send_popular_ticket": { "url": "https://api.live.bilibili.com/xlive/general-interface/v1/rank/popularRankFreeScoreIncr", From 58de9c19956ffb953982591a500aa39f446d1876 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A9=E5=AD=90=E6=96=B9=E8=BE=B0?= Date: Thu, 5 Dec 2024 21:26:08 -0500 Subject: [PATCH 08/20] typo --- bilibili_api/data/api/live.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bilibili_api/data/api/live.json b/bilibili_api/data/api/live.json index c66e405e..39532a54 100644 --- a/bilibili_api/data/api/live.json +++ b/bilibili_api/data/api/live.json @@ -315,7 +315,7 @@ "rnd": "int: 当前时间戳", "bubble": "int: 默认 0,功能不知", "dm_type": "int: 默认 1,功能不知", - "emoticonOptions": " 默认 [object object] 功能不知", + "emoticonOptions": " 默认 [object Object] 功能不知", "csrf,csrf_token": "str: 要给两个" }, "comment": "发送直播间弹幕,有的参数不确定因为自己不搞这块没权限发一些样式的弹幕" From dc8cff31bc59ccde856015eb33839eca8fd6550c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A9=E5=AD=90=E6=96=B9=E8=BE=B0?= Date: Thu, 5 Dec 2024 21:29:19 -0500 Subject: [PATCH 09/20] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8F=91=E9=80=81?= =?UTF-8?q?=E8=A1=A8=E6=83=85=E5=8C=85=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bilibili_api/live.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/bilibili_api/live.py b/bilibili_api/live.py index 7d893085..dc3cbb9a 100644 --- a/bilibili_api/live.py +++ b/bilibili_api/live.py @@ -541,6 +541,35 @@ async def send_danmaku(self, danmaku: Danmaku, room_id: int = None, reply_mid: i if reply_mid: data["reply_mid"] = reply_mid return await Api(**api, credential=self.credential).update_data(**data).result + async def send_emoticon(self, emoticon: Danmaku, room_id: int = None) -> dict: + """ + 直播间发送表情包 + + Args: + emoticon (Danmaku): text为表情包代号 + + Returns: + dict: 调用 API 返回的结果 + """ + self.credential.raise_for_no_sessdata() + + api = API["operate"]["send_emoticon"] + if not room_id: + room_id = (await self.get_room_play_info())["room_id"] + + data = { + "mode": danmaku.mode, + "msg": danmaku.text, + "roomid": room_id, + "bubble": 0, + "dm_type": 1, + "rnd": int(time.time()), + "color": int(danmaku.color, 16), + "fontsize": danmaku.font_size, + "emoticonOptions": '[object Object]' + } + return await Api(**api, credential=self.credential).update_data(**data).result + async def sign_up_dahanghai(self, task_id: int = 1447) -> dict: """ 大航海签到 From 28e7efa4dfb1196983f2a7132a460fd8bd75a8bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A9=E5=AD=90=E6=96=B9=E8=BE=B0?= Date: Thu, 5 Dec 2024 21:32:31 -0500 Subject: [PATCH 10/20] typo --- bilibili_api/live.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bilibili_api/live.py b/bilibili_api/live.py index dc3cbb9a..6dc76022 100644 --- a/bilibili_api/live.py +++ b/bilibili_api/live.py @@ -558,14 +558,14 @@ async def send_emoticon(self, emoticon: Danmaku, room_id: int = None) -> dict: room_id = (await self.get_room_play_info())["room_id"] data = { - "mode": danmaku.mode, - "msg": danmaku.text, + "mode": emoticon.mode, + "msg": emoticon.text, "roomid": room_id, "bubble": 0, "dm_type": 1, "rnd": int(time.time()), - "color": int(danmaku.color, 16), - "fontsize": danmaku.font_size, + "color": int(emoticon.color, 16), + "fontsize": emoticon.font_size, "emoticonOptions": '[object Object]' } return await Api(**api, credential=self.credential).update_data(**data).result From 45405270920281a8a2572f50394657a49830c1b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A9=E5=AD=90=E6=96=B9=E8=BE=B0?= Date: Thu, 5 Dec 2024 21:56:38 -0500 Subject: [PATCH 11/20] =?UTF-8?q?=E6=96=B0=E5=A2=9Eemoticons=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E8=A1=A8=E6=83=85=E5=8C=85=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bilibili_api/data/api/live.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bilibili_api/data/api/live.json b/bilibili_api/data/api/live.json index 39532a54..3746c3d9 100644 --- a/bilibili_api/data/api/live.json +++ b/bilibili_api/data/api/live.json @@ -32,6 +32,16 @@ }, "comment": "获取房间信息(真实房间号,封禁情况等)" }, + "emoticons": { + "url": "https://api.live.bilibili.com/xlive/web-ucenter/v2/emoticon/GetEmoticons", + "method": "GET", + "verify": true, + "params": { + "platform": "const str: pc", + "room_id": "int: 房间号", + }, + "comment": "获取当前用户在本房间可用的表情包" + }, "danmu_info": { "url": "https://api.live.bilibili.com/xlive/web-room/v1/index/getDanmuInfo", "method": "GET", From c50421e651d86aea4d8ca5ace10cdd46e7713065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A9=E5=AD=90=E6=96=B9=E8=BE=B0?= Date: Thu, 5 Dec 2024 21:58:44 -0500 Subject: [PATCH 12/20] =?UTF-8?q?=E6=96=B0=E5=A2=9Eget=5Femoticons?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=A1=A8=E6=83=85=E5=8C=85=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bilibili_api/live.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/bilibili_api/live.py b/bilibili_api/live.py index 6dc76022..3bfb40dc 100644 --- a/bilibili_api/live.py +++ b/bilibili_api/live.py @@ -182,6 +182,26 @@ async def get_room_play_info(self) -> dict: self.__ruid = resp["uid"] return resp + async def get_emoticons(self) -> dict: + """ + 获取本房间可用表情包 + + Returns: + dict: 调用 API 返回的结果 + """ + api = API["info"]["emoticons"] + params = { + "platform": "pc", + "room_id": self.room_display_id, + } + resp = ( + await Api(**api, credential=self.credential).update_params(**params).result + ) + + # 缓存真实房间 ID + self.__ruid = resp["uid"] + return resp + async def get_room_id(self) -> int: """ 获取直播间 id From cdbd26e4402579e08482bc36a75e5aaf640d64d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A9=E5=AD=90=E6=96=B9=E8=BE=B0?= Date: Thu, 5 Dec 2024 22:03:28 -0500 Subject: [PATCH 13/20] fix: pasted extra --- bilibili_api/live.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/bilibili_api/live.py b/bilibili_api/live.py index 3bfb40dc..1d2dfc5e 100644 --- a/bilibili_api/live.py +++ b/bilibili_api/live.py @@ -197,9 +197,6 @@ async def get_emoticons(self) -> dict: resp = ( await Api(**api, credential=self.credential).update_params(**params).result ) - - # 缓存真实房间 ID - self.__ruid = resp["uid"] return resp async def get_room_id(self) -> int: From f8b50f73259af651e10645ad76426947b3501f6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A9=E5=AD=90=E6=96=B9=E8=BE=B0?= Date: Thu, 5 Dec 2024 22:19:09 -0500 Subject: [PATCH 14/20] typo --- bilibili_api/data/api/live.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bilibili_api/data/api/live.json b/bilibili_api/data/api/live.json index 3746c3d9..4e296379 100644 --- a/bilibili_api/data/api/live.json +++ b/bilibili_api/data/api/live.json @@ -38,7 +38,7 @@ "verify": true, "params": { "platform": "const str: pc", - "room_id": "int: 房间号", + "room_id": "int: 房间号" }, "comment": "获取当前用户在本房间可用的表情包" }, From e2c9a8315bb5cba587d415849334ea693f80c6b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A9=E5=AD=90=E6=96=B9=E8=BE=B0?= Date: Thu, 5 Dec 2024 22:34:49 -0500 Subject: [PATCH 15/20] =?UTF-8?q?=E6=96=87=E6=A1=A3=E6=96=B0=E5=A2=9Esend?= =?UTF-8?q?=5Femoticon=20=E4=B8=8E=20get=5Femoticons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/modules/live.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/modules/live.md b/docs/modules/live.md index 1c710eb4..c06c020e 100644 --- a/docs/modules/live.md +++ b/docs/modules/live.md @@ -331,6 +331,17 @@ Events: +### async def get_emoticons() + +获取本房间可用表情包 + + + +**Returns:** dict: 调用 API 返回的结果 + + + + ### async def get_room_play_info() 获取房间信息(真实房间号,封禁情况等) @@ -434,6 +445,18 @@ Events: +### async def send_emoticon() + +直播间发送表情包 + + +| name | type | description | +| - | - | - | +| emoticon | Danmaku | 弹幕类, text为表情包代号 | + +**Returns:** dict: 调用 API 返回的结果 + + ### async def send_gift_from_bag() From 7192974b922a8a65d3ef976472c111dd49a14fb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A9=E5=AD=90=E6=96=B9=E8=BE=B0?= Date: Thu, 5 Dec 2024 22:38:33 -0500 Subject: [PATCH 16/20] =?UTF-8?q?=E6=96=B0=E5=A2=9Eget=5Femoticons?= =?UTF-8?q?=E5=92=8Csend=5Femoticon=E7=9A=84=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_live.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_live.py b/tests/test_live.py index 8bfe126f..a225fd8d 100644 --- a/tests/test_live.py +++ b/tests/test_live.py @@ -188,3 +188,10 @@ async def test_zf_get_get_popular_ticket_num(): async def test_zg_popular_rank_free_score_incr(): return await l.send_popular_ticket() + +async def test_zh_get_emoticons(): + return await l.get_emoticons() + + +async def test_zi_send_emoticon(): + return await l.send_danmaku(Danmaku("official_147")) From 88cb3b090389d501da23d1bbcceb3fffa13385e9 Mon Sep 17 00:00:00 2001 From: xianrenzhou <52302764+xianrenzhou@users.noreply.github.com> Date: Fri, 6 Dec 2024 20:51:53 +0800 Subject: [PATCH 17/20] Update search.py --- bilibili_api/search.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bilibili_api/search.py b/bilibili_api/search.py index da5a5c63..282c3436 100644 --- a/bilibili_api/search.py +++ b/bilibili_api/search.py @@ -6,7 +6,7 @@ import json from enum import Enum from typing import List, Union, Callable - +from .utils.utils import to_timestamps from .utils.utils import get_api from .video_zone import VideoZoneTypes from .utils.network import Api, get_session @@ -193,6 +193,10 @@ async def search_by_type( category_id (CategoryTypeArticle | CategoryTypePhoto | int | None, optional) : 专栏/相簿分区筛选,指定分类,只在相册和专栏类型下生效 time_range (int, optional) : 指定时间,自动转换到指定区间,只在视频类型下生效 有四种:10分钟以下,10-30分钟,30-60分钟,60分钟以上 + + time_start (str, optional) : 指定开始时间,与结束时间搭配使用,格式为:"YYYY-MM-DD" + + time_end (str, optional) : 指定结束时间,与开始时间搭配使用,格式为:"YYYY-MM-DD" video_zone_type (int | ZoneTypes | None, optional) : 话题类型,指定 tid (可使用 channel 模块查询) @@ -254,6 +258,11 @@ async def search_by_type( params["order_sort"] = order_sort if debug_param_func: debug_param_func(params) + # time setting + if time_start and time_end: + time_stamp = to_timestamps(time_start,time_end) + params["pubtime_begin_s"] = time_stamp[0] + params["pubtime_end_s"] = time_stamp[1] api = API["search"]["web_search_by_type"] return await Api(**api, wbi=True).update_params(**params).result From 37d8ca8fa4e82496a131adc6d5e8737f27dde3a5 Mon Sep 17 00:00:00 2001 From: xianrenzhou <52302764+xianrenzhou@users.noreply.github.com> Date: Fri, 6 Dec 2024 20:52:50 +0800 Subject: [PATCH 18/20] Update utils.py add string to time stamp function --- bilibili_api/utils/utils.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/bilibili_api/utils/utils.py b/bilibili_api/utils/utils.py index 2d3b35a8..6f1cf49a 100644 --- a/bilibili_api/utils/utils.py +++ b/bilibili_api/utils/utils.py @@ -9,7 +9,7 @@ import random from typing import List, TypeVar from ..exceptions import StatementException - +from datetime import datetime def get_api(field: str, *args) -> dict: """ @@ -210,3 +210,25 @@ def get_deviceid(separator: str = "-", is_lowercase: bool = False) -> str: def raise_for_statement(statement: bool, msg: str="未满足条件") -> None: if not statement: raise StatementException(msg=msg) + +def to_timestamps(time_start, time_end): + """ + 将两个日期字符串转换为整数时间戳 (int) 元组,并验证时间顺序。 + + Returns: + tuple: (int,int) + """ + try: + # 将输入字符串解析为 datetime 对象 + start_dt = datetime.strptime(time_start, "%Y-%m-%d") + end_dt = datetime.strptime(time_end, "%Y-%m-%d") + + # 验证起始时间是否早于结束时间 + if start_dt >= end_dt: + raise ValueError("起始时间必须早于结束时间。") + + # 转换为时间戳并返回 + return int(start_dt.timestamp()), int(end_dt.timestamp()) + except ValueError as e: + # 捕获日期格式错误或自定义错误消息 + raise ValueError(f"输入错误: {e}. 请确保使用 'YYYY-MM-DD' 格式,并且起始时间早于结束时间。") From 01963767dc89027107b3e54064e2631f20dbedef Mon Sep 17 00:00:00 2001 From: xianrenzhou <52302764+xianrenzhou@users.noreply.github.com> Date: Fri, 6 Dec 2024 21:09:49 +0800 Subject: [PATCH 19/20] Update search.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加新参数的描述 --- docs/modules/search.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/modules/search.md b/docs/modules/search.md index 85c76ff3..2333c417 100644 --- a/docs/modules/search.md +++ b/docs/modules/search.md @@ -213,6 +213,8 @@ Ps: Api 中 的 order_sort 字段决定顺序还是倒序 | order_sort | Union[int, None] | 用户粉丝数及等级排序顺序 默认为0 由高到低:0 由低到高:1 | | category_id | Union[CategoryTypeArticle, None] | 专栏/相簿分区筛选,指定分类,只在相册和专栏类型下生效 | | time_range | Union[int, None] | 指定时间,自动转换到指定区间,只在视频类型下生效 有四种:10分钟以下,10-30分钟,30-60分钟,60分钟以上 | +| time_start | Union[str, None] | 指定搜索开始日期,与结束日期搭配使用,格式为:"YYYY-MM-DD" | +| time_end | Union[str, None] | 指定搜索结束日期,与开始日期搭配使用,格式为:"YYYY-MM-DD" | | video_zone_type | Union[int, None] | 话题类型,指定 tid (可使用 channel 模块查询) | | order_type | Union[OrderUser, None] | 排序分类类型 | | keyword | str | 搜索关键词 | From 72a0390b242866ce99f7c2de691d0b4b2c6cc173 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 7 Dec 2024 14:51:31 +0000 Subject: [PATCH 20/20] chore(deps): update yarl requirement from ~=1.17.2 to ~=1.18.3 Updates the requirements on [yarl](https://github.com/aio-libs/yarl) to permit the latest version. - [Release notes](https://github.com/aio-libs/yarl/releases) - [Changelog](https://github.com/aio-libs/yarl/blob/master/CHANGES.rst) - [Commits](https://github.com/aio-libs/yarl/compare/v1.17.2...v1.18.3) --- updated-dependencies: - dependency-name: yarl dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index cc5d60a5..85655f88 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ APScheduler~=3.11.0 rsa~=4.9 pillow~=11.0.0 tqdm~=4.67.1 -yarl~=1.17.2 +yarl~=1.18.3 pycryptodomex~=3.21.0 qrcode_terminal~=0.8 PyJWT~=2.10.0 \ No newline at end of file