Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix video import of some youtube videos

Chocobozzzcc68049424c2
diff --git a/client/src/app/menu/menu.component.ts b/client/src/app/menu/menu.component.ts
index 9b3608b156..95926f5f0d 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 {
private serverService: ServerService,
private redirectService: RedirectService,
private themeService: ThemeService,
- private hotkeysService: HotkeysService
+ private hotkeysService: HotkeysService
) {}
ngOnInit () {
diff --git a/server/helpers/youtube-dl.ts b/server/helpers/youtube-dl.ts
index 25e719cc36..748c67e6c6 100644
--- a/server/helpers/youtube-dl.ts
+++ b/server/helpers/youtube-dl.ts
@@ -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)