🎈 pref: 修剪冗余逻辑

This commit is contained in:
zhiyu 2024-07-02 13:59:03 +08:00
parent fdd496cbba
commit eb3c05df07

View File

@ -287,17 +287,10 @@ export class tools extends plugin {
if (urlType === "video") {
// logger.info(item.video);
// 多位面选择play_addr、play_addr_265、play_addr_h264
let resUrl;
// 判断是否使用压缩格式
const { play_addr } = item.video;
const { play_addr: { uri: videoAddrURI } } = item.video;
const resolution = this.douyinCompression === 1 ? "720p" : "1080p";
// 使用今日头条 CDN 进一步加快解析速度
const videoAddrURI = play_addr.uri;
if (this.douyinCompression === 1) {
resUrl = DY_TOUTIAO_INFO.replace("1080p", "720p").replace("{}", videoAddrURI);
} else {
// 原始格式ps. videoAddrList这里[0]、[1]是 http[最后一个]是 https
resUrl = DY_TOUTIAO_INFO.replace("{}", videoAddrURI);
}
const resUrl = DY_TOUTIAO_INFO.replace("1080p", resolution).replace("{}", videoAddrURI);
// ⚠️ 暂时废弃代码
/*if (this.douyinCompression === 1) {