Add playlist support

This commit is contained in:
Brahim Hadriche committed 2022-11-05 19:41:05 -04:00
1 parent 6a4478f916
commit 7c24f36149
4 files changed
+42 -2

No files matched your search

+25
View File
@@ -14,6 +14,7 @@ namespace RokuYoutube.Services.Invidious
const SEARCH_ENDPOINT = "/api/v1/search"
const AUTH_FEED = "/api/v1/auth/feed"
const AUTH_PLAYLISTS = "/api/v1/auth/playlists"
function GetCountryCode()
if m.countryCode = invalid or m.countryCode = "" then
@@ -165,4 +166,28 @@ namespace RokuYoutube.Services.Invidious
return response.json.videos
end if
end function
function GetUserPlaylists()
headers = GetAuthenticationHeaders()
if headers = invalid
return invalid
end if
url = `${API_URL}${AUTH_PLAYLISTS}`
args = {
headers: headers,
retryCount: 3 'Sometimes authentication fails randomly with a valid token...
}
response = Requests().get(url, args)
if response.statuscode = 403
RokuYoutube.Utils.Registry.Delete("token")
end if
if response.statuscode = 200
return response.json
end if
end function
end namespace