Prepare for beta release
This commit is contained in:
parent
ac5d7b4d5c
commit
1fda8f7d6a
11
README.md
11
README.md
|
@ -18,21 +18,16 @@ This doesn't require an API key and has no usage quotas.
|
|||
- All model extend `Equatable` to easily perform equality checks
|
||||
- Download Stream
|
||||
|
||||
## Features not implemented
|
||||
|
||||
- Adaptive streams
|
||||
|
||||
## Differences from YoutubeExplode
|
||||
|
||||
- The entry point is `YoutubeExplode`, not `YoutubeClient`.
|
||||
- The `MediaStreamInfoSet` class has a `videoDetails` class which contains info about the video metadata (to avoid making several api calls).
|
||||
- The `ClosedCaption` has a `end` getter to get when a closed captions ends being displayed.
|
||||
|
||||
## Install
|
||||
|
||||
Add the dependency to the pubspec.yaml (Check for the latest version)
|
||||
```yaml
|
||||
youtube_explode_dart: ^0.0.9
|
||||
youtube_explode_dart: ^1.0.0-beta
|
||||
```
|
||||
|
||||
Import the library
|
||||
|
@ -44,8 +39,6 @@ import 'package:youtube_explode_dart/youtube_explode_dart.dart';
|
|||
|
||||
To start using the API you need to initialize the `YoutubeExplode` class (which will create a new http client), and get (for example) the video id of the video you'd want to retrieve information, which usually is the `v` parameter.
|
||||
```dart
|
||||
var id = YoutubeExplode.parseVideoId('https://www.youtube.com/watch?v=OpQFFLBMEPI'); // Returns `OpQFFLBMEPI`
|
||||
|
||||
var yt = YoutubeExplode();
|
||||
```
|
||||
|
||||
|
@ -53,7 +46,7 @@ var yt = YoutubeExplode();
|
|||
The [Video][Video] class contains info about the video such as the video title, the duration or the search keywords.
|
||||
|
||||
```dart
|
||||
var video = yt.getVideo(id); // Returns a Video instance.
|
||||
var video = yt.video.get(id); // Returns a Video instance.
|
||||
```
|
||||
|
||||
## Get video mediaStream
|
||||
|
|
|
@ -32,7 +32,7 @@ Future<void> download(String id) async {
|
|||
|
||||
// Get the video manifest.
|
||||
var manifest = await yt.videos.streamsClient.getManifest(id);
|
||||
var streams = manifest.getAudioOnly();
|
||||
var streams = manifest.audioOnly;
|
||||
|
||||
// Get the last audio track (the one with the highest bitrate).
|
||||
var audio = streams.last;
|
||||
|
|
|
@ -16,22 +16,22 @@ class StreamManifest {
|
|||
|
||||
/// Gets streams that contain audio
|
||||
/// (which includes muxed and audio-only streams).
|
||||
Iterable<AudioStreamInfo> getAudio() => streams.whereType<AudioStreamInfo>();
|
||||
Iterable<AudioStreamInfo> get audio => streams.whereType<AudioStreamInfo>();
|
||||
|
||||
/// Gets streams that contain video
|
||||
/// (which includes muxed and video-only streams).
|
||||
Iterable<VideoStreamInfo> getVideo() => streams.whereType<VideoStreamInfo>();
|
||||
Iterable<VideoStreamInfo> get video => streams.whereType<VideoStreamInfo>();
|
||||
|
||||
/// Gets muxed streams (contain both audio and video).
|
||||
/// Note that muxed streams are limited in quality and don't go beyond 720p30.
|
||||
Iterable<MuxedStreamInfo> getMuxed() => streams.whereType<MuxedStreamInfo>();
|
||||
Iterable<MuxedStreamInfo> get muxed => streams.whereType<MuxedStreamInfo>();
|
||||
|
||||
/// Gets audio-only streams (no video).
|
||||
Iterable<AudioOnlyStreamInfo> getAudioOnly() =>
|
||||
Iterable<AudioOnlyStreamInfo> get audioOnly =>
|
||||
streams.whereType<AudioOnlyStreamInfo>();
|
||||
|
||||
/// Gets video-only streams (no audio).
|
||||
/// These streams have the widest range of qualities available.
|
||||
Iterable<VideoOnlyStreamInfo> getVideoOnly() =>
|
||||
Iterable<VideoOnlyStreamInfo> get videoOnly =>
|
||||
streams.whereType<VideoOnlyStreamInfo>();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
name: youtube_explode_dart
|
||||
description: A port in dart of the youtube explode library. Supports several API functions.
|
||||
version: 0.0.17
|
||||
description: A port in dart of the youtube explode library. Supports several API functions without the need of Youtube API Key.
|
||||
version: 1.0.0-beta
|
||||
homepage: https://github.com/Hexer10/youtube_explode_dart
|
||||
|
||||
environment:
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
import 'package:youtube_explode_dart/src/channels/channels.dart';
|
||||
|
||||
void main() {
|
||||
var u = Username('youtube.com/user/ProZD');
|
||||
}
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue