bilibili-get icon indicating copy to clipboard operation
bilibili-get copied to clipboard

Please support the new BV tags

Open yicong2007 opened this issue 4 years ago • 2 comments

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.

yicong2007 avatar Mar 25 '20 19:03 yicong2007

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 });

catright avatar Mar 30 '20 19:03 catright

+1 for the feature.

UlyssesZh avatar Nov 06 '22 19:11 UlyssesZh