I want to download videos using audioOnly
from youtube using URL, I am using youtube_explode_dart
for this purpose, but the code method has migrated now, I cant figure out despite checking documentation of package, that how to download audio only.
my code:
Future<String> getDownloadUrl(String videoId) async {
var youtube = YoutubeExplode();
var video = await youtube.videos.get(videoId);
return youtube.streamsClient.getAudioOnly().first.url;
}
2
Answers
As in the official documentation, it’s mentioned that audioOnly properties just we can use for this purpose only. > highest bitrate audio-only stream. You can check out the official document once again for more info.
https://pub.dev/packages/youtube_explode_dart
You are doing it right but with old methods, update your code to the following mentioned, also check latest
youtube_explode_dart
package’s documentation to understand better.