Add support for watchlater redirect

This commit is contained in:
the1812 2019-04-20 12:42:53 +08:00
parent 8c5832c418
commit d14a5e3fb9
4 changed files with 11 additions and 6 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -548,8 +548,13 @@ class WatchlaterList extends VideoList
{
return json.data.list.slice(0, 6).map(item =>
{
const pages = item.pages.map(it => it.cid);
const page = item.cid === 0 ? 1 : pages.indexOf(item.cid) + 1;
const href = settings.watchLaterRedirect ?
`https://www.bilibili.com/video/av${item.aid}?p=${page}` :
`https://www.bilibili.com/watchlater/#/av${item.aid}/p${page}`;
return /*html*/`<li>
<a target="_blank" href="https://www.bilibili.com/video/av${item.aid}">${item.title}</a>
<a target="_blank" href="${href}">${item.title}</a>
</li>`;
});
},