Skip to content

Releases: Nemo2011/bilibili-api

v17.1.2

19 Feb 12:49
Compare
Choose a tag to compare
  • 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

11 Feb 06:00
Compare
Choose a tag to compare

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

02 Feb 15:00
Compare
Choose a tag to compare

v17.1.0 2025/02/02

  • chore(deps): 移除 curl_cffi安装模块时需要自行对第三方请求库进行安装
  • chore(deps): 移除 rsa,相关代码用 pycryptodomex 替代。
  • chore: BiliAPIClient 抽象类新增函数 download_create download_chunk download_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_logrequest_settings 替代。

v17.0.0

28 Jan 15:47
Compare
Choose a tag to compare

v17.0.0 2025/01/28

Notice

此次更新伴随着针对底层网络请求功能的大规模重构,可以算是本次更新中最重要的一点。

现在开始,模块底层的网络请求功能全部通过用户实现的 BiliAPIClient(一个抽象类) 具体实现,BiliAPIClient 应当以类的实例为载体对第三方请求库的会话对象进行封装,使第三方请求库可以处理模块指定传入的数据。这种模式下,用户理论上可以利用 BiliAPIClient 使模块运用上所有的第三方请求库,前提是需要自己具体实现对应的 BiliAPIClient 的实现。模块目前默认提供 curl_cffiBiliAPIClient 实现,将 curl_cffi 作为第三方请求库,同时支持切换为 aiohttphttpx

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_v2 module. 使用样例见 自定义请求库

  • feat: 用户个人首页动态渲染数据风控 w_webid by @shouge in #837

  • feat: 直播禁言用户添加hour参数 by @TZFC in #846

  • feat: 禁言用户新增的参数,添加默认数值,以方便旧版本适配 by @TZFC in #859

  • feat: 新增获取直播间可用表情包,与直播间发送表情包功能 by @TZFC in #864

  • 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 uid for User.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_meta get_season_id,这些数据原为 __init__ 中通过同步请求获取。

  • [BREAKING CHANGE] refactor: 重写大量 opus dynamic article note 间互相转换/关联的代码。

  • 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_Picture manga.get_raw_manga_index manga.get_manga_index 无限期被移除。所有函数目前均已失效。**这是源于 bilibili 漫画接口在 2024 年末、2025 年初这段时间的变动,出现了新字段,接口返回数据也出现了加密。相关讨论:#875 #bac1168 #bac1130

  • [BREAKING CHANGE] chore: 移除 login login_func 模块。

查漏补缺

  • [BREAKING CHANGE] chore: 移除 settings.py,相关功能由 request_logrequest_settings 替代。

New Contributors

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 async Picture.load_url()
    • move async Picture.upload_file() to async Picture.upload()
    • add async Picture.upload_by_note()
    • move Picture.download_sync() to Picture.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 type httpx.AsyncClient -> object
    • rewrite set_session() argument type httpx.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()
  • article.py
    • change article.Article.turn_to_opus() async
    • add async article.Article.turn_to_dynamic()
    • remove article.ArticleType
  • 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() add from_seg to_seg arguments
  • black_room.py
    • change async black_room.BlackRoom.get_id() sync
    • change async black_room.BlackRoom.set_id() sync
  • channel_series.py
    • change channel_series.ChannelSeries.get_meta() async
  • 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
  • dynamic.py
    • modify dynamic.BuildDynamic.add_at() add uname argument, make uid argument int | user.User -> int
    • modify dynamic.BuildDynamic.add_vote() rename vote -> vote_id argument, make vote_id argument vote.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() remove emoji_id argument, add emoji argument
  • emoji.py
    • add async emoji.get_all_emoji()
    • add async emoji.get_emoji_detail()
    • modify async emoji.get_emoji_list() add credential argument
  • interactive_video.py
    • modify interactive_video.InteractiveVideoDownloader.__init__ remove self_download_func argument's default value
    • modify interactive_video.InteractiveVideoDownloaderEvents remove attributes DOWNLOAD_START DOWNLOAD_PART DOWNLOAD_SUCCESS
  • live.py
    • modify async live.LiveRoom.ban_user() add argument hour
    • add async live.LiveRoom.get_emoticons()
    • add async live.LiveRoom.send_emoticons()
  • live_area.py
    • add async live_area.fetch_live_area_data()
  • login.py
    • remove all
  • login_func.py
    • remove all
  • login_v2.py
    • add login_v2
  • 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()
  • note.py
    • add async note.upload_image()
  • 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()
  • search.py
    • modify async search.search_by_type() add time_start time_end arguments, remove debug_param_func argument
  • user.py
    • add async user.User.get_access_id()
    • modify async user.User.get_relation() remove `u...
Read more

16.3.0

21 Sep 14:18
a312432
Compare
Choose a tag to compare

What's Changed

  • build: update lxml requirement from ~=5.1.0 to ~=5.3.0
  • build: update pillow requirement from ~=10.2.0 to ~=10.3.0
  • build: update aiohttp requirement from ~=3.9.3 to ~=3.10.5
  • build: update tqdm requirement from ~=4.66.2 to ~=4.66.5
  • build: remove requests requirement
  • build: update yaml requirement from ~= 1.9.4 to ~= 1.11.1



  • docs: update examples/comment.md by @kawaiior in 45ed6c2
  • docs: 新增 docgen 自动生成 modules/ 下文档


  • debug: start/stop live with verify by @whille in #740

New Contributors

16.2.1b0

05 Apr 06:28
c411129
Compare
Choose a tag to compare
16.2.1b0 Pre-release
Pre-release

修复 get_videos()获得-352返回值 但有待完善,详细讨论见 SocialSisterYi/bilibili-API-collect#868

What's Changed

New Contributors

Full Changelog: 16.2.1...16.2.1b0

16.2.1

18 Mar 14:11
48e6350
Compare
Choose a tag to compare

未经详细测试 修复登录函数返回值错误 未修复 -352 风控

What's Changed

  • feat: 自定义 Credential Cookies by @z0z0r4 in #693
  • fix: Only show the name under license field (since classifier include… by @TimG233 in #689
  • fix: has_more by @z0z0r4 in #694
  • fix: login.login_with_key 返回的值没有 data 字段引起的 bug by @liaokongVFX in #700
  • fix: Avoid shadowing lan parameter in subtitle posting by @valkjsaaa in #710
  • fix: typo in video_uploader.py by @valkjsaaa in #706
  • fix: Pass source in meta to dict for upload by @valkjsaaa in #709
  • fix: timeout and other issues in video_uploader by @valkjsaaa in #712

New Contributors

Full Changelog: 16.2.0...16.2.1

16.2.0

06 Feb 11:50
d3b7ab5
Compare
Choose a tag to compare

预祝各位新年快乐,万事如意! 都洋溢着乐观向上的氛围

如遇 bvid -> aid 转换失败请更新


  • build: upd pillow requirement from ~=10.0.1 to ~=10.1.0
  • build: upd aiohttp requirement from ~=3.8.6 to ~=3.9.1
  • build: upd httpx requirement from ~=0.24.1 to ~=0.26.0
  • build: upd yarl requirement from ~=1.9.2 to ~=1.9.4
  • build: upd lxml requirement from ~=4.9.3 to ~=5.1.0
  • build: upd pycryptodomex requirement from ~=3.19.0 to ~=3.20.0
  • build: upd pillow requirement from ~=10.1.0 to ~=10.2.0
  • build: upd beautifulsoup4 requirement from ~=4.12.2 to ~=4.12.3
  • build: remove setup.py, use pyproject.toml instead by @iconFehu in #604



  • refactor: remove httpx.get, use Api instead by @iconFehu in #615, bug fixed by @z0z0r4 and @Nemo2011 in other commits.
  • [BREAKING CHANGE] refactor: remove topic.get_cards, rename topic.get_raw_cards -> topic.get_cards by @Nemo2011 in [404673c` (#668)](404673c)

New Contributors

Full Changelog: 16.1.1...16.2.0

16.2.0b2

01 Feb 09:55
d2e53b1
Compare
Choose a tag to compare

DEV 测试版本

如遇 bvid -> aid 转换失败请更新

What's Changed

New Contributors

Full Changelog: 16.2.0b1...16.2.0b2

16.2.0b1

13 Dec 14:28
Compare
Choose a tag to compare

DEV 测试版本

What's Changed

New Contributors

Full Changelog: 16.1.1...16.2.0b1