Skip to content

Instantly share code, notes, and snippets.

View spnda's full-sized avatar
👌

sean spnda

👌
  • Frankfurt, Germany
  • 18:37 (UTC +02:00)
View GitHub Profile
@spnda
spnda / yt_downloader.dart
Last active April 25, 2021 21:53
Dart script to quickly download a youtube video using youtube-dl with the best audio and then convert it to opus using ffmpeg.
import 'dart:io';
void main(List<String> arguments) async {
if (arguments.isEmpty) {
print('Please supply a youtube link.'); return;
}
final link = arguments.first;
/// Call youtube-dl asking for the best audio format. This is usually a WEBM container with OPUS audio.
final youtubeDlResult = await Process.run('youtube-dl', ['-f', 'bestaudio', link]);
var fileName = '';