Releases: Nemo2011/bilibili-api
v17.4.0
What's Changed
- chore(deps): 删除模块所有依赖项的版本限制 from [#962]
- feat(live): 直播间
INTERACT_WORDONLINE_RANK_V3返回 protobuf 数据解析 - feat(Picture): 新增
to_json函数,提供图片链接/长宽/大小 - feat(emoji/dynamic/comment/Credential) by @sakmist in [#958]
- 新增添加表情包功能
- 优化 @ 提及功能
- 新增发送评论附带图片功能
- 可在 Credential 内携带代理
- feat(video): 添加视频观看数据上报 相关接口 from [#974] in [#975] by @shenghuang147
- feat(video):
Video.get_download_url新增 html5 参数,获取的媒体流无需鉴权即可访问 - fix(live):
RECALL_DANMU_MSG事件的处理有疏漏 from [#965] in [#966] by @Alkaid-C - fix(session):
session.get_at函数的last_uid参数改为last_id,last_uid参数暂时保留,会在将来版本中删除。 - fix(video): update get_all_followings api in [#977] by @GKarbon
- fix(user): 获取用户 access_id 时带上 Credential in [#978] by @junyilou
- fix(video / bangumi): Remove default voice_balance parameter to prevent it from being enabled by default in [#972] by @skbeh
- docs: 登陆 -> 登录 by @LondonClass in [#967]
New Contributors
- @sakmist made their first contribution in #958
- @shenghuang147 made their first contribution in #975
- @GKarbon made their first contribution in #977
- @ByteTuxiaobei made their first contribution in #968
- @junyilou made their first contribution in #978
Full Changelog: 17.3.0...17.4.0
v17.3.0
v17.3.0 2025/06/30
- feat: (取消)置顶动态
- feat: 创作中心稿件相关
- feat: 装扮/收藏集模块
- fix: request_settings.set 设置非通用属性可能报错
- fix: rank 相关接口风控
- fix: 修复 CurlCFFIClient 高 CPU 占用 by @Shironobako in #946
- fix: 更新投诉稿件 API by @CoderTCY in #947
- fix: LiveDanmaku 中获取用户信息时添加报错日志/重试功能 by @Alkaid-C in #943
- fix: LiveRoom start/stop 需鉴权 by @whille in #949
- docs: User.get_dynamics(_new) typing
New Contributors
- @Shironobako made their first contribution in #946
- @CoderTCY made their first contribution in #947
Full Changelog: 17.2.1...17.3.0
v17.2.1
v17.2.0
-
chore(deps): pycryptodomex from ~=3.21.0 to ~=3.23.0
-
chore(deps): qrcode from ~=8.0 to ~=8.2
-
chore(deps): lxml from ~=5.3.1 to ~=5.4.0
-
chore(deps): pillow from ~= 11.1.0 to ~=11.2.1
-
chore(deps): beautifulsoup4 from ~=4.13.3 to ~=4.13.4
-
chore(deps): yarl from ~=1.18.3 to ~=1.20.0
-
fix: live_area.get_list_by_area credential & wbi in #901 #907
-
fix: Credential.from_cookies in #906
-
fix: live.LiveDanmaku ws_close KeyError in #908
-
fix: homepage.get_videos 新接口 in #904
-
fix: PEP 621 影响 uv add 安裝软件包 in #919 #920 by @JaydenChao101
-
fix: live.LiveDanmaku 不明确的信息 in #913 following #913 (comment) by @rebasecontinue
-
fix: NetworkException 消失 in #929
-
fix: RankType 参数 in #928
-
fix: json 中的 http 链接 & allow_redirects 默认为 False in #932
-
fix(CurlCFFIClient): return BiliWsMsgType.CLOSED when CURLE_GOT_NOTHING
-
fix: ass 于 windows 上触发 gbk in #916
-
fix: 直播相关问题 #934
-
feat: Article.get_detail
-
feat: video.VideoQuality.AI_REPAIR
New Contributors
- @JaydenChao101 made their first contribution in #920
- @Alkaid-C made their first contribution in #930
Full Changelog: 17.1.4...17.2.0
v17.1.4
v17.1.3
- [BREAKING CHANGE]: curl_cffi 不再默认模仿
chrome131,如需模仿浏览器需要手动设置(request_settings.set("impersonate", "xxx") - fix: 代码弹幕 mode8 in DmMode
- feat: Credential 支持 buvid4
- fix: w_webid related in #892
- feat: bili_simple_download
- feat: recalculate_wbi, refresh_bili_ticket, refresh_buvid
- fix: session.send_msg (originally posted in #828)
v17.1.2
- fix: pyinstaller hooks
- fix: 移除 interactive_video 中对私有变量的使用
- fix: user.User.get_dynamics_new 出现 wbi #890
- feat: 新增 blackroom.get_jury_case_raw (
-> dict), dynamic.get_dynamic_page_info (-> dict) - [BREAKING CHANGE] chore: 原 dynamic.get_dynamic_page_info (
-> List[Dynamic]) 移至 dynamic.get_dynamic_page_list
17.1.1
What's Changed
- fix: app.get_loading_images_special
- fix: audio_uploader.upload_cover
- fix: login_v2.LoginCheck 特殊情况
- chore: update VideoAppealReasonType
- [BREAKING CHANGE] fix: ass.make_ass_file_danmakus_protobuf 移除 credential 参数
- [BREAKING CHANGE] refactor: remove class EpisodeTryMP4DownloadURL, HTML5MP4DownloadURL, add class MP4StreamDownloadURL 与相关返回值变动
- [BREAKING CHANGE] refactor: remove video.VideoDownloadURLDataDetecter.check_flv_stream, video.VideoDownloadURLDataDetecter.check_html5_mp4_stream, video.VideoDownloadURLDataDetecter.check_episode_try_mp4_stream, add check_flv_mp4_stream
- feat: user.User.get_opus
- feat: parse_link 支持 opus
- feat: 支持配置第三方请求库使用 HTTP2,支持设置 curl_cffi 伪装的目标浏览器。设置方法见相关文档。
- chore(deps): update beautifulsoup4 requirement from ~=4.12.3 to ~=4.13.0 by @dependabot in #885
- chore(deps): update beautifulsoup4 requirement from ~=4.13.0 to ~=4.13.3 by @dependabot in #888
- chore(deps): update lxml requirement from ~=5.3.0 to ~=5.3.1 by @dependabot in #889
Full Changelog: 17.1.0...17.1.1
v17.1.0
v17.1.0 2025/02/02
- chore(deps): 移除
curl_cffi,安装模块时需要自行对第三方请求库进行安装。 - chore(deps): 移除
rsa,相关代码用pycryptodomex替代。 - chore: BiliAPIClient 抽象类新增函数
download_createdownload_chunkdownload_content_length。 - feat: AsyncEvent 支持同步函数。
- feat: interactive_video.InteractiveVideoDownloader.__init__ 参数 self_download_func 再次变为非必要参数。
- fix: video.VideoDownloadURLDataDetecter 不支持修改后的 bangumi.Episode.get_download_url 返回数据。
v17.0.0 查漏补缺
- [BREAKING CHANGE] chore: 移除
settings.py,相关功能由request_log和request_settings替代。
v17.0.0
v17.0.0 2025/01/28
Notice
此次更新伴随着针对底层网络请求功能的大规模重构,可以算是本次更新中最重要的一点。
现在开始,模块底层的网络请求功能全部通过用户实现的 BiliAPIClient(一个抽象类) 具体实现,BiliAPIClient 应当以类的实例为载体对第三方请求库的会话对象进行封装,使第三方请求库可以处理模块指定传入的数据。这种模式下,用户理论上可以利用 BiliAPIClient 使模块运用上所有的第三方请求库,前提是需要自己具体实现对应的 BiliAPIClient 的实现。模块目前默认提供 curl_cffi 的 BiliAPIClient 实现,将 curl_cffi 作为第三方请求库,同时支持切换为 aiohttp 和 httpx。
select_client("aiohttp") # 切换为 aiohttp
select_client("httpx") # 切换为 httpx更多信息见 自定义请求库。
下文为本次更新其他更新内容,存在部分破坏修改。最后是所有在 16.3.0 -> 17.0.0 中修改的 API 的列表。
What's Other Changed
-
chore(deps): remove
httpx -
chore(deps): update
aiohttp ~= 3.10.5 -> ~= 3.11.11 -
chore(deps): update
pycryptodomex ~= 3.20.0 -> ~= 3.21.0 -
chore(deps): update
yarl ~= 1.11.1 -> ~= 1.17.2 -
chore(deps): update
qrcode ~= 7.4.2 -> ~= 8.0 -
chore(deps): update
pyjwt ~= 2.9.0 -> ~= 2.10.0 -
chore(deps): update
pillow ~= 10.4.0 -> ~= 11.0.0 -
chore(deps): update
apscheduler ~= 3.10.4 -> ~= 3.11.0 -
feat:
login_v2module. 使用样例见 自定义请求库。 -
feat:
search.search_by_type增加功能:可以按照时间段查询 & 新增to_timestamps函数 by @xianrenzhou in #866 -
feat:
Dynamic.set_favorite -
feat:
emoji.get_emoji_detail&emoji.get_all_emoji -
[BREAKING CHANGE] feat:
live_area.fetch_live_area_data之后调用live_area查询分区函数必须先调用此方法 -
feat:
dynamic.get_lottery_info -
feat: 支持在事件循环已经运行时同步执行异步代码 by @LondonClass in #743
-
feat:
dynamic.Dynamic.markdown -
feat:
manga.get_followed_manga -
fix:
VideoDownloadURLDataDetecter -
[BREAKING CHANGE] fix: remove argument
uidforUser.get_relation之后调用get_relation默认判断User.get_uid()与自己的信息而不是传入函数的参数 -
fix: 字母接口风控 #841 & 游客下无法访问用户视频投稿
-
[BREAKING CHANGE] fix:
user.name2uid此方法目前必须携带凭据类 经过测试,更改后的 api 只能登录后访问。若要不登录访问一定程度上可以使用搜索功能替代 -
fix:
comment.get_comments_lazy传参问题 #871 -
fix:
manga.get_info -
fix: 当
buvid3已有时仍尝试获取buvid3 -
fix:
Video.get_danmaku_view -
[BREAKING CHANGE] fix: 因为
video.get_cid_info(属于 biliplus https://hd.biliplus.com 的 api)部分新视频数据没有记录,暂时缺少方法处理笔记正文内容视频卡片的cid数据,所以目前note.Note.fetch_content不再支持解析视频卡片。 -
[BREAKING CHANGE] fix: 考虑到多方面因素,
interactive_video.InteractiveVideoDownloader参数self_download_func不再默认提供。 -
fix: 查看用户合集中的视频(新版)API变更 by @TangMisaka23001 in #880
-
fix:
opus.get_info -
[BREAKING CHANGE] fix: 因更新频率过高且不易维护,
emote.json被移除。dynamic.BuildDynamic.add_emoji被修改。 -
[BREAKING CHANGE] refactor: 重构
bangumi/cheese/channel_series/video_tag等,移除所有同步代码,**部分原同步函数改为异步函数。**大多此类函数原来是同步的获取属性的函数,例如get_metaget_season_id,这些数据原为__init__中通过同步请求获取。 -
[BREAKING CHANGE] refactor: 重写大量
opusdynamicarticlenote间互相转换/关联的代码。 -
refactor:
dynamic.BuildDynamic内部移除同步请求模式,相关完善正文内容请求将移至dynamic.send_dynamic进行,即dynamic.send_dynamic请求数可能会增多,但dynamic.BuildDynamic不会再有请求。 -
[BREAKING CHANGE] chore: remove support for Python 3.8.
-
chore: 更新
data/**.json -
[BREAKING CHANGE] chore: **
Manga类大多函数 和manga.manga_image_url_turn_to_Picturemanga.get_raw_manga_indexmanga.get_manga_index无限期被移除。所有函数目前均已失效。**这是源于 bilibili 漫画接口在 2024 年末、2025 年初这段时间的变动,出现了新字段,接口返回数据也出现了加密。相关讨论:#875 #bac1168 #bac1130 -
[BREAKING CHANGE] chore: 移除
loginlogin_func模块。
查漏补缺
- [BREAKING CHANGE] chore: 移除
settings.py,相关功能由request_log和request_settings替代。
New Contributors
- @shouge made their first contribution in #837
- @xianrenzhou made their first contribution in #866
- @TangMisaka23001 made their first contribution in #880
All Changed API
__init__.py- add
Api - add
BiliAPIClient - add
BiliAPIFile - add
BiliAPIResponse - add
BiliWsMsgType - add
Geetest - add
GeetestMeta - add
GeetestServerNotFoundException - add
GeetestUndoneException - move async
Picture.async_load_url()to asyncPicture.load_url() - move async
Picture.upload_file()to asyncPicture.upload() - add async
Picture.upload_by_note() - move
Picture.download_sync()toPicture.to_file() - remove async
Picture.download() - add
WbiRetryTimesExceedException - remove
get_aiohttp_session() - remove
set_aiohttp_session() - remove
get_httpx_sync_session() - remove
set_httpx_sync_session() - remove
get_buvid3() - rewrite
get_session()response typehttpx.AsyncClient->object - rewrite
set_session()argument typehttpx.AsyncClient->object - add
get_client() - add
get_selected_client() - add
register_client() - add
unregister_client() - add
select_client() - add
request_log - add
request_settings - add
get_registered_clients()
- add
article.py- change
article.Article.turn_to_opus()async - add async
article.Article.turn_to_dynamic() - remove
article.ArticleType
- change
bangumi.py- change
bangumi.Bangumi.get_media_id()async - change
bangumi.Bangumi.get_raw()async - change
bangumi.Bangumi.get_season_id()async - change
bangumi.Bangumi.get_up_info()async - change
bangumi.Bangumi.set_media_id()async - change
bangumi.Bangumi.set_ssid()async - change
bangumi.Episode.get_aid()async - change
bangumi.Episode.get_bangumi()async - change
bangumi.Episode.get_bvid()async - modify
bangumi.Episode.get_cid()addfrom_segto_segarguments
- change
black_room.py- change async
black_room.BlackRoom.get_id()sync - change async
black_room.BlackRoom.set_id()sync
- change async
channel_series.py- change
channel_series.ChannelSeries.get_meta()async
- change
cheese.py- change
cheese.CheeseList.get_season_id()async - change
cheese.CheeseList.set_ep_id()async - change
cheese.set_season_id()async - change
cheese.Cheese.get_cheese()async - change
cheese.Cheese.get_cid()async - change
cheese.Cheese.get_meta()async - change
cheese.Cheese.set_epid()async
- change
dynamic.py- modify
dynamic.BuildDynamic.add_at()addunameargument, makeuidargumentint | user.User->int - modify
dynamic.BuildDynamic.add_vote()renamevote->vote_idargument, makevote_idargumentvote.Vote->int - change
dynamic.BuildDynamic.get_contents()async - add async
dynamic.Dynamic.get_lottery_info() - change
dynamic.Dynamic.is_opus()async - add async
dynamic.Dynamic.is_article() - add async
dynamic.Dynamic.set_favorite() - add async
dynamic.Dynamic.turn_to_article() - remove
dynamic.upload_image_sync() - add async
dynamic.Dynamic.markdown() - add async
dynamic.Dynamic.get_rid() - modify
dynamic.BuildDynamic.add_emoji()removeemoji_idargument, addemojiargument
- modify
emoji.py- add async
emoji.get_all_emoji() - add async
emoji.get_emoji_detail() - modify async
emoji.get_emoji_list()addcredentialargument
- add async
interactive_video.py- modify
interactive_video.InteractiveVideoDownloader.__init__removeself_download_funcargument's default value - modify
interactive_video.InteractiveVideoDownloaderEventsremove attributesDOWNLOAD_STARTDOWNLOAD_PARTDOWNLOAD_SUCCESS
- modify
live.py- modify async
live.LiveRoom.ban_user()add argumenthour - add async
live.LiveRoom.get_emoticons() - add async
live.LiveRoom.send_emoticons()
- modify async
live_area.py- add async
live_area.fetch_live_area_data()
- add async
login.py- remove all
login_func.py- remove all
login_v2.py- add
login_v2
- add
manga.py- remove async
manga.Manga.get_images() - remove async
manga.manga_image_url_turn_to_Picture() - add async
manga.get_followed_manga() - add
manga.MangaOrderType - remove async
manga.get_manga_index() - remove async
manga.get_raw_manga_index()
- remove async
note.py- add async
note.upload_image()
- add async
opus.py- change
opus.Opus.is_note()async - change
opus.Opus.turn_to_article()async - remove
opus.Opus.turn_to_note() - remove
opus.Opus.is_note() - remove
opus.Opus.get_type() - add async
opus.Opus.is_article() - remove
opus.OpusType - change
opus.Opus.markdown()async - add async
opus.Opus.set_like() - add async
opus.Opus.set_favorite() - add async
opus.Opus.add_coins() - add async
opus.Opus.get_reaction() - add async
opus.Opus.get_rid()
- change
search.py- modify async
search.search_by_type()addtime_starttime_endarguments, removedebug_param_funcargument
- modify async
user.py- add async
user.User.get_access_id() - modify async
user.User.get_relation()remove `u...
- add async