diff --git a/routes/danmaku.js b/routes/danmaku.js index d7bfeae..860e292 100644 --- a/routes/danmaku.js +++ b/routes/danmaku.js @@ -92,6 +92,7 @@ async function resolve(req, res) { async function index(req, res) { const urls = list.map(item => item.example_urls[0]); const names = list.map(item => item.name); + const domains = list.map(item => item.domain); const path = req.protocol + "://" + req.headers.host + req.originalUrl; const resolve_info = await db.accessCountQuery() const hotlist = await db.hotlistQuery() @@ -99,6 +100,7 @@ async function index(req, res) { path, urls, names, + domains, resolve_info, hotlist }); diff --git a/views/danmaku.ejs b/views/danmaku.ejs index 64eb0eb..d4b8a2e 100644 --- a/views/danmaku.ejs +++ b/views/danmaku.ejs @@ -22,7 +22,7 @@ 使用方法:在当前页面添加一个查询字符串url
目前支持 <% names.forEach(function(name, idx) { %> - <%= name %><% if(idx !== names.length - 1) { %>,<% } %> + <%= name %><% if (idx !== names.length - 1) { %>,<% } %> <% }); %>。
注意:目前只支持单个视频的解析,不支持专辑的解析。