This commit is contained in:
Hexah 2020-06-05 21:06:54 +02:00
parent 1cd6283e82
commit 2fadb3a13c
14 changed files with 12 additions and 18 deletions

View File

@ -71,7 +71,6 @@ Future<void> download(String id) async {
// console.cursorPosition = Coordinate(row, 0);
// console.write(msg);
// Listen for data received.
await for (var data in audioStream) {
count += data.length;

View File

@ -19,7 +19,6 @@ class ChannelClient {
/// [id] must be either a [ChannelId] or a string
/// which is parsed to a [ChannelId]
Future<Channel> get(dynamic id) async {
var channelPage = await ChannelPage.get(_httpClient, id.value);
return Channel(id, channelPage.channelTitle, channelPage.channelLogoUrl);

View File

@ -3,4 +3,4 @@ library youtube_explode.channels;
export 'channel.dart';
export 'channel_client.dart';
export 'channel_id.dart';
export 'username.dart';
export 'username.dart';

View File

@ -4,7 +4,6 @@ import 'youtube_explode_exception.dart';
/// Exception thrown when a fatal failure occurs.
class RequestLimitExceededException implements YoutubeExplodeException {
/// Description message
@override
final String message;

View File

@ -1,6 +1,5 @@
import '../extensions/helpers_extension.dart';
/// Encapsulates a valid YouTube playlist ID.
class PlaylistId {
static final _regMatchExp =

View File

@ -11,8 +11,7 @@ class PlayerSource {
final RegExp _funcNameExp = RegExp(r'(\w+).\w+\(\w+,\d+\);');
final RegExp _calledFuncNameExp =
RegExp(r'\w+(?:.|\[)(\"?\w+(?:\")?)\]?\(');
final RegExp _calledFuncNameExp = RegExp(r'\w+(?:.|\[)(\"?\w+(?:\")?)\]?\(');
final String _root;

View File

@ -66,7 +66,7 @@ class WatchPage {
}
}
}
return str.substring(0, lastI+1);
return str.substring(0, lastI + 1);
}
WatchPage.parse(String raw) : _root = parser.parse(raw);

View File

@ -4,7 +4,6 @@ import 'closed_caption.dart';
/// Track that contains closed captions in a specific language.
class ClosedCaptionTrack {
/// Closed captions.
final UnmodifiableListView<ClosedCaption> captions;

View File

@ -23,4 +23,4 @@ class Framerate extends Comparable<Framerate> with EquatableMixin {
@override
int compareTo(Framerate other) =>
framesPerSecond.compareTo(other.framesPerSecond);
}
}

View File

@ -1,4 +1,3 @@
/// Video quality.
enum VideoQuality {
/// Low quality (144p).

View File

@ -1 +1 @@
//TODO: Implement this
//TODO: Implement this

View File

@ -48,12 +48,13 @@ void main() {
throwsArgumentError);
});
test('InvalidPlaylistUrl', () {
expect(() => PlaylistId('youtube.com/playlist?lisp=PLOU2XLYxmsIJGErt5rrCqaSGTMyyqNt2H'),
expect(
() => PlaylistId(
'youtube.com/playlist?lisp=PLOU2XLYxmsIJGErt5rrCqaSGTMyyqNt2H'),
throwsArgumentError);
expect(() => PlaylistId('youtube.com/playlist?list=asd'),
throwsArgumentError);
expect(() => PlaylistId('youtube.com/'),
throwsArgumentError);
expect(() => PlaylistId('youtube.com/'), throwsArgumentError);
});
});
}

View File

@ -1 +1 @@
//TODO: Implement this
//TODO: Implement this

View File

@ -32,8 +32,8 @@ void main() {
expect(() => VideoId('pI2I2z zeKg'), throwsArgumentError);
});
test('InvalidVideoUrl', () {
expect(() => VideoId('youtube.com/xxx?v=pI2I2zqzeKg'),
throwsArgumentError);
expect(
() => VideoId('youtube.com/xxx?v=pI2I2zqzeKg'), throwsArgumentError);
expect(() => VideoId('youtu.be/watch?v=xxx'), throwsArgumentError);
expect(() => VideoId('youtube.com/embed/'), throwsArgumentError);
});