youtube_explode/example/example.dart

16 lines
390 B
Dart
Raw Normal View History

2020-02-20 22:45:36 +01:00
import 'package:youtube_explode_dart/youtube_explode_dart.dart';
2020-02-20 19:50:10 +01:00
Future<void> main() async {
// Parse the video id from the url.
var id = YoutubeExplode.parseVideoId(
'https://www.youtube.com/watch?v=bo_efYhYU2A');
var yt = YoutubeExplode();
var video = await yt.getVideo(id);
print('Title: ${video.title}');
// Close the YoutubeExplode's http client.
yt.close();
}