bilibili-get
bilibili-get copied to clipboard
Please support the new BV tags
According to 【升级公告】AV号全面升级至BV号,the AV tags have been upgraded into BV tags.
The regular expression in lib/extractor.js
var REGEX_URL_VIDEO = /^https?:\/\/(?:www\.|bangumi\.|)bilibili\.(?:tv|com)\/(?:video\/av(\d+)(?:\/|\/index_(\d+)\.html)?)(?:\?p=(\d+).*)?$/i;
is outdated and the video id cannot be extracted so easily as before.
This is only a temporary solution and I'm using bilibili-get on windows node.js (v12.16.1). If your environment is similar to me, this solution may help you. I guess it'll work on the other environments too. Please change following lines in extractor.js.
- top of the file
// var REGEX_URL_VIDEO = /^https?:\/\/(?:www\.|bangumi\.|)bilibili\.(?:tv|com)\/(?:video\/av(\d+)(?:\/|\/index_(\d+)\.html)?)(?:\?p=(\d+).*)?$/i;
var REGEX_URL_VIDEO = /^https?:\/\/(?:www\.|bangumi\.|)bilibili\.(?:tv|com)\/(?:video\/BV([A-Za-z\d]+)(?:\/|\/index_(\d+)\.html)?)(?:\?p=(\d+).*)?$/i;
- var result = Object.assign({
// video_id: parseInt(REGEX_URL_VIDEO.exec(url)[1]),
video_id: REGEX_URL_VIDEO.exec(url)[1],
- var findVideoInfo = function* ({ video_id, part_id, cookie }) {
// var data = yield fetchWebPage(`https://www.bilibili.com/video/${video_id}/` + (part_id ? `index_${part_id}.html` : ''), { cookie });
var data = yield fetchWebPage(`https://www.bilibili.com/video/BV${video_id}/` + (part_id ? `?p=${part_id}` : ''), { cookie });
+1 for the feature.