diff options
-rw-r--r-- | client/src/app/menu/menu.component.ts | 2 | ||||
-rw-r--r-- | server/helpers/youtube-dl.ts | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/client/src/app/menu/menu.component.ts b/client/src/app/menu/menu.component.ts index 9b3608b15..95926f5f0 100644 --- a/client/src/app/menu/menu.component.ts +++ b/client/src/app/menu/menu.component.ts | |||
@@ -32,7 +32,7 @@ export class MenuComponent implements OnInit { | |||
32 | private serverService: ServerService, | 32 | private serverService: ServerService, |
33 | private redirectService: RedirectService, | 33 | private redirectService: RedirectService, |
34 | private themeService: ThemeService, | 34 | private themeService: ThemeService, |
35 | private hotkeysService: HotkeysService | 35 | private hotkeysService: HotkeysService |
36 | ) {} | 36 | ) {} |
37 | 37 | ||
38 | ngOnInit () { | 38 | ngOnInit () { |
diff --git a/server/helpers/youtube-dl.ts b/server/helpers/youtube-dl.ts index 25e719cc3..748c67e6c 100644 --- a/server/helpers/youtube-dl.ts +++ b/server/helpers/youtube-dl.ts | |||
@@ -18,6 +18,10 @@ export type YoutubeDLInfo = { | |||
18 | thumbnailUrl?: string | 18 | thumbnailUrl?: string |
19 | } | 19 | } |
20 | 20 | ||
21 | const processOptions = { | ||
22 | maxBuffer: 1024 * 1024 * 10 // 10MB | ||
23 | } | ||
24 | |||
21 | function getYoutubeDLInfo (url: string, opts?: string[]): Promise<YoutubeDLInfo> { | 25 | function getYoutubeDLInfo (url: string, opts?: string[]): Promise<YoutubeDLInfo> { |
22 | return new Promise<YoutubeDLInfo>(async (res, rej) => { | 26 | return new Promise<YoutubeDLInfo>(async (res, rej) => { |
23 | const options = opts || [ '-j', '--flat-playlist' ] | 27 | const options = opts || [ '-j', '--flat-playlist' ] |
@@ -44,7 +48,7 @@ function downloadYoutubeDLVideo (url: string) { | |||
44 | 48 | ||
45 | return new Promise<string>(async (res, rej) => { | 49 | return new Promise<string>(async (res, rej) => { |
46 | const youtubeDL = await safeGetYoutubeDL() | 50 | const youtubeDL = await safeGetYoutubeDL() |
47 | youtubeDL.exec(url, options, err => { | 51 | youtubeDL.exec(url, options, processOptions, err => { |
48 | if (err) return rej(err) | 52 | if (err) return rej(err) |
49 | 53 | ||
50 | return res(path) | 54 | return res(path) |