aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-09-26 15:55:45 +0200
committerChocobozzz <me@florianbigard.com>2018-09-26 15:55:45 +0200
commitcc68049424c2a7fc7fb919bc39a43f169e128780 (patch)
treefc7d874907e7c8ab84c6f0e6dca5c88da75d556f
parent542e73a26bac2bfea94b5db013bdebe0cb4d3917 (diff)
downloadPeerTube-cc68049424c2a7fc7fb919bc39a43f169e128780.tar.gz
PeerTube-cc68049424c2a7fc7fb919bc39a43f169e128780.tar.zst
PeerTube-cc68049424c2a7fc7fb919bc39a43f169e128780.zip
Fix video import of some youtube videos
-rw-r--r--client/src/app/menu/menu.component.ts2
-rw-r--r--server/helpers/youtube-dl.ts6
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
21const processOptions = {
22 maxBuffer: 1024 * 1024 * 10 // 10MB
23}
24
21function getYoutubeDLInfo (url: string, opts?: string[]): Promise<YoutubeDLInfo> { 25function 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)