mirror of
https://github.com/GenderDysphoria/GenderDysphoria.fyi.git
synced 2025-01-31 07:16:17 +00:00
Ensure that video/gif embeds in tweets are also cached locally
This commit is contained in:
parent
68cd84ccad
commit
5992501a01
@ -129,6 +129,22 @@ module.exports = exports = function (tweets) {
|
|||||||
media.media_url_https = '/' + mediaItem.output;
|
media.media_url_https = '/' + mediaItem.output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (media.video_info && media.video_info.variants) {
|
||||||
|
media.video_info.variants = media.video_info.variants.map((variant) => {
|
||||||
|
if (!variant.url) return variant;
|
||||||
|
|
||||||
|
const mediaItem = {
|
||||||
|
input: variant.url,
|
||||||
|
output: `tweets/${tweet.id_str}/${path.basename(variant.url)}`,
|
||||||
|
cache: `twitter-entities/${tweet.id_str}/${path.basename(variant.url)}`,
|
||||||
|
};
|
||||||
|
tweet.media.push(mediaItem);
|
||||||
|
variant.url = '/' + mediaItem.output;
|
||||||
|
|
||||||
|
return variant;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return media;
|
return media;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -272,7 +272,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.tweet-footer {
|
.tweet-footer {
|
||||||
display: block;
|
display: flex;
|
||||||
|
flex: 1 1 auto;
|
||||||
|
align-items: flex-end;
|
||||||
color: $textLight;
|
color: $textLight;
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
</video>
|
</video>
|
||||||
{{/is}}
|
{{/is}}
|
||||||
{{#is type 'animated_gif'}}
|
{{#is type 'animated_gif'}}
|
||||||
<video controls muted loop poster="{{media_url_https}}" class="tweet-video">
|
<video controls autoplay muted loop poster="{{media_url_https}}" class="tweet-video">
|
||||||
{{#each video_info.variants}}
|
{{#each video_info.variants}}
|
||||||
<source src="{{url}}" type="{{content_type}}">
|
<source src="{{url}}" type="{{content_type}}">
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user