getVideo method
Retrieves detailed information about a video given its video ID.
Implementation
Future<VideoFull> getVideo(String videoId) async {
if (!RegExp(r"^[a-zA-Z0-9-_]{11}$").hasMatch(videoId)) {
throw Exception("Invalid videoId");
}
final data = await constructRequest("player", body: {"videoId": videoId});
final video = VideoParser.parse(data);
if (video.videoId != videoId) {
throw Exception("Invalid videoId");
}
return video;
}