Rotate visitor data every day

This commit is contained in:
Brahim Hadriche committed 2025-05-08 21:48:52 -04:00
1 parent 21a10705f1
commit b040b2997c
2 files changed
+5 -3

No files matched your search

+3 -1
View File
@@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
- Nothing worth mentioning yet.
### Fixed
- A bug where Session data did not refresh after 24 hours
## [0.36.7] - 2025-05-04
@@ -9,7 +9,7 @@ import "pkg:/source/utils/TimeUtils.bs"
namespace Innertube
const SESSION_DATA_VERSION = 1
const INNERTUBE_VISITOR_DATA_LIFESPAN = 1000 * 60 * 60 * 24
const INNERTUBE_VISITOR_DATA_LIFESPAN_SECONDS = 60 * 60 * 24
function GetSessionData() as object
sessionData = ReadSessionDataFromRegistry()
@@ -81,7 +81,7 @@ namespace Innertube
timestamp = sessionData.timestamp
nowSeconds = TimeUtils.Now().AsSeconds()
if nowSeconds - timestamp > INNERTUBE_VISITOR_DATA_LIFESPAN
if nowSeconds - timestamp > INNERTUBE_VISITOR_DATA_LIFESPAN_SECONDS
RegistryUtils.Delete(RegistryUtils.INNERTUBE_SESSION_DATA)
return invalid
end if