dartfmt
This commit is contained in:
parent
1cd6283e82
commit
2fadb3a13c
|
@ -71,7 +71,6 @@ Future<void> download(String id) async {
|
||||||
// console.cursorPosition = Coordinate(row, 0);
|
// console.cursorPosition = Coordinate(row, 0);
|
||||||
// console.write(msg);
|
// console.write(msg);
|
||||||
|
|
||||||
|
|
||||||
// Listen for data received.
|
// Listen for data received.
|
||||||
await for (var data in audioStream) {
|
await for (var data in audioStream) {
|
||||||
count += data.length;
|
count += data.length;
|
||||||
|
|
|
@ -19,7 +19,6 @@ class ChannelClient {
|
||||||
/// [id] must be either a [ChannelId] or a string
|
/// [id] must be either a [ChannelId] or a string
|
||||||
/// which is parsed to a [ChannelId]
|
/// which is parsed to a [ChannelId]
|
||||||
Future<Channel> get(dynamic id) async {
|
Future<Channel> get(dynamic id) async {
|
||||||
|
|
||||||
var channelPage = await ChannelPage.get(_httpClient, id.value);
|
var channelPage = await ChannelPage.get(_httpClient, id.value);
|
||||||
|
|
||||||
return Channel(id, channelPage.channelTitle, channelPage.channelLogoUrl);
|
return Channel(id, channelPage.channelTitle, channelPage.channelLogoUrl);
|
||||||
|
|
|
@ -3,4 +3,4 @@ library youtube_explode.channels;
|
||||||
export 'channel.dart';
|
export 'channel.dart';
|
||||||
export 'channel_client.dart';
|
export 'channel_client.dart';
|
||||||
export 'channel_id.dart';
|
export 'channel_id.dart';
|
||||||
export 'username.dart';
|
export 'username.dart';
|
||||||
|
|
|
@ -4,7 +4,6 @@ import 'youtube_explode_exception.dart';
|
||||||
|
|
||||||
/// Exception thrown when a fatal failure occurs.
|
/// Exception thrown when a fatal failure occurs.
|
||||||
class RequestLimitExceededException implements YoutubeExplodeException {
|
class RequestLimitExceededException implements YoutubeExplodeException {
|
||||||
|
|
||||||
/// Description message
|
/// Description message
|
||||||
@override
|
@override
|
||||||
final String message;
|
final String message;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import '../extensions/helpers_extension.dart';
|
import '../extensions/helpers_extension.dart';
|
||||||
|
|
||||||
|
|
||||||
/// Encapsulates a valid YouTube playlist ID.
|
/// Encapsulates a valid YouTube playlist ID.
|
||||||
class PlaylistId {
|
class PlaylistId {
|
||||||
static final _regMatchExp =
|
static final _regMatchExp =
|
||||||
|
|
|
@ -11,8 +11,7 @@ class PlayerSource {
|
||||||
|
|
||||||
final RegExp _funcNameExp = RegExp(r'(\w+).\w+\(\w+,\d+\);');
|
final RegExp _funcNameExp = RegExp(r'(\w+).\w+\(\w+,\d+\);');
|
||||||
|
|
||||||
final RegExp _calledFuncNameExp =
|
final RegExp _calledFuncNameExp = RegExp(r'\w+(?:.|\[)(\"?\w+(?:\")?)\]?\(');
|
||||||
RegExp(r'\w+(?:.|\[)(\"?\w+(?:\")?)\]?\(');
|
|
||||||
|
|
||||||
final String _root;
|
final String _root;
|
||||||
|
|
||||||
|
|
|
@ -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);
|
WatchPage.parse(String raw) : _root = parser.parse(raw);
|
||||||
|
|
|
@ -4,7 +4,6 @@ import 'closed_caption.dart';
|
||||||
|
|
||||||
/// Track that contains closed captions in a specific language.
|
/// Track that contains closed captions in a specific language.
|
||||||
class ClosedCaptionTrack {
|
class ClosedCaptionTrack {
|
||||||
|
|
||||||
/// Closed captions.
|
/// Closed captions.
|
||||||
final UnmodifiableListView<ClosedCaption> captions;
|
final UnmodifiableListView<ClosedCaption> captions;
|
||||||
|
|
||||||
|
|
|
@ -23,4 +23,4 @@ class Framerate extends Comparable<Framerate> with EquatableMixin {
|
||||||
@override
|
@override
|
||||||
int compareTo(Framerate other) =>
|
int compareTo(Framerate other) =>
|
||||||
framesPerSecond.compareTo(other.framesPerSecond);
|
framesPerSecond.compareTo(other.framesPerSecond);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
/// Video quality.
|
/// Video quality.
|
||||||
enum VideoQuality {
|
enum VideoQuality {
|
||||||
/// Low quality (144p).
|
/// Low quality (144p).
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
//TODO: Implement this
|
//TODO: Implement this
|
||||||
|
|
|
@ -48,12 +48,13 @@ void main() {
|
||||||
throwsArgumentError);
|
throwsArgumentError);
|
||||||
});
|
});
|
||||||
test('InvalidPlaylistUrl', () {
|
test('InvalidPlaylistUrl', () {
|
||||||
expect(() => PlaylistId('youtube.com/playlist?lisp=PLOU2XLYxmsIJGErt5rrCqaSGTMyyqNt2H'),
|
expect(
|
||||||
|
() => PlaylistId(
|
||||||
|
'youtube.com/playlist?lisp=PLOU2XLYxmsIJGErt5rrCqaSGTMyyqNt2H'),
|
||||||
throwsArgumentError);
|
throwsArgumentError);
|
||||||
expect(() => PlaylistId('youtube.com/playlist?list=asd'),
|
expect(() => PlaylistId('youtube.com/playlist?list=asd'),
|
||||||
throwsArgumentError);
|
throwsArgumentError);
|
||||||
expect(() => PlaylistId('youtube.com/'),
|
expect(() => PlaylistId('youtube.com/'), throwsArgumentError);
|
||||||
throwsArgumentError);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
//TODO: Implement this
|
//TODO: Implement this
|
||||||
|
|
|
@ -32,8 +32,8 @@ void main() {
|
||||||
expect(() => VideoId('pI2I2z zeKg'), throwsArgumentError);
|
expect(() => VideoId('pI2I2z zeKg'), throwsArgumentError);
|
||||||
});
|
});
|
||||||
test('InvalidVideoUrl', () {
|
test('InvalidVideoUrl', () {
|
||||||
expect(() => VideoId('youtube.com/xxx?v=pI2I2zqzeKg'),
|
expect(
|
||||||
throwsArgumentError);
|
() => VideoId('youtube.com/xxx?v=pI2I2zqzeKg'), throwsArgumentError);
|
||||||
expect(() => VideoId('youtu.be/watch?v=xxx'), throwsArgumentError);
|
expect(() => VideoId('youtu.be/watch?v=xxx'), throwsArgumentError);
|
||||||
expect(() => VideoId('youtube.com/embed/'), throwsArgumentError);
|
expect(() => VideoId('youtube.com/embed/'), throwsArgumentError);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue