- 热榜内容
- {{each data channel}}
- {{if channel.data.length !== 0}}
- {{channel.name}}
-
- {{each channel.data item}}
- -
- {{item.title}}
- {{if item.new}}🆕{{/if}}
-
- {{/each}}
-
- {{/if}}
- {{/each}}
- 搜索关键词
- {{each queries q}}
- {{q.key}}
-
- {{each q.links l}}
- {{@l}}  
- {{/each}}
-
- {{/each}}
-
\ No newline at end of file
diff --git a/lib/routes/twitter/utils.ts b/lib/routes/twitter/utils.ts
index b954ae3ab..01aeaac9b 100644
--- a/lib/routes/twitter/utils.ts
+++ b/lib/routes/twitter/utils.ts
@@ -94,19 +94,20 @@ const ProcessFeed = (ctx, { data = [] }, params = {}) => {
const formatVideo = (media, extraAttrs = '') => {
let content = '';
- const video = media.video_info.variants.reduce((video, item) => {
- if ((item.bitrate || 0) > (video.bitrate || -Infinity)) {
- video = item;
- }
- return video;
- }, {});
+ let bestVideo = null;
- if (video.url) {
+ for (const item of media.video_info.variants) {
+ if (!bestVideo || (item.bitrate || 0) > (bestVideo.bitrate || -Infinity)) {
+ bestVideo = item;
+ }
+ }
+
+ if (bestVideo && bestVideo.url) {
const gifAutoPlayAttr = media.type === 'animated_gif' ? `autoplay loop muted webkit-playsinline playsinline` : '';
if (!readable) {
content += '