...
This commit is contained in:
parent
a1756773e8
commit
8f685f667b
@ -79,6 +79,7 @@ import rasel.lunar.launcher.home.weather.WeatherExecutor
|
|||||||
import rasel.lunar.launcher.qaccess.QuickAccess
|
import rasel.lunar.launcher.qaccess.QuickAccess
|
||||||
import rasel.lunar.launcher.settings.SettingsActivity
|
import rasel.lunar.launcher.settings.SettingsActivity
|
||||||
import rasel.lunar.launcher.todos.MissedCallsAdapter
|
import rasel.lunar.launcher.todos.MissedCallsAdapter
|
||||||
|
import rasel.lunar.launcher.todos.Root
|
||||||
import rasel.lunar.launcher.todos.SmsLogsAdapter
|
import rasel.lunar.launcher.todos.SmsLogsAdapter
|
||||||
import rasel.lunar.launcher.utils.BLog
|
import rasel.lunar.launcher.utils.BLog
|
||||||
import rasel.lunar.launcher.utils.MissedCallGetter
|
import rasel.lunar.launcher.utils.MissedCallGetter
|
||||||
@ -606,50 +607,73 @@ internal class LauncherHome : Fragment() {
|
|||||||
var tempJSONObject : JSONObject? = null
|
var tempJSONObject : JSONObject? = null
|
||||||
JSONObject(StringEscapeUtils.unescapeEcmaScript(ytInitialData)).apply{
|
JSONObject(StringEscapeUtils.unescapeEcmaScript(ytInitialData)).apply{
|
||||||
tempJSONObject = this
|
tempJSONObject = this
|
||||||
}.keys().forEach {
|
BLog.LOGE("tempJSONObject.toString() >>> ${tempJSONObject.toString()}")
|
||||||
if (it.equals("contents")) {
|
val aRoot = Gson().fromJson(tempJSONObject.toString(), Root::class.java)
|
||||||
var child = tempJSONObject?.getJSONObject(it)
|
BLog.LOGE("aRoot >>> ${aRoot}")
|
||||||
if(child?.length() == 1 && child?.has("singleColumnBrowseResultsRenderer") == true) {
|
BLog.LOGE("aRoot?.responseContext >>> ${aRoot.responseContext}")
|
||||||
BLog.LOGE("(singleColumnBrowseResultsRenderer >> ${child}")
|
BLog.LOGE("aRoot?.header ${aRoot?.header}")
|
||||||
var singleColumnBrowseResultsRenderer = child?.getJSONObject("singleColumnBrowseResultsRenderer")
|
BLog.LOGE("aRoot?.topbar ${aRoot?.topbar}")
|
||||||
if (singleColumnBrowseResultsRenderer?.has("tabs") == true) {
|
BLog.LOGE("aRoot?.metadata ${aRoot?.metadata}")
|
||||||
var tabs : JSONArray? = singleColumnBrowseResultsRenderer?.getJSONArray("tabs")
|
BLog.LOGE("aRoot?.contents? >>> ${aRoot?.contents}")
|
||||||
BLog.LOGE("(tabs >>>> ${tabs}")
|
BLog.LOGE("aRoot?.contents?.twoColumnBrowseResultsRenderer >>> ${aRoot?.contents?.twoColumnBrowseResultsRenderer}")
|
||||||
for ( i in 0..<(tabs?.length() ?: 0)) {
|
BLog.LOGE("aRoot?.contents?.twoColumnBrowseResultsRenderer.tabs >>> ${aRoot?.contents?.twoColumnBrowseResultsRenderer?.tabs}")
|
||||||
var tabsChild = tabs?.getJSONObject(i)
|
BLog.LOGE("aRoot?.microformat? >>> ${aRoot?.microformat}")
|
||||||
BLog.LOGE("tabsChild >> ${tabsChild}")
|
BLog.LOGE("aRoot?.onResponseReceivedActions? >>> ${aRoot?.onResponseReceivedActions}")
|
||||||
if(tabsChild?.has("tabRenderer") == true) {
|
aRoot?.contents?.apply {
|
||||||
var tabRenderer = tabsChild?.getJSONObject("tabRenderer")
|
BLog.LOGE("aRoot?.contents? >>> ${this}")
|
||||||
BLog.LOGE("tabRenderer >> ${tabRenderer}")
|
BLog.LOGE("aRoot?.contents?.twoColumnBrowseResultsRenderer >>> ${twoColumnBrowseResultsRenderer}")
|
||||||
tabRenderer?.keys()?.forEach {
|
twoColumnBrowseResultsRenderer?.tabs?.forEach {
|
||||||
// BLog.LOGE("tabRenderer in key >> ${it}")
|
BLog.LOGE("it.sectionListRenderer?.contents? >>> ${it}")
|
||||||
if (tabRenderer?.get(it) is String) {
|
BLog.LOGE("it.tabRenderer ${it.tabRenderer}")
|
||||||
BLog.LOGE("tabRenderer String in $it >> ${tabRenderer?.get(it)}")
|
BLog.LOGE("it.expandableTabRenderer ${it.expandableTabRenderer}")
|
||||||
}
|
|
||||||
else if (tabRenderer?.get(it) is JSONObject) {
|
|
||||||
var obj = tabRenderer?.getJSONObject(it)
|
|
||||||
BLog.LOGE("tabRenderer child JSONObject in $it >> ${obj}")
|
|
||||||
var pkey = it
|
|
||||||
obj?.keys()?.forEach {
|
|
||||||
jsonObjLog(pkey,it,obj)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (tabRenderer?.get(it) is JSONArray) {
|
|
||||||
BLog.LOGE("tabRenderer JSONArray in $it >> ${tabRenderer?.get(it)}")
|
|
||||||
} else {
|
|
||||||
BLog.LOGE("tabRenderer else in $it >> ${tabRenderer?.get(it)}")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
child?.keys()?.forEach { childKey ->
|
|
||||||
BLog.LOGE("ytInitialData >>> ${it} >>>> ${childKey}")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// .keys().forEach {
|
||||||
|
// if (it.equals("contents")) {
|
||||||
|
// var child = tempJSONObject?.getJSONObject(it)
|
||||||
|
// if(child?.length() == 1 && child?.has("singleColumnBrowseResultsRenderer") == true) {
|
||||||
|
// BLog.LOGE("(singleColumnBrowseResultsRenderer >> ${child}")
|
||||||
|
// var singleColumnBrowseResultsRenderer = child?.getJSONObject("singleColumnBrowseResultsRenderer")
|
||||||
|
// if (singleColumnBrowseResultsRenderer?.has("tabs") == true) {
|
||||||
|
// var tabs : JSONArray? = singleColumnBrowseResultsRenderer?.getJSONArray("tabs")
|
||||||
|
// BLog.LOGE("(tabs >>>> ${tabs}")
|
||||||
|
// for ( i in 0..<(tabs?.length() ?: 0)) {
|
||||||
|
// var tabsChild = tabs?.getJSONObject(i)
|
||||||
|
// BLog.LOGE("tabsChild >> ${tabsChild}")
|
||||||
|
// if(tabsChild?.has("tabRenderer") == true) {
|
||||||
|
// var tabRenderer = tabsChild?.getJSONObject("tabRenderer")
|
||||||
|
// BLog.LOGE("tabRenderer >> ${tabRenderer}")
|
||||||
|
// tabRenderer?.keys()?.forEach {
|
||||||
|
// // BLog.LOGE("tabRenderer in key >> ${it}")
|
||||||
|
// if (tabRenderer?.get(it) is String) {
|
||||||
|
// BLog.LOGE("tabRenderer String in $it >> ${tabRenderer?.get(it)}")
|
||||||
|
// }
|
||||||
|
// else if (tabRenderer?.get(it) is JSONObject) {
|
||||||
|
// var obj = tabRenderer?.getJSONObject(it)
|
||||||
|
// BLog.LOGE("tabRenderer child JSONObject in $it >> ${obj}")
|
||||||
|
// var pkey = it
|
||||||
|
// obj?.keys()?.forEach {
|
||||||
|
// jsonObjLog(pkey,it,obj)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// else if (tabRenderer?.get(it) is JSONArray) {
|
||||||
|
// BLog.LOGE("tabRenderer JSONArray in $it >> ${tabRenderer?.get(it)}")
|
||||||
|
// } else {
|
||||||
|
// BLog.LOGE("tabRenderer else in $it >> ${tabRenderer?.get(it)}")
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// child?.keys()?.forEach { childKey ->
|
||||||
|
// BLog.LOGE("ytInitialData >>> ${it} >>>> ${childKey}")
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ytChannel(doc.html())
|
// ytChannel(doc.html())
|
||||||
|
|||||||
1669
app/src/main/kotlin/rasel/lunar/launcher/todos/YoutubeData.kt
Normal file
1669
app/src/main/kotlin/rasel/lunar/launcher/todos/YoutubeData.kt
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user