getDownloadDetail method
Implementation
Future<YoutubeVideoDownloadDetail> getDownloadDetail({
required Directory directory,
required String youtubeUrl,
required String? output,
required bool isAudioOnly,
}) async {
final manifest =
await youtubeExplode.videos.streamsClient.getManifest(youtubeUrl);
final audioTotalBytes =
manifest.audioOnly.withHighestBitrate().size.totalBytes;
if (isAudioOnly) {
return YoutubeVideoDownloadDetail(
totalSize: audioTotalBytes,
streamManifest: manifest,
);
} else {
return YoutubeVideoDownloadDetail(
totalSize: manifest.videoOnly.withHighestBitrate().size.totalBytes +
audioTotalBytes,
streamManifest: manifest,
);
}
}