yt 2.0.5 icon indicating copy to clipboard operation
yt: ^2.0.5 copied to clipboard

Native Dart interface to multiple YouTube REST APIs including the Data API, Live Streaming API and Cloud Vision API.

example/example.dart

import 'package:yt/yt.dart';

void main() async {
  final yt = await Yt.withOAuth();

  final searchListResponse = await yt.search
      .list(q: 'reddit', part: 'snippet', type: 'video'); //the Flutter channel

  print('\nSearch:');
  for (SearchResult searchResult in searchListResponse.items) {
    print('''title: ${searchResult.snippet?.title}, 
thumbnail: ${searchResult.snippet?.thumbnails.thumbnailsDefault.url}
channel title: ${searchResult.snippet?.channelTitle}''');
  }

  print('Playlist: [a playlist id]');
  final playlistResponse = await yt.playlists.list(id: '[a playlist id]');

  for (Playlist playlist in playlistResponse.items) {
    print('''title: ${playlist.snippet?.title},
thumbnail: ${playlist.snippet?.thumbnails.thumbnailsDefault.url}''');
  }

  final channelsResponse = await yt.channels.list(
      id: '[a channel id]',
      part: 'snippet,contentDetails'); //the Flutter channel

  print('\nChannel: [a channel id]');
  for (ChannelItem channelItem in channelsResponse.items) {
    print('''title: ${channelItem.snippet?.title},
thumbnail: ${channelItem.snippet?.thumbnails?.thumbnailsDefault.url}
relatedPlaylists: ${channelItem.contentDetails?.relatedPlaylists.uploads}''');
  }

  final liveBroadcastResponse = await yt.broadcast.list(
      mine: true, part: 'snippet,contentDetails,status'); //the Flutter channel

  print('\nBroadcasts:');
  for (LiveBroadcastItem broadcastItem in liveBroadcastResponse.items) {
    print('''title: ${broadcastItem.snippet?.title},
thumbnail: ${broadcastItem.snippet?.thumbnails?.thumbnailsDefault.url}
status: ${broadcastItem.status?.lifeCycleStatus}''');
  }
}
17
likes
130
pub points
67%
popularity

Publisher

verified publisher iconmuayid.com

Native Dart interface to multiple YouTube REST APIs including the Data API, Live Streaming API and Cloud Vision API.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Icon for licenses.MIT (LICENSE)

Dependencies

args, csv, dio, fling_pickle, http_parser, json_annotation, process_run, retrofit, stemmer, universal_io, yaml

More

Packages that depend on yt