Minor changes
This commit is contained in:
parent
b3ee180b6a
commit
1a4bbfcc75
|
@ -67,6 +67,7 @@ Future<void> download(String id) async {
|
||||||
// Listen for data received.
|
// Listen for data received.
|
||||||
var progressBar = ProgressBar();
|
var progressBar = ProgressBar();
|
||||||
await for (var data in audioStream) {
|
await for (var data in audioStream) {
|
||||||
|
|
||||||
// Keep track of the current downloaded data.
|
// Keep track of the current downloaded data.
|
||||||
count += data.length;
|
count += data.length;
|
||||||
|
|
||||||
|
|
|
@ -222,9 +222,9 @@ class _PlayerConfig {
|
||||||
|
|
||||||
class _InitialData {
|
class _InitialData {
|
||||||
// Json parsed map
|
// Json parsed map
|
||||||
final Map<String, dynamic> _root;
|
final Map<String, dynamic> root;
|
||||||
|
|
||||||
_InitialData(this._root);
|
_InitialData(this.root);
|
||||||
|
|
||||||
/* Cache results */
|
/* Cache results */
|
||||||
|
|
||||||
|
@ -232,16 +232,16 @@ class _InitialData {
|
||||||
String _clickTrackingParams;
|
String _clickTrackingParams;
|
||||||
|
|
||||||
Map<String, dynamic> getContinuationContext(Map<String, dynamic> root) {
|
Map<String, dynamic> getContinuationContext(Map<String, dynamic> root) {
|
||||||
if (_root['contents'] != null) {
|
if (root['contents'] != null) {
|
||||||
return (_root['contents']['twoColumnWatchNextResults']['results']
|
return (root['contents']['twoColumnWatchNextResults']['results']
|
||||||
['results']['contents'] as List<dynamic>)
|
['results']['contents'] as List<dynamic>)
|
||||||
?.firstWhere((e) => e.containsKey('itemSectionRenderer'))[
|
?.firstWhere((e) => e.containsKey('itemSectionRenderer'))[
|
||||||
'itemSectionRenderer']['continuations']
|
'itemSectionRenderer']['continuations']
|
||||||
?.first['nextContinuationData']
|
?.first['nextContinuationData']
|
||||||
?.cast<String, dynamic>();
|
?.cast<String, dynamic>();
|
||||||
}
|
}
|
||||||
if (_root['response'] != null) {
|
if (root['response'] != null) {
|
||||||
return _root['response']['itemSectionContinuation']['continuations']
|
return root['response']['itemSectionContinuation']['continuations']
|
||||||
?.first['nextContinuationData']
|
?.first['nextContinuationData']
|
||||||
?.cast<String, dynamic>();
|
?.cast<String, dynamic>();
|
||||||
}
|
}
|
||||||
|
@ -249,8 +249,8 @@ class _InitialData {
|
||||||
}
|
}
|
||||||
|
|
||||||
String get continuation => _continuation ??=
|
String get continuation => _continuation ??=
|
||||||
getContinuationContext(_root)?.getValue('continuation') ?? '';
|
getContinuationContext(root)?.getValue('continuation') ?? '';
|
||||||
|
|
||||||
String get clickTrackingParams => _clickTrackingParams ??=
|
String get clickTrackingParams => _clickTrackingParams ??=
|
||||||
getContinuationContext(_root)?.getValue('clickTrackingParams') ?? '';
|
getContinuationContext(root)?.getValue('clickTrackingParams') ?? '';
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
export 'comment.dart';
|
export 'comment.dart';
|
||||||
|
export 'comments_client.dart';
|
Loading…
Reference in New Issue