]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix video import of some youtube videos
authorChocobozzz <me@florianbigard.com>
Wed, 26 Sep 2018 13:55:45 +0000 (15:55 +0200)
committerChocobozzz <me@florianbigard.com>
Wed, 26 Sep 2018 13:55:45 +0000 (15:55 +0200)
client/src/app/menu/menu.component.ts
server/helpers/youtube-dl.ts

index 9b3608b156594311553833561ec49dfe452632a9..95926f5f0dc6fe413c07a3105e9ebddfa65410bf 100644 (file)
@@ -32,7 +32,7 @@ export class MenuComponent implements OnInit {
     private serverService: ServerService,
     private redirectService: RedirectService,
     private themeService: ThemeService,
-    private hotkeysService: HotkeysService
+    private hotkeysService: HotkeysService
   ) {}
 
   ngOnInit () {
index 25e719cc3654d65e01ceedbfef03b96f3fd7e239..748c67e6c6b65b97123c38b1c3099b8d2010ffb2 100644 (file)
@@ -18,6 +18,10 @@ export type YoutubeDLInfo = {
   thumbnailUrl?: string
 }
 
+const processOptions = {
+  maxBuffer: 1024 * 1024 * 10 // 10MB
+}
+
 function getYoutubeDLInfo (url: string, opts?: string[]): Promise<YoutubeDLInfo> {
   return new Promise<YoutubeDLInfo>(async (res, rej) => {
     const options = opts || [ '-j', '--flat-playlist' ]
@@ -44,7 +48,7 @@ function downloadYoutubeDLVideo (url: string) {
 
   return new Promise<string>(async (res, rej) => {
     const youtubeDL = await safeGetYoutubeDL()
-    youtubeDL.exec(url, options, err => {
+    youtubeDL.exec(url, options, processOptions, err => {
       if (err) return rej(err)
 
       return res(path)