Added simple MP3 support
This commit is contained in:
parent
85436c158a
commit
b3a589f1a9
|
|
@ -39,6 +39,14 @@ class Download:
|
|||
vfmt, afmt = '', ''
|
||||
if format == 'mp4':
|
||||
vfmt, afmt = '[ext=mp4]', '[ext=m4a]'
|
||||
elif format == 'mp3':
|
||||
afmt = '/best'
|
||||
ytdl_opts["writethumbnail"] = True
|
||||
ytdl_opts["postprocessors"] = [
|
||||
{"key": "FFmpegExtractAudio", "preferredcodec": "mp3"},
|
||||
{"key": "EmbedThumbnail"},
|
||||
]
|
||||
|
||||
if quality == 'best':
|
||||
self.format = f'bestvideo{vfmt}+bestaudio{afmt}/best{vfmt}'
|
||||
elif quality in ('1440p', '1080p', '720p', '480p'):
|
||||
|
|
|
|||
|
|
@ -24,7 +24,8 @@ export class AppComponent implements AfterViewInit {
|
|||
quality: string;
|
||||
formats: Array<Object> = [
|
||||
{id: "any", text: "Any"},
|
||||
{id: "mp4", text: "MP4"}
|
||||
{id: "mp4", text: "MP4"},
|
||||
{id: "mp3", text: "MP3"}
|
||||
];
|
||||
format: string;
|
||||
addInProgress = false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue