Skip to content

Commit

Permalink
提示暂不支持 av
Browse files Browse the repository at this point in the history
  • Loading branch information
yzqzss committed Jul 20, 2023
1 parent a09775a commit 4fcd91f
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions userscript.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name Bilibili Archive Checker
// @version 1.1
// @description 多 p 视频只检查 p1 是否存在
// @version 1.2
// @description 检查 BiliBili 视频是否已经存档到 Internet Archive
// @author yzqzss
// @match https://www.bilibili.com/video/*
// @grant GM_xmlhttpRequest
Expand All @@ -10,6 +10,18 @@
(function () {
'use strict';

function isAvVideo() {
var url = window.location.href;
var avRegex = /\/video\/av(\d+)/;
var matches = url.match(avRegex);
if (matches && matches.length > 1) {
console.log("AV:", matches[1]);
return true;
}
console.log("No AV number found.");
return false;
}

// 从 URL 获取当前视频的 BV 号
function getBVNumber() {
var url = window.location.href;
Expand Down Expand Up @@ -163,6 +175,11 @@


function main() {
var isAv = isAvVideo();
if (isAv) {
showPopup("咱不支持识别avid", "yellow");
return;
}
var bvNumber = getBVNumber();
var pageNumber = getPageNumber();
if (bvNumber) {
Expand Down

0 comments on commit 4fcd91f

Please sign in to comment.