fix(route): douyin uid verification
This commit is contained in:
parent
34a2e5b9c7
commit
2085c2c7b9
|
|
@ -852,7 +852,7 @@ YouTube 官方亦有提供频道 RSS,形如 <https://www.youtube.com/feeds/vid
|
|||
|
||||
### 博主
|
||||
|
||||
<Route author="Max-Tortoise Rongronggg9" example="/douyin/user/MS4wLjABAAAARcAHmmF9mAG3JEixq_CdP72APhBlGlLVbN-1eBcPqao" path="/douyin/user/:uid/:routeParams?" :paramsDesc="['uid,可在 URL 中找到', '额外参数,query string 格式,请参阅下面的表格']" anticrawler="1" radar="1" rssbud="1" puppeteer="1">
|
||||
<Route author="Max-Tortoise Rongronggg9" example="/douyin/user/MS4wLjABAAAARcAHmmF9mAG3JEixq_CdP72APhBlGlLVbN-1eBcPqao" path="/douyin/user/:uid/:routeParams?" :paramsDesc="['uid,可在用户页面 URL 中找到', '额外参数,query string 格式,请参阅下面的表格']" anticrawler="1" radar="1" rssbud="1" puppeteer="1">
|
||||
|
||||
| 键 | 含义 | 值 | 默认值 |
|
||||
| -------- | ----------------------------------- | ---------------------- | ------- |
|
||||
|
|
|
|||
|
|
@ -49,6 +49,9 @@ const getOriginAvatar = (url) =>
|
|||
|
||||
module.exports = async (ctx) => {
|
||||
const uid = ctx.params.uid;
|
||||
if (!uid.startsWith('MS4wLjABAAAA')) {
|
||||
throw Error('Invalid UID. UID should start with <b>MS4wLjABAAAA</b>.');
|
||||
}
|
||||
const routeParams = Object.fromEntries(new URLSearchParams(ctx.params.routeParams));
|
||||
const embed = fallback(undefined, queryToBoolean(routeParams.embed), false); // embed video
|
||||
const iframe = fallback(undefined, queryToBoolean(routeParams.iframe), false); // embed video in iframe
|
||||
|
|
|
|||
Loading…
Reference in New Issue