yt 2.0.6+9 copy "yt: ^2.0.6+9" to clipboard
yt: ^2.0.6+9 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(
      oAuthClientId:
          OAuthCredentials.fromYaml('credentials.yaml').oAuthClientId);

  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}''');
  }

  yt.close();
}
31
likes
0
pub points
67%
popularity

Publisher

verified publishermuayid.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

License

unknown (license)

Dependencies

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

More

Packages that depend on yt