mirror of
https://github.com/GenderDysphoria/GenderDysphoria.fyi.git
synced 2025-01-31 07:16:17 +00:00
Fix some issues with tweet video caching
This commit is contained in:
parent
9a7586a2c3
commit
219680d783
@ -131,12 +131,13 @@ module.exports = exports = function (tweets) {
|
|||||||
|
|
||||||
if (media.video_info && media.video_info.variants) {
|
if (media.video_info && media.video_info.variants) {
|
||||||
media.video_info.variants = media.video_info.variants.map((variant) => {
|
media.video_info.variants = media.video_info.variants.map((variant) => {
|
||||||
if (!variant.url) return variant;
|
if (!variant.url || !variant.bitrate) return variant;
|
||||||
|
|
||||||
|
const fname = path.basename(variant.url).split('?')[0];
|
||||||
const mediaItem = {
|
const mediaItem = {
|
||||||
input: variant.url,
|
input: variant.url,
|
||||||
output: `tweets/${tweet.id_str}/${path.basename(variant.url)}`,
|
output: `tweets/${tweet.id_str}/${fname}`,
|
||||||
cache: `twitter-entities/${tweet.id_str}/${path.basename(variant.url)}`,
|
cache: `twitter-entities/${tweet.id_str}/${fname}`,
|
||||||
};
|
};
|
||||||
tweet.media.push(mediaItem);
|
tweet.media.push(mediaItem);
|
||||||
variant.url = '/' + mediaItem.output;
|
variant.url = '/' + mediaItem.output;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user