mirror of
https://github.com/GenderDysphoria/GenderDysphoria.fyi.git
synced 2025-01-30 23:06:18 +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;
|
||||
}
|
||||
|
||||
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;
|
||||
});
|
||||
|
||||
|
@ -272,7 +272,9 @@
|
||||
}
|
||||
|
||||
.tweet-footer {
|
||||
display: block;
|
||||
display: flex;
|
||||
flex: 1 1 auto;
|
||||
align-items: flex-end;
|
||||
color: $textLight;
|
||||
font-size: 1em;
|
||||
margin-top: 10px;
|
||||
|
@ -52,7 +52,7 @@
|
||||
</video>
|
||||
{{/is}}
|
||||
{{#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}}
|
||||
<source src="{{url}}" type="{{content_type}}">
|
||||
{{/each}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user