-
-
Notifications
You must be signed in to change notification settings - Fork 320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue#1686 YouTube cookie set to null by logout. #1694
base: dev
Are you sure you want to change the base?
Conversation
Hi, thanks for working on this. Your current version does not really clear the cookie in the saved preferences/settings. What do you think about moving this logic into I guess this is where the cookie is updated from the webview:
You could try to set the cookie to null in this place (if it does not contain SAPISID). |
Thank you for the feedback. You are right. I will check it too. And the stuff with |
Hi, I have updated the code according to your suggestions. Now cookie and visitorData should be removed from preference storage by logout. |
Hi @zeratul47 your current code still does not set the cookie to For example what do you think about this code in
This should be much simpler. It does completely remove the cookie from the settings so it is really reset and read as With this you can remove your changes in As for You could just let it generate a new InnerTune/app/src/main/java/com/zionhuang/music/App.kt Lines 86 to 89 in c5b2856
Should be easy since it already automatically re-runs if the visitorData is
|
I have updated code, by your advice. |
oh well I forgot to think of that. idk we have to test and see what works For example in the
which does automatically re-run when the cookie changes. Maybe something similar could be added to the home page. |
GlobalScope.launch { | ||
if ("SAPISID" in parseCookieString(youtubeCookieString)) { // if logged in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you use parseCookieString
here?
To my understanding this should be enough:
if ("SAPISID" in youtubeCookieString) { // if logged in
since youtubeCookieString
is already a string and we can simply check if it contains the substring "SAPISID".
I do not see a reason to parse the cookies here as this would only take longer.
Was there a reason why you added it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, if we do not parse the string, then how "SAPISID" in youtubeCookieString
will work?
I probably can use youtubeCookieString.contains("SAPISID")
.
Anyway I will check it one time (and documentation too), and change if necessary.
Thank you for checking!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how
"SAPISID" in youtubeCookieString
will work?
it checks if youtubeCookieString
contains "SAPISID"
From Kotlin docs: https://kotlinlang.org/docs/operator-overloading.html#in-operator
a in b
translates into b.contains(a)
so you have both options:
youtubeCookieString.contains("SAPISID")
"SAPISID" in youtubeCookieString
use whatever you think looks better - they both work
Fixes #1686
YouTube.cookie
set tonull
by logout.settings.gradle.kts
to auto download dependencies.