about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/assets/images/bilibili-icon-light.svg44
-rw-r--r--src/assets/images/bilibili-icon.svg44
-rw-r--r--src/assets/javascripts/services.js17
-rw-r--r--src/config.json21
4 files changed, 122 insertions, 4 deletions
diff --git a/src/assets/images/bilibili-icon-light.svg b/src/assets/images/bilibili-icon-light.svg
new file mode 100644
index 00000000..ad6ea120
--- /dev/null
+++ b/src/assets/images/bilibili-icon-light.svg
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   width="18"
+   height="18"
+   viewBox="0 0 18 18"
+   fill="none"
+   class="zhuzhan-icon"
+   version="1.1"
+   id="svg4"
+   sodipodi:docname="bilibili-icon-light.svg"
+   inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:svg="http://www.w3.org/2000/svg">
+  <defs
+     id="defs8" />
+  <sodipodi:namedview
+     id="namedview6"
+     pagecolor="#afafaf"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:showpageshadow="2"
+     inkscape:pageopacity="0"
+     inkscape:pagecheckerboard="0"
+     inkscape:deskcolor="#d1d1d1"
+     showgrid="false"
+     inkscape:zoom="30.562726"
+     inkscape:cx="0.26175676"
+     inkscape:cy="9.0633277"
+     inkscape:window-width="1888"
+     inkscape:window-height="1060"
+     inkscape:window-x="32"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="svg4" />
+  <path
+     fill-rule="evenodd"
+     clip-rule="evenodd"
+     d="m 4.3006643,3.3526156 c -0.3570617,-0.3444557 -0.3570617,-0.9164163 0,-1.2608631 0.3393616,-0.3273766 0.8769747,-0.3273766 1.2163363,0 l 1.8925169,1.8256688 c 0.05376,0.051878 0.099438,0.1089036 0.137015,0.1695424 h 2.8620695 c 0.03765,-0.060639 0.08333,-0.1176645 0.137032,-0.1695424 l 1.8925,-1.8256688 c 0.33937,-0.3273766 0.876974,-0.3273766 1.216345,0 0.357124,0.3444468 0.357124,0.9164074 0,1.2608631 l -0.761175,0.7343481 h 0.567402 c 1.970828,0 3.568565,1.5977 3.568565,3.5685647 v 4.9117096 c 0,1.970829 -1.597737,3.568565 -3.568565,3.568565 H 4.5392942 c -1.9708647,0 -3.56856461,-1.597736 -3.56856461,-3.568565 V 7.6555194 c 0,-1.9708647 1.59769991,-3.5685557 3.56856461,-3.5685557 h 0.5226074 z m 0.2386299,2.4556096 c -0.9854323,0 -1.7842823,0.79885 -1.7842823,1.7842823 v 5.0377165 c 0,0.985458 0.79885,1.784282 1.7842823,1.784282 h 8.9214118 c 0.985458,0 1.784282,-0.798824 1.784282,-1.784282 V 7.5925075 c 0,-0.9854323 -0.798824,-1.7842823 -1.784282,-1.7842823 z m 0.8921411,3.4740333 c 0,-0.4927116 0.3994295,-0.8921411 0.8921412,-0.8921411 0.4927118,0 0.8921412,0.3994295 0.8921412,0.8921411 v 0.7976005 c 0,0.49273 -0.3994294,0.892142 -0.8921412,0.892142 -0.4927117,0 -0.8921412,-0.399412 -0.8921412,-0.892142 z M 11.676424,8.3901174 c -0.49273,0 -0.892142,0.3994295 -0.892142,0.8921411 v 0.7976005 c 0,0.49273 0.399412,0.892142 0.892142,0.892142 0.492729,0 0.892141,-0.399412 0.892141,-0.892142 V 9.2822585 c 0,-0.4927116 -0.399412,-0.8921411 -0.892141,-0.8921411 z"
+     fill="currentColor"
+     id="path2"
+     style="stroke-width:0.892141;fill:#ffffff" />
+</svg>
diff --git a/src/assets/images/bilibili-icon.svg b/src/assets/images/bilibili-icon.svg
new file mode 100644
index 00000000..afa54b6f
--- /dev/null
+++ b/src/assets/images/bilibili-icon.svg
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   width="18"
+   height="18"
+   viewBox="0 0 18 18"
+   fill="none"
+   class="zhuzhan-icon"
+   version="1.1"
+   id="svg4"
+   sodipodi:docname="bilibili-icon.svg"
+   inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:svg="http://www.w3.org/2000/svg">
+  <defs
+     id="defs8" />
+  <sodipodi:namedview
+     id="namedview6"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:showpageshadow="2"
+     inkscape:pageopacity="0.0"
+     inkscape:pagecheckerboard="0"
+     inkscape:deskcolor="#d1d1d1"
+     showgrid="false"
+     inkscape:zoom="30.562726"
+     inkscape:cx="4.2208276"
+     inkscape:cy="9.0633275"
+     inkscape:window-width="1888"
+     inkscape:window-height="1060"
+     inkscape:window-x="32"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="svg4" />
+  <path
+     fill-rule="evenodd"
+     clip-rule="evenodd"
+     d="m 4.3006643,3.3526156 c -0.3570617,-0.3444557 -0.3570617,-0.9164163 0,-1.2608631 0.3393616,-0.3273766 0.8769747,-0.3273766 1.2163363,0 l 1.8925169,1.8256688 c 0.05376,0.051878 0.099438,0.1089036 0.137015,0.1695424 h 2.8620695 c 0.03765,-0.060639 0.08333,-0.1176645 0.137032,-0.1695424 l 1.8925,-1.8256688 c 0.33937,-0.3273766 0.876974,-0.3273766 1.216345,0 0.357124,0.3444468 0.357124,0.9164074 0,1.2608631 l -0.761175,0.7343481 h 0.567402 c 1.970828,0 3.568565,1.5977 3.568565,3.5685647 v 4.9117096 c 0,1.970829 -1.597737,3.568565 -3.568565,3.568565 H 4.5392942 c -1.9708647,0 -3.56856461,-1.597736 -3.56856461,-3.568565 V 7.6555194 c 0,-1.9708647 1.59769991,-3.5685557 3.56856461,-3.5685557 h 0.5226074 z m 0.2386299,2.4556096 c -0.9854323,0 -1.7842823,0.79885 -1.7842823,1.7842823 v 5.0377165 c 0,0.985458 0.79885,1.784282 1.7842823,1.784282 h 8.9214118 c 0.985458,0 1.784282,-0.798824 1.784282,-1.784282 V 7.5925075 c 0,-0.9854323 -0.798824,-1.7842823 -1.784282,-1.7842823 z m 0.8921411,3.4740333 c 0,-0.4927116 0.3994295,-0.8921411 0.8921412,-0.8921411 0.4927118,0 0.8921412,0.3994295 0.8921412,0.8921411 v 0.7976005 c 0,0.49273 -0.3994294,0.892142 -0.8921412,0.892142 -0.4927117,0 -0.8921412,-0.399412 -0.8921412,-0.892142 z M 11.676424,8.3901174 c -0.49273,0 -0.892142,0.3994295 -0.892142,0.8921411 v 0.7976005 c 0,0.49273 0.399412,0.892142 0.892142,0.892142 0.492729,0 0.892141,-0.399412 0.892141,-0.892142 V 9.2822585 c 0,-0.4927116 -0.399412,-0.8921411 -0.892141,-0.8921411 z"
+     fill="currentColor"
+     id="path2"
+     style="stroke-width:0.892141" />
+</svg>
diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js
index 80c927cf..e8315ff5 100644
--- a/src/assets/javascripts/services.js
+++ b/src/assets/javascripts/services.js
@@ -489,9 +489,6 @@ function redirect(url, type, initiator, forceRedirection) {
 			}
 			return `${randomInstance}`
 		}
-		default: {
-			return `${randomInstance}${url.pathname}${url.search}`
-		}
 		case "gothub": {
 			const regex = /^\/(.*)\/(.*)\/(?:blob|tree)\/(.*)\/(.*)/.exec(url.pathname)
 			if (regex) {
@@ -503,6 +500,17 @@ function redirect(url, type, initiator, forceRedirection) {
 			}
 			return `${randomInstance}${url.pathname}${url.search}`
 		}
+		case "mikuIndividious": {
+			if (url.hostname == "bilibili.com" || url.hostname == "www.bilibili.com" || url.hostname == 'b23.tv') {
+				return `${randomInstance}${url.pathname}${url.search}`
+			}
+			if (url.hostname == "space.bilibili.com") {
+				return `${randomInstance}/space${url.pathname}${url.search}`
+			}
+		}
+		default: {
+			return `${randomInstance}${url.pathname}${url.search}`
+		}
 	}
 }
 
@@ -629,7 +637,8 @@ const defaultInstances = {
 	'wikiless': ['https://wikiless.org'],
 	'suds': ['https://sd.vern.cc'],
 	'waybackClassic': ['https://wayback-classic.net'],
-	'gothub': ['https://gh.odyssey346.dev']
+	'gothub': ['https://gh.odyssey346.dev'],
+	'mikuIndividious': ['https://mikuinv.resrv.org'],
 }
 
 function initDefaults() {
diff --git a/src/config.json b/src/config.json
index 29934e3c..57e190ad 100644
--- a/src/config.json
+++ b/src/config.json
@@ -672,6 +672,27 @@
 			"imageType": "svgMono",
 			"embeddable": false,
 			"url": "https://web.archive.org"
+		},
+		"bilibili": {
+			"frontends": {
+				"mikuIndividious": {
+					"name": "MikuIndividious",
+					"instanceList": true,
+					"url": "https://0xacab.org/johnxina/mikuinvidious"
+				}
+			},
+			"targets": [
+				"^https?:\\/{2}(www\\.|space\\.)?bilibili\\.com\\/",
+				"^https?:\\/{2}b23\\.tv\\/"
+			],
+			"name": "Bilibili",
+			"options": {
+				"enabled": false,
+				"unsupportedUrls": "bypass"
+			},
+			"imageType": "svgMono",
+			"embeddable": false,
+			"url": "https://bilibili.com/"
 		}
 	}
 }
\ No newline at end of file