mirror of
https://github.com/MaintainTeam/LastPipeBender.git
synced 2025-03-01 05:48:22 +03:00
Wrap logs in BuildConfig.DEBUG
This commit is contained in:
parent
f856bd9306
commit
2b183a0576
2 changed files with 27 additions and 9 deletions
|
@ -4,6 +4,7 @@ import android.os.Handler
|
||||||
import android.os.Looper
|
import android.os.Looper
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import org.schabi.newpipe.App
|
import org.schabi.newpipe.App
|
||||||
|
import org.schabi.newpipe.BuildConfig
|
||||||
import org.schabi.newpipe.extractor.NewPipe
|
import org.schabi.newpipe.extractor.NewPipe
|
||||||
import org.schabi.newpipe.extractor.services.youtube.PoTokenProvider
|
import org.schabi.newpipe.extractor.services.youtube.PoTokenProvider
|
||||||
import org.schabi.newpipe.extractor.services.youtube.PoTokenResult
|
import org.schabi.newpipe.extractor.services.youtube.PoTokenResult
|
||||||
|
@ -84,7 +85,14 @@ object PoTokenProviderImpl : PoTokenProvider {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.e(TAG, "success($videoId) $playerPot,web.gvs+$streamingPot;visitor_data=$visitorData")
|
if (BuildConfig.DEBUG) {
|
||||||
|
Log.d(
|
||||||
|
TAG,
|
||||||
|
"poToken for $videoId: playerPot=$playerPot, " +
|
||||||
|
"streamingPot=$streamingPot, visitor_data=$visitorData"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
return PoTokenResult(visitorData, playerPot, streamingPot)
|
return PoTokenResult(visitorData, playerPot, streamingPot)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@ import io.reactivex.rxjava3.core.Single
|
||||||
import io.reactivex.rxjava3.core.SingleEmitter
|
import io.reactivex.rxjava3.core.SingleEmitter
|
||||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||||
import io.reactivex.rxjava3.schedulers.Schedulers
|
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||||
|
import org.schabi.newpipe.BuildConfig
|
||||||
import org.schabi.newpipe.DownloaderImpl
|
import org.schabi.newpipe.DownloaderImpl
|
||||||
import java.time.Instant
|
import java.time.Instant
|
||||||
|
|
||||||
|
@ -100,7 +101,9 @@ class PoTokenWebView private constructor(
|
||||||
*/
|
*/
|
||||||
@JavascriptInterface
|
@JavascriptInterface
|
||||||
fun onJsInitializationError(error: String) {
|
fun onJsInitializationError(error: String) {
|
||||||
|
if (BuildConfig.DEBUG) {
|
||||||
Log.e(TAG, "Initialization error from JavaScript: $error")
|
Log.e(TAG, "Initialization error from JavaScript: $error")
|
||||||
|
}
|
||||||
onInitializationErrorCloseAndCancel(PoTokenException(error))
|
onInitializationErrorCloseAndCancel(PoTokenException(error))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,12 +113,16 @@ class PoTokenWebView private constructor(
|
||||||
*/
|
*/
|
||||||
@JavascriptInterface
|
@JavascriptInterface
|
||||||
fun onRunBotguardResult(botguardResponse: String) {
|
fun onRunBotguardResult(botguardResponse: String) {
|
||||||
Log.e(TAG, "botguardResponse: $botguardResponse")
|
if (BuildConfig.DEBUG) {
|
||||||
|
Log.d(TAG, "botguardResponse: $botguardResponse")
|
||||||
|
}
|
||||||
makeJnnPaGoogleapisRequest(
|
makeJnnPaGoogleapisRequest(
|
||||||
"https://jnn-pa.googleapis.com/\$rpc/google.internal.waa.v1.Waa/GenerateIT",
|
"https://jnn-pa.googleapis.com/\$rpc/google.internal.waa.v1.Waa/GenerateIT",
|
||||||
"[ \"$REQUEST_KEY\", \"$botguardResponse\" ]",
|
"[ \"$REQUEST_KEY\", \"$botguardResponse\" ]",
|
||||||
) { responseBody ->
|
) { responseBody ->
|
||||||
Log.e(TAG, "GenerateIT response: $responseBody")
|
if (BuildConfig.DEBUG) {
|
||||||
|
Log.d(TAG, "GenerateIT response: $responseBody")
|
||||||
|
}
|
||||||
webView.evaluateJavascript(
|
webView.evaluateJavascript(
|
||||||
"""(async function() {
|
"""(async function() {
|
||||||
try {
|
try {
|
||||||
|
@ -194,7 +201,9 @@ class PoTokenWebView private constructor(
|
||||||
*/
|
*/
|
||||||
@JavascriptInterface
|
@JavascriptInterface
|
||||||
fun onObtainPoTokenError(identifier: String, error: String) {
|
fun onObtainPoTokenError(identifier: String, error: String) {
|
||||||
|
if (BuildConfig.DEBUG) {
|
||||||
Log.e(TAG, "obtainPoToken error from JavaScript: $error")
|
Log.e(TAG, "obtainPoToken error from JavaScript: $error")
|
||||||
|
}
|
||||||
popPoTokenEmitter(identifier)?.onError(PoTokenException(error))
|
popPoTokenEmitter(identifier)?.onError(PoTokenException(error))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,8 +213,9 @@ class PoTokenWebView private constructor(
|
||||||
*/
|
*/
|
||||||
@JavascriptInterface
|
@JavascriptInterface
|
||||||
fun onObtainPoTokenResult(identifier: String, poToken: String) {
|
fun onObtainPoTokenResult(identifier: String, poToken: String) {
|
||||||
Log.e(TAG, "identifier=$identifier")
|
if (BuildConfig.DEBUG) {
|
||||||
Log.e(TAG, "poToken=$poToken")
|
Log.d(TAG, "Generated poToken: identifier=$identifier poToken=$poToken")
|
||||||
|
}
|
||||||
popPoTokenEmitter(identifier)?.onSuccess(poToken)
|
popPoTokenEmitter(identifier)?.onSuccess(poToken)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue