Rotate visitor data every day
This commit is contained in:
1 parent
21a10705f1
commit
b040b2997c
2 files changed
+5
-3
No files matched your search
+3
-1
@@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
- Nothing worth mentioning yet.
|
### Fixed
|
||||||
|
|
||||||
|
- A bug where Session data did not refresh after 24 hours
|
||||||
|
|
||||||
## [0.36.7] - 2025-05-04
|
## [0.36.7] - 2025-05-04
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import "pkg:/source/utils/TimeUtils.bs"
|
|||||||
namespace Innertube
|
namespace Innertube
|
||||||
|
|
||||||
const SESSION_DATA_VERSION = 1
|
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
|
function GetSessionData() as object
|
||||||
sessionData = ReadSessionDataFromRegistry()
|
sessionData = ReadSessionDataFromRegistry()
|
||||||
@@ -81,7 +81,7 @@ namespace Innertube
|
|||||||
|
|
||||||
timestamp = sessionData.timestamp
|
timestamp = sessionData.timestamp
|
||||||
nowSeconds = TimeUtils.Now().AsSeconds()
|
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)
|
RegistryUtils.Delete(RegistryUtils.INNERTUBE_SESSION_DATA)
|
||||||
return invalid
|
return invalid
|
||||||
end if
|
end if
|
||||||
|
|||||||
Reference in new issue
Block a user