Little refactoring

This commit is contained in:
Mattia 2020-09-13 10:44:10 +02:00
parent f5f1c42536
commit 865880504b
2 changed files with 2 additions and 21 deletions

View File

@ -86,25 +86,6 @@ class ChannelUploadPage {
: _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 {
// Json parsed map
final ChannelUploadPageId root;

View File

@ -26,13 +26,13 @@ class SearchPage {
///
_InitialData get initialData =>
_initialData ??= _InitialData(json.decode(_matchJson(_extractJson(
_initialData ??= _InitialData(json.decode(_extractJson(
_root
.querySelectorAll('script')
.map((e) => e.text)
.toList()
.firstWhere((e) => e.contains('window["ytInitialData"] =')),
'window["ytInitialData"] ='))));
'window["ytInitialData"] =')));
///
String get xsfrToken => _xsrfToken ??= _xsfrTokenExp