mirror of
https://github.com/imputnet/cobalt.git
synced 2025-07-18 03:08:30 +00:00
wip(niconico): service added
This commit is contained in:
parent
b1ed1f5199
commit
c1219654fd
@ -24,6 +24,7 @@ import streamable from "./services/streamable.js";
|
||||
import twitch from "./services/twitch.js";
|
||||
import rutube from "./services/rutube.js";
|
||||
import dailymotion from "./services/dailymotion.js";
|
||||
import nicovideo from "./services/nicovideo.js";
|
||||
|
||||
let freebind;
|
||||
|
||||
@ -185,6 +186,9 @@ export default async function(host, patternMatch, lang, obj) {
|
||||
case "dailymotion":
|
||||
r = await dailymotion(patternMatch);
|
||||
break;
|
||||
case "nicovideo":
|
||||
r = await nicovideo({ id: patternMatch.id });
|
||||
break;
|
||||
default:
|
||||
return createResponse("error", {
|
||||
t: loc(lang, 'ErrorUnsupported')
|
||||
|
4
src/modules/processing/services/nicovideo.js
Normal file
4
src/modules/processing/services/nicovideo.js
Normal file
@ -0,0 +1,4 @@
|
||||
// TODO @synzr implement nicovideo
|
||||
export default function nicovideo() {
|
||||
return { error: "ErrorEmptyDownload" };
|
||||
}
|
@ -110,6 +110,12 @@
|
||||
"alias": "dailymotion videos",
|
||||
"patterns": ["video/:id"],
|
||||
"enabled": true
|
||||
},
|
||||
"nicovideo": {
|
||||
"alias": "niconico videos",
|
||||
"tld": "jp",
|
||||
"patterns": ["watch/:id"],
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -54,4 +54,8 @@ export const testers = {
|
||||
|
||||
"youtube": (patternMatch) =>
|
||||
patternMatch.id?.length <= 11,
|
||||
|
||||
"nicovideo": (patternMatch) =>
|
||||
// checking if this page is video and if identifier is number
|
||||
patternMatch.id.startsWith("sm") && !isNaN(parseInt(patternMatch.id.substring(2), 10))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user