ManyVids expects octet-stream for JPEG.
This commit is contained in:
@@ -12,6 +12,21 @@ function splitTag(tag) {
|
||||
.trim();
|
||||
}
|
||||
|
||||
function getPoster(url) {
|
||||
if (!url) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return {
|
||||
src: url,
|
||||
expectType: {
|
||||
// older ffmpeg-generated screenshots are served as octet-stream, but they're regular JPEGs
|
||||
'application/octet-stream': 'image/jpeg',
|
||||
'binary/octet-stream': 'image/jpeg',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
async function getTrailer(videoId) {
|
||||
if (!videoId) {
|
||||
return null;
|
||||
@@ -81,10 +96,10 @@ async function scrapeScene(data, context) {
|
||||
...data.tagList?.map((tag) => splitTag(tag.label)) || [],
|
||||
].filter(Boolean);
|
||||
|
||||
release.poster = data.thumbnail?.url || data.screenshot || data.thumbnail; // thumbnail URL is full size, thumbnail direct is thumb sized
|
||||
release.poster = getPoster(data.thumbnail?.url || data.screenshot || data.thumbnail); // thumbnail URL is full size, thumbnail direct is thumb sized
|
||||
|
||||
if (data.preview?.url) {
|
||||
release.trailer = data.preview?.url;
|
||||
release.trailer = data.preview.url;
|
||||
} else if (context.includeTrailers) {
|
||||
release.trailer = await getTrailer(data.id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user