mirror of
https://github.com/imputnet/cobalt.git
synced 2025-07-18 11:18:28 +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 twitch from "./services/twitch.js";
|
||||||
import rutube from "./services/rutube.js";
|
import rutube from "./services/rutube.js";
|
||||||
import dailymotion from "./services/dailymotion.js";
|
import dailymotion from "./services/dailymotion.js";
|
||||||
|
import nicovideo from "./services/nicovideo.js";
|
||||||
|
|
||||||
let freebind;
|
let freebind;
|
||||||
|
|
||||||
@ -185,6 +186,9 @@ export default async function(host, patternMatch, lang, obj) {
|
|||||||
case "dailymotion":
|
case "dailymotion":
|
||||||
r = await dailymotion(patternMatch);
|
r = await dailymotion(patternMatch);
|
||||||
break;
|
break;
|
||||||
|
case "nicovideo":
|
||||||
|
r = await nicovideo({ id: patternMatch.id });
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return createResponse("error", {
|
return createResponse("error", {
|
||||||
t: loc(lang, 'ErrorUnsupported')
|
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",
|
"alias": "dailymotion videos",
|
||||||
"patterns": ["video/:id"],
|
"patterns": ["video/:id"],
|
||||||
"enabled": true
|
"enabled": true
|
||||||
|
},
|
||||||
|
"nicovideo": {
|
||||||
|
"alias": "niconico videos",
|
||||||
|
"tld": "jp",
|
||||||
|
"patterns": ["watch/:id"],
|
||||||
|
"enabled": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,4 +54,8 @@ export const testers = {
|
|||||||
|
|
||||||
"youtube": (patternMatch) =>
|
"youtube": (patternMatch) =>
|
||||||
patternMatch.id?.length <= 11,
|
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