mirror of
https://github.com/BluemediaGER/muse.git
synced 2024-11-23 09:15:29 +01:00
Don't cache long videos
This commit is contained in:
parent
11246812a6
commit
b1895627db
|
@ -211,8 +211,10 @@ export default class {
|
||||||
|
|
||||||
youtubeStream.pipe(capacitor);
|
youtubeStream.pipe(capacitor);
|
||||||
|
|
||||||
// Don't cache livestreams
|
// Don't cache livestreams or long videos
|
||||||
if (!info.player_response.videoDetails.isLiveContent) {
|
const MAX_CACHE_LENGTH_SECONDS = 30 * 60; // 30 minutes
|
||||||
|
|
||||||
|
if (!info.player_response.videoDetails.isLiveContent && parseInt(info.length_seconds, 10) < MAX_CACHE_LENGTH_SECONDS) {
|
||||||
const cacheTempPath = this.getCachedPathTemp(url);
|
const cacheTempPath = this.getCachedPathTemp(url);
|
||||||
const cacheStream = createWriteStream(cacheTempPath);
|
const cacheStream = createWriteStream(cacheTempPath);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue