Little refactoring
This commit is contained in:
parent
f5f1c42536
commit
865880504b
|
@ -86,25 +86,6 @@ class ChannelUploadPage {
|
||||||
: _root = parser.parse(raw);
|
: _root = parser.parse(raw);
|
||||||
}
|
}
|
||||||
|
|
||||||
void x() {
|
|
||||||
ChannelUploadPageId _id;
|
|
||||||
// @getContentContext
|
|
||||||
var x = _id.contents.twoColumnBrowseResultsRenderer.tabs
|
|
||||||
.map((e) => e.tabRenderer)
|
|
||||||
.firstWhere((e) => e.selected)
|
|
||||||
.content
|
|
||||||
.sectionListRenderer
|
|
||||||
.contents
|
|
||||||
.first
|
|
||||||
.itemSectionRenderer
|
|
||||||
.contents
|
|
||||||
.first
|
|
||||||
.gridRenderer
|
|
||||||
.items;
|
|
||||||
|
|
||||||
_id.response.continuationContents.gridContinuation.items;
|
|
||||||
}
|
|
||||||
|
|
||||||
class _InitialData {
|
class _InitialData {
|
||||||
// Json parsed map
|
// Json parsed map
|
||||||
final ChannelUploadPageId root;
|
final ChannelUploadPageId root;
|
||||||
|
|
|
@ -26,13 +26,13 @@ class SearchPage {
|
||||||
|
|
||||||
///
|
///
|
||||||
_InitialData get initialData =>
|
_InitialData get initialData =>
|
||||||
_initialData ??= _InitialData(json.decode(_matchJson(_extractJson(
|
_initialData ??= _InitialData(json.decode(_extractJson(
|
||||||
_root
|
_root
|
||||||
.querySelectorAll('script')
|
.querySelectorAll('script')
|
||||||
.map((e) => e.text)
|
.map((e) => e.text)
|
||||||
.toList()
|
.toList()
|
||||||
.firstWhere((e) => e.contains('window["ytInitialData"] =')),
|
.firstWhere((e) => e.contains('window["ytInitialData"] =')),
|
||||||
'window["ytInitialData"] ='))));
|
'window["ytInitialData"] =')));
|
||||||
|
|
||||||
///
|
///
|
||||||
String get xsfrToken => _xsrfToken ??= _xsfrTokenExp
|
String get xsfrToken => _xsrfToken ??= _xsfrTokenExp
|
||||||
|
|
Loading…
Reference in New Issue