29 lines
852 B
Plaintext
29 lines
852 B
Plaintext
import "pkg:/components/Services/Invidious/InvidiousService.bs"
|
|
|
|
@job("ProfilesInvidiousUnregisterTokenJob")
|
|
function ExecuteJob() as void
|
|
input = JobGetInput()
|
|
|
|
profileContentNodes = input.profileNodes
|
|
invidiousNode = input.invidious
|
|
|
|
service = new Invidious.InvidiousService(invidiousNode)
|
|
|
|
for each profileNode in profileContentNodes
|
|
' Refresh token is for Innertube
|
|
token = profileNode.refreshToken
|
|
if StringUtils.IsNullOrEmpty(token)
|
|
token = profileNode.accessToken
|
|
end if
|
|
|
|
authToken = {
|
|
instance: profileNode.serverUrl
|
|
token: token
|
|
}
|
|
response = service.UnregisterToken(authToken)
|
|
if not response.IsSuccess()
|
|
LogWarn(`Failed to unregister token: ${response.ErrorMessage()}`)
|
|
end if
|
|
end for
|
|
end function
|