Skip to content

feat: add b站用户动态up视频投稿#2088

Merged
DIYgod merged 4 commits intoDIYgod:masterfrom
LogicJake:following_video
May 12, 2019
Merged

feat: add b站用户动态up视频投稿#2088
DIYgod merged 4 commits intoDIYgod:masterfrom
LogicJake:following_video

Conversation

@LogicJake
Copy link
Copy Markdown
Contributor

closes #2087

@LogicJake LogicJake closed this May 9, 2019
@LogicJake LogicJake reopened this May 9, 2019
@LogicJake LogicJake changed the title feat: add b站用户关注的所有up主的最新投稿 feat: add b站用户动态up视频投稿 May 9, 2019

- `bilibili`:

- `BILIBILI_COOKIE_{uid}`: id 为{uid}的 b 站用户登录后的 Cookie 值
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这句话不太懂,对应 uid 的 b 站用户登录后的 Cookie 值

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要补充下 Cookie 获取方式:控制台执行 document.cookie


<Route name="视频搜索" author="Symty" example="/bilibili/vsearch/藤原千花" path="/bilibili/vsearch/:kw/:order?" :paramsDesc="['检索关键字', '排序方式, 综合:totalrank 最多点击:click 最新发布:pubdate(缺省) 最多弹幕:dm 最多收藏:stow']"/>

::: warning 注意
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning 应该写在 <Route></Route> 之间

用户动态需要 b 站登录后的 Cookie 值,所以只能自建,详情见部署页面的配置模块。

:::
<Route name="用户动态首页投稿视频" author="LogicJake" example="/bilibili/followings/dynamic/2267573" path="/bilibili/dynamic_video/:uid" :paramsDesc="['用户 id']"/>
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用户动态首页投稿视频 这个名词很迷,用户关注视频动态 应该很好

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不应该是 /followings/dynamic 应该是 /followings/video

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

path 不对

lib/config.js Outdated
const uid = name.slice(16);
module.exports.bilibili.cookies[uid] = envs[name];
}
}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这段应该在开头执行,不要直接修改 module.export

lib/router.js Outdated
router.get('/bilibili/topic/:topic', require('./routes/bilibili/topic'));
router.get('/bilibili/audio/:id', require('./routes/bilibili/audio'));
router.get('/bilibili/vsearch/:kw/:order?', require('./routes/bilibili/vsearch'));
router.get('/bilibili/dynamic/video/:uid', require('./routes/bilibili/dynamic_video'));
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

路由跟文档不对应

);

ctx.state.data = {
title: `${name} 动态首页投稿视频`,
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上,title 也要改下

const uid = String(ctx.params.uid);
const name = await cache.getUsernameFromUID(ctx, uid);

const cookie = config.bilibili.cookies[uid];
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要在 cookie 为空时报错并提示

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请检阅


<Route name="视频搜索" author="Symty" example="/bilibili/vsearch/藤原千花" path="/bilibili/vsearch/:kw/:order?" :paramsDesc="['检索关键字', '排序方式, 综合:totalrank 最多点击:click 最新发布:pubdate(缺省) 最多弹幕:dm 最多收藏:stow']"/>

<Route name="用户关注视频动态" author="LogicJake" example="/bilibili/dynamic/video/2267573" path="/bilibili/dynamic/video/:uid" :paramsDesc="['用户 id']">
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

路由建议改成 /followings/video/:uid

dynamic 动态指的是包括投稿内容的整个B站动态

以后加用户关注动态路由就可以是 /followings/dynamic/:uid

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请检阅

Copy link
Copy Markdown
Contributor

@Maecenas Maecenas May 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不知道「动态」这个概念在这里是不是用 timeline 更好理解呢?(t.bilibili.com)

@DIYgod DIYgod merged commit 3d10d72 into DIYgod:master May 12, 2019
@DIYgod
Copy link
Copy Markdown
Owner

DIYgod commented May 12, 2019

Merged, thanks!

@LogicJake LogicJake deleted the following_video branch May 13, 2019 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

b站用户关注的所有up主的最新投稿

3 participants