From 2abc5ce7a5eaf17a1b492e005d2be369e05682da Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Fri, 4 Nov 2022 18:22:33 -0400 Subject: [PATCH] Remove hardcoded ip address --- src/source/services/Invidious.bs | 2 +- src/source/webserver/common/General.brs | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/source/services/Invidious.bs b/src/source/services/Invidious.bs index 7dbfbe8d..ebf3f444 100644 --- a/src/source/services/Invidious.bs +++ b/src/source/services/Invidious.bs @@ -99,7 +99,7 @@ namespace RokuYoutube.Services.Invidious invidiousHost = strReplace(API_URL, "https://", "http://") scope = ":*" - localIp = "192.168.1.107" + localIp = GetLocalIpAddress() webServerPort = 8888 expire = Now().AsSeconds() + 60 * 60 * 24 * 30 'A month from now diff --git a/src/source/webserver/common/General.brs b/src/source/webserver/common/General.brs index 41cc4ed8..2774bcf8 100644 --- a/src/source/webserver/common/General.brs +++ b/src/source/webserver/common/General.brs @@ -37,3 +37,10 @@ Function IsHD() return false End Function +Function GetLocalIpAddress() + di = CreateObject("roDeviceInfo") + ips = di.GetIPAddrs() + for each ip in ips + return ips[ip] + end for +End Function \ No newline at end of file