From fc8508c0277cd81261ca96a931327d73b2b8a4fb Mon Sep 17 00:00:00 2001 From: sasgis <> Date: Sat, 12 Dec 1970 12:00:00 +0000 Subject: [PATCH] update zmp --- .../GetUrlScript.txt | 67 +++++++++---------- .../navionics.SonarChart.layer.zmp/params.txt | 5 +- .../navionics.SonarChart.zmp/GetUrlScript.txt | 67 +++++++++---------- Navionics/navionics.SonarChart.zmp/params.txt | 5 +- .../navionics.layer.zmp/GetUrlScript.txt | 67 +++++++++---------- Navionics/navionics.layer.zmp/params.txt | 5 +- Navionics/navionics.zmp/GetUrlScript.txt | 67 +++++++++---------- Navionics/navionics.zmp/info.txt | 1 + Navionics/navionics.zmp/params.txt | 5 +- 9 files changed, 141 insertions(+), 148 deletions(-) create mode 100644 Navionics/navionics.zmp/info.txt diff --git a/Navionics/navionics.SonarChart.layer.zmp/GetUrlScript.txt b/Navionics/navionics.SonarChart.layer.zmp/GetUrlScript.txt index 23566a8c8..fc0673989 100644 --- a/Navionics/navionics.SonarChart.layer.zmp/GetUrlScript.txt +++ b/Navionics/navionics.SonarChart.layer.zmp/GetUrlScript.txt @@ -1,65 +1,63 @@ //****************************************************************************** // LAYERS parameter: config_a_b_c // a = 1 for depth in meters, 2 for depth in feet, 3 for fathoms -// b = 10.00: for 10.00 m safety depth (beginning of blue coloring) (unit equal to that set by a) +// b = 1 for 1 m safety depth (beginning of blue coloring) (unit equal to that set by a) // c = 0 for pristine Navionics charts, 1 for Sonar Charts // // TRANSPARENT parameter: // FALSE for non-layer // TRUE for layer -// -// UGC parameter: -// FALSE for pristine Navionics charts -// TRUE for additinal user-generated content icons +// //****************************************************************************** const - cReqParams = 'LAYERS=config_1_10.00_1&TRANSPARENT=TRUE&UGC=FALSE'; + cReqParams = 'LAYERS=config_1_1_1&TRANSPARENT=TRUE&theme=0'; //****************************************************************************** const - cTTL = 24*60*60; // 24 hour - cNavTokenKey = 'NavToken='; - cTimeStampKey = 'TimeStamp='; + cTTL = 24*60*60; // 24 hour -function CheckTTL(const ATimeStamp: AnsiString): Boolean; +function CheckTTL(const ATimeStamp: Integer): Boolean; begin - Result := ( (cTTL div 2) > GetUnixTime - StrToInt64Def(ATimeStamp, 0) ); + Result := (cTTL div 2) > GetUnixTime - ATimeStamp; end; function GetNavToken: AnsiString; var VNavToken: AnsiString; - VTimeStamp: AnsiString; + VTimeStamp: Integer; VResponseCode: Cardinal; VResponseHeader, VResponseData: AnsiString; VRequestUrl, VRequestHeader: AnsiString; begin Result := ''; - if ScriptBuffer <> '' then begin - VNavToken := GetBetween(ScriptBuffer, cNavTokenKey, ';'); - VTimeStamp := GetBetween(ScriptBuffer, cTimeStampKey, ';'); - if (VNavToken <> '') and (VTimeStamp <> '') and CheckTTL(VTimeStamp) then begin - Result := VNavToken; - end else begin - ScriptBuffer := ''; + Global.Lock; + try + if Global.Exists(0) and Global.Exists(1) then begin + VNavToken := Global.GetVar(0); + VTimeStamp := Global.GetVar(1); + if (VNavToken <> '') and (VTimeStamp <> 0) and CheckTTL(VTimeStamp) then begin + Result := VNavToken; + end; end; - end; - - if (Result = '') and Assigned(Downloader) then begin - VTimeStamp := IntToStr(GetUnixTime); - VRequestUrl := 'https://backend.navionics.com/tile/get_key/NAVIONICS_WEBAPP_P01/webapp.navionics.com?_=' + VTimeStamp + '123'; - VRequestHeader := 'Origin: https://webapp.navionics.com' + #13#10 + 'Referer: https://webapp.navionics.com/'; - VResponseHeader := ''; - VResponseData := ''; - VResponseCode := Downloader.DoHttpRequest(VRequestUrl, VRequestHeader, '', VResponseHeader, VResponseData); - - if VResponseCode = 200 then begin - Result := VResponseData; - ScriptBuffer := cNavTokenKey + Result + ';' + cTimeStampKey + VTimeStamp + ';'; - end; + + if (Result = '') and Assigned(Downloader) then begin + VRequestUrl := 'https://tile1.navionics.com/tile/get_key/Navionics_webapi_04041/maps.garmin.com'; + VRequestHeader := 'Origin: https://maps.garmin.com' + #13#10 + 'Referer: https://maps.garmin.com/'; + VResponseHeader := ''; + VResponseData := ''; + VResponseCode := Downloader.DoHttpRequest(VRequestUrl, VRequestHeader, '', VResponseHeader, VResponseData); + + if VResponseCode = 200 then begin + Result := VResponseData; + Global.SetVar(0, Result); + Global.SetVar(1, GetUnixTime); + end; + end; + finally + Global.Unlock; end; end; @@ -70,8 +68,7 @@ var begin VNavToken := GetNavToken; if VNavToken <> '' then begin - ResultURL := GetURLBase + IntToStr(GetZ-1) + '/' + IntToStr(GetX) + '/' + - IntToStr(GetY) + '?' + cReqParams + '&' + 'navtoken=' + VNavToken; + ResultURL := TemplateToUrl(GetURLBase) + '?' + cReqParams + '&' + 'navtoken=' + VNavToken; end else begin ResultURL := ''; end; diff --git a/Navionics/navionics.SonarChart.layer.zmp/params.txt b/Navionics/navionics.SonarChart.layer.zmp/params.txt index 9f00143a7..fed5627e8 100644 --- a/Navionics/navionics.SonarChart.layer.zmp/params.txt +++ b/Navionics/navionics.SonarChart.layer.zmp/params.txt @@ -5,7 +5,8 @@ ParentSubMenu_ru=Водные карты ParentSubMenu_uk=Водні карти ParentSubMenu=Water maps asLayer=1 -DefURLBase=https://backend.navionics.com/tile/ +DefURLBase=https://tile{s}.navionics.com/tile/{z}/{x}/{y} +ServerNames=1,2,3,4,5 NameInCache=navionics_sonarchart_layer Ext=.png ContentType=image/png @@ -13,4 +14,4 @@ projection=1 sradiusa=6378137 sradiusb=6378137 IsUseDownloaderInScript=1 -RequestHead=Referer: http://webapp.navionics.com/ +RequestHead=Referer: https://maps.garmin.com/ diff --git a/Navionics/navionics.SonarChart.zmp/GetUrlScript.txt b/Navionics/navionics.SonarChart.zmp/GetUrlScript.txt index 35bc391b9..57135810e 100644 --- a/Navionics/navionics.SonarChart.zmp/GetUrlScript.txt +++ b/Navionics/navionics.SonarChart.zmp/GetUrlScript.txt @@ -1,65 +1,63 @@ //****************************************************************************** // LAYERS parameter: config_a_b_c // a = 1 for depth in meters, 2 for depth in feet, 3 for fathoms -// b = 10.00: for 10.00 m safety depth (beginning of blue coloring) (unit equal to that set by a) +// b = 1 for 1 m safety depth (beginning of blue coloring) (unit equal to that set by a) // c = 0 for pristine Navionics charts, 1 for Sonar Charts // // TRANSPARENT parameter: // FALSE for non-layer // TRUE for layer -// -// UGC parameter: -// FALSE for pristine Navionics charts -// TRUE for additinal user-generated content icons +// //****************************************************************************** const - cReqParams = 'LAYERS=config_1_10.00_1&TRANSPARENT=FALSE&UGC=FALSE'; + cReqParams = 'LAYERS=config_1_1_1&TRANSPARENT=FALSE&theme=0'; //****************************************************************************** const - cTTL = 24*60*60; // 24 hour - cNavTokenKey = 'NavToken='; - cTimeStampKey = 'TimeStamp='; + cTTL = 24*60*60; // 24 hour -function CheckTTL(const ATimeStamp: AnsiString): Boolean; +function CheckTTL(const ATimeStamp: Integer): Boolean; begin - Result := ( (cTTL div 2) > GetUnixTime - StrToInt64Def(ATimeStamp, 0) ); + Result := (cTTL div 2) > GetUnixTime - ATimeStamp; end; function GetNavToken: AnsiString; var VNavToken: AnsiString; - VTimeStamp: AnsiString; + VTimeStamp: Integer; VResponseCode: Cardinal; VResponseHeader, VResponseData: AnsiString; VRequestUrl, VRequestHeader: AnsiString; begin Result := ''; - if ScriptBuffer <> '' then begin - VNavToken := GetBetween(ScriptBuffer, cNavTokenKey, ';'); - VTimeStamp := GetBetween(ScriptBuffer, cTimeStampKey, ';'); - if (VNavToken <> '') and (VTimeStamp <> '') and CheckTTL(VTimeStamp) then begin - Result := VNavToken; - end else begin - ScriptBuffer := ''; + Global.Lock; + try + if Global.Exists(0) and Global.Exists(1) then begin + VNavToken := Global.GetVar(0); + VTimeStamp := Global.GetVar(1); + if (VNavToken <> '') and (VTimeStamp <> 0) and CheckTTL(VTimeStamp) then begin + Result := VNavToken; + end; end; - end; - - if (Result = '') and Assigned(Downloader) then begin - VTimeStamp := IntToStr(GetUnixTime); - VRequestUrl := 'https://backend.navionics.com/tile/get_key/NAVIONICS_WEBAPP_P01/webapp.navionics.com?_=' + VTimeStamp + '123'; - VRequestHeader := 'Origin: https://webapp.navionics.com' + #13#10 + 'Referer: https://webapp.navionics.com/'; - VResponseHeader := ''; - VResponseData := ''; - VResponseCode := Downloader.DoHttpRequest(VRequestUrl, VRequestHeader, '', VResponseHeader, VResponseData); - - if VResponseCode = 200 then begin - Result := VResponseData; - ScriptBuffer := cNavTokenKey + Result + ';' + cTimeStampKey + VTimeStamp + ';'; - end; + + if (Result = '') and Assigned(Downloader) then begin + VRequestUrl := 'https://tile1.navionics.com/tile/get_key/Navionics_webapi_04041/maps.garmin.com'; + VRequestHeader := 'Origin: https://maps.garmin.com' + #13#10 + 'Referer: https://maps.garmin.com/'; + VResponseHeader := ''; + VResponseData := ''; + VResponseCode := Downloader.DoHttpRequest(VRequestUrl, VRequestHeader, '', VResponseHeader, VResponseData); + + if VResponseCode = 200 then begin + Result := VResponseData; + Global.SetVar(0, Result); + Global.SetVar(1, GetUnixTime); + end; + end; + finally + Global.Unlock; end; end; @@ -70,8 +68,7 @@ var begin VNavToken := GetNavToken; if VNavToken <> '' then begin - ResultURL := GetURLBase + IntToStr(GetZ-1) + '/' + IntToStr(GetX) + '/' + - IntToStr(GetY) + '?' + cReqParams + '&' + 'navtoken=' + VNavToken; + ResultURL := TemplateToUrl(GetURLBase) + '?' + cReqParams + '&' + 'navtoken=' + VNavToken; end else begin ResultURL := ''; end; diff --git a/Navionics/navionics.SonarChart.zmp/params.txt b/Navionics/navionics.SonarChart.zmp/params.txt index 57c2f58d0..2ac48aced 100644 --- a/Navionics/navionics.SonarChart.zmp/params.txt +++ b/Navionics/navionics.SonarChart.zmp/params.txt @@ -4,7 +4,8 @@ name=Navionics SonarChart(TM) ParentSubMenu_ru=Водные карты ParentSubMenu_uk=Водні карти ParentSubMenu=Water maps -DefURLBase=https://backend.navionics.com/tile/ +DefURLBase=https://tile{s}.navionics.com/tile/{z}/{x}/{y} +ServerNames=1,2,3,4,5 NameInCache=navionics_sonarchart Ext=.png ContentType=image/png @@ -12,4 +13,4 @@ projection=1 sradiusa=6378137 sradiusb=6378137 IsUseDownloaderInScript=1 -RequestHead=Referer: http://webapp.navionics.com/ +RequestHead=Referer: https://maps.garmin.com/ diff --git a/Navionics/navionics.layer.zmp/GetUrlScript.txt b/Navionics/navionics.layer.zmp/GetUrlScript.txt index 683be37e4..6045ab211 100644 --- a/Navionics/navionics.layer.zmp/GetUrlScript.txt +++ b/Navionics/navionics.layer.zmp/GetUrlScript.txt @@ -1,65 +1,63 @@ //****************************************************************************** // LAYERS parameter: config_a_b_c // a = 1 for depth in meters, 2 for depth in feet, 3 for fathoms -// b = 10.00: for 10.00 m safety depth (beginning of blue coloring) (unit equal to that set by a) +// b = 1 for 1 m safety depth (beginning of blue coloring) (unit equal to that set by a) // c = 0 for pristine Navionics charts, 1 for Sonar Charts // // TRANSPARENT parameter: // FALSE for non-layer // TRUE for layer -// -// UGC parameter: -// FALSE for pristine Navionics charts -// TRUE for additinal user-generated content icons +// //****************************************************************************** const - cReqParams = 'LAYERS=config_1_10.00_0&TRANSPARENT=TRUE&UGC=FALSE'; + cReqParams = 'LAYERS=config_1_1_0&TRANSPARENT=TRUE&theme=0'; //****************************************************************************** const - cTTL = 24*60*60; // 24 hour - cNavTokenKey = 'NavToken='; - cTimeStampKey = 'TimeStamp='; + cTTL = 24*60*60; // 24 hour -function CheckTTL(const ATimeStamp: AnsiString): Boolean; +function CheckTTL(const ATimeStamp: Integer): Boolean; begin - Result := ( (cTTL div 2) > GetUnixTime - StrToInt64Def(ATimeStamp, 0) ); + Result := (cTTL div 2) > GetUnixTime - ATimeStamp; end; function GetNavToken: AnsiString; var VNavToken: AnsiString; - VTimeStamp: AnsiString; + VTimeStamp: Integer; VResponseCode: Cardinal; VResponseHeader, VResponseData: AnsiString; VRequestUrl, VRequestHeader: AnsiString; begin Result := ''; - if ScriptBuffer <> '' then begin - VNavToken := GetBetween(ScriptBuffer, cNavTokenKey, ';'); - VTimeStamp := GetBetween(ScriptBuffer, cTimeStampKey, ';'); - if (VNavToken <> '') and (VTimeStamp <> '') and CheckTTL(VTimeStamp) then begin - Result := VNavToken; - end else begin - ScriptBuffer := ''; + Global.Lock; + try + if Global.Exists(0) and Global.Exists(1) then begin + VNavToken := Global.GetVar(0); + VTimeStamp := Global.GetVar(1); + if (VNavToken <> '') and (VTimeStamp <> 0) and CheckTTL(VTimeStamp) then begin + Result := VNavToken; + end; end; - end; - - if (Result = '') and Assigned(Downloader) then begin - VTimeStamp := IntToStr(GetUnixTime); - VRequestUrl := 'https://backend.navionics.com/tile/get_key/NAVIONICS_WEBAPP_P01/webapp.navionics.com?_=' + VTimeStamp + '123'; - VRequestHeader := 'Origin: https://webapp.navionics.com' + #13#10 + 'Referer: https://webapp.navionics.com/'; - VResponseHeader := ''; - VResponseData := ''; - VResponseCode := Downloader.DoHttpRequest(VRequestUrl, VRequestHeader, '', VResponseHeader, VResponseData); - - if VResponseCode = 200 then begin - Result := VResponseData; - ScriptBuffer := cNavTokenKey + Result + ';' + cTimeStampKey + VTimeStamp + ';'; - end; + + if (Result = '') and Assigned(Downloader) then begin + VRequestUrl := 'https://tile1.navionics.com/tile/get_key/Navionics_webapi_04041/maps.garmin.com'; + VRequestHeader := 'Origin: https://maps.garmin.com' + #13#10 + 'Referer: https://maps.garmin.com/'; + VResponseHeader := ''; + VResponseData := ''; + VResponseCode := Downloader.DoHttpRequest(VRequestUrl, VRequestHeader, '', VResponseHeader, VResponseData); + + if VResponseCode = 200 then begin + Result := VResponseData; + Global.SetVar(0, Result); + Global.SetVar(1, GetUnixTime); + end; + end; + finally + Global.Unlock; end; end; @@ -70,8 +68,7 @@ var begin VNavToken := GetNavToken; if VNavToken <> '' then begin - ResultURL := GetURLBase + IntToStr(GetZ-1) + '/' + IntToStr(GetX) + '/' + - IntToStr(GetY) + '?' + cReqParams + '&' + 'navtoken=' + VNavToken; + ResultURL := TemplateToUrl(GetURLBase) + '?' + cReqParams + '&' + 'navtoken=' + VNavToken; end else begin ResultURL := ''; end; diff --git a/Navionics/navionics.layer.zmp/params.txt b/Navionics/navionics.layer.zmp/params.txt index a1d995c01..3a6c7a720 100644 --- a/Navionics/navionics.layer.zmp/params.txt +++ b/Navionics/navionics.layer.zmp/params.txt @@ -5,7 +5,8 @@ ParentSubMenu_uk=Водні карти ParentSubMenu=Water maps name=Navionics Marine Charts asLayer=1 -DefURLBase=https://backend.navionics.com/tile/ +DefURLBase=https://tile{s}.navionics.com/tile/{z}/{x}/{y} +ServerNames=1,2,3,4,5 NameInCache=navionics_layer Ext=.png ContentType=image/png @@ -13,4 +14,4 @@ projection=1 sradiusa=6378137 sradiusb=6378137 IsUseDownloaderInScript=1 -RequestHead=Referer: http://webapp.navionics.com/ +RequestHead=Referer: https://maps.garmin.com/ diff --git a/Navionics/navionics.zmp/GetUrlScript.txt b/Navionics/navionics.zmp/GetUrlScript.txt index 996ce9c64..4540df7e4 100644 --- a/Navionics/navionics.zmp/GetUrlScript.txt +++ b/Navionics/navionics.zmp/GetUrlScript.txt @@ -1,65 +1,63 @@ //****************************************************************************** // LAYERS parameter: config_a_b_c // a = 1 for depth in meters, 2 for depth in feet, 3 for fathoms -// b = 10.00: for 10.00 m safety depth (beginning of blue coloring) (unit equal to that set by a) +// b = 1 for 1 m safety depth (beginning of blue coloring) (unit equal to that set by a) // c = 0 for pristine Navionics charts, 1 for Sonar Charts // // TRANSPARENT parameter: // FALSE for non-layer // TRUE for layer -// -// UGC parameter: -// FALSE for pristine Navionics charts -// TRUE for additinal user-generated content icons +// //****************************************************************************** const - cReqParams = 'LAYERS=config_1_10.00_0&TRANSPARENT=FALSE&UGC=FALSE'; + cReqParams = 'LAYERS=config_1_1_0&TRANSPARENT=FALSE&theme=0'; //****************************************************************************** const - cTTL = 24*60*60; // 24 hour - cNavTokenKey = 'NavToken='; - cTimeStampKey = 'TimeStamp='; + cTTL = 24*60*60; // 24 hour -function CheckTTL(const ATimeStamp: AnsiString): Boolean; +function CheckTTL(const ATimeStamp: Integer): Boolean; begin - Result := ( (cTTL div 2) > GetUnixTime - StrToInt64Def(ATimeStamp, 0) ); + Result := (cTTL div 2) > GetUnixTime - ATimeStamp; end; function GetNavToken: AnsiString; var VNavToken: AnsiString; - VTimeStamp: AnsiString; + VTimeStamp: Integer; VResponseCode: Cardinal; VResponseHeader, VResponseData: AnsiString; VRequestUrl, VRequestHeader: AnsiString; begin Result := ''; - if ScriptBuffer <> '' then begin - VNavToken := GetBetween(ScriptBuffer, cNavTokenKey, ';'); - VTimeStamp := GetBetween(ScriptBuffer, cTimeStampKey, ';'); - if (VNavToken <> '') and (VTimeStamp <> '') and CheckTTL(VTimeStamp) then begin - Result := VNavToken; - end else begin - ScriptBuffer := ''; + Global.Lock; + try + if Global.Exists(0) and Global.Exists(1) then begin + VNavToken := Global.GetVar(0); + VTimeStamp := Global.GetVar(1); + if (VNavToken <> '') and (VTimeStamp <> 0) and CheckTTL(VTimeStamp) then begin + Result := VNavToken; + end; end; - end; - - if (Result = '') and Assigned(Downloader) then begin - VTimeStamp := IntToStr(GetUnixTime); - VRequestUrl := 'https://backend.navionics.com/tile/get_key/NAVIONICS_WEBAPP_P01/webapp.navionics.com?_=' + VTimeStamp + '123'; - VRequestHeader := 'Origin: https://webapp.navionics.com' + #13#10 + 'Referer: https://webapp.navionics.com/'; - VResponseHeader := ''; - VResponseData := ''; - VResponseCode := Downloader.DoHttpRequest(VRequestUrl, VRequestHeader, '', VResponseHeader, VResponseData); - - if VResponseCode = 200 then begin - Result := VResponseData; - ScriptBuffer := cNavTokenKey + Result + ';' + cTimeStampKey + VTimeStamp + ';'; - end; + + if (Result = '') and Assigned(Downloader) then begin + VRequestUrl := 'https://tile1.navionics.com/tile/get_key/Navionics_webapi_04041/maps.garmin.com'; + VRequestHeader := 'Origin: https://maps.garmin.com' + #13#10 + 'Referer: https://maps.garmin.com/'; + VResponseHeader := ''; + VResponseData := ''; + VResponseCode := Downloader.DoHttpRequest(VRequestUrl, VRequestHeader, '', VResponseHeader, VResponseData); + + if VResponseCode = 200 then begin + Result := VResponseData; + Global.SetVar(0, Result); + Global.SetVar(1, GetUnixTime); + end; + end; + finally + Global.Unlock; end; end; @@ -70,8 +68,7 @@ var begin VNavToken := GetNavToken; if VNavToken <> '' then begin - ResultURL := GetURLBase + IntToStr(GetZ-1) + '/' + IntToStr(GetX) + '/' + - IntToStr(GetY) + '?' + cReqParams + '&' + 'navtoken=' + VNavToken; + ResultURL := TemplateToUrl(GetURLBase) + '?' + cReqParams + '&' + 'navtoken=' + VNavToken; end else begin ResultURL := ''; end; diff --git a/Navionics/navionics.zmp/info.txt b/Navionics/navionics.zmp/info.txt new file mode 100644 index 000000000..358417c7d --- /dev/null +++ b/Navionics/navionics.zmp/info.txt @@ -0,0 +1 @@ +https://maps.garmin.com/en-US/marine?maps=another-brand&overlay=false&key=sr2w4buj85bn \ No newline at end of file diff --git a/Navionics/navionics.zmp/params.txt b/Navionics/navionics.zmp/params.txt index 098452bbb..ca56ee289 100644 --- a/Navionics/navionics.zmp/params.txt +++ b/Navionics/navionics.zmp/params.txt @@ -4,7 +4,8 @@ name=Navionics Marine Charts ParentSubMenu_ru=Водные карты ParentSubMenu_uk=Водні карти ParentSubMenu=Water maps -DefURLBase=https://backend.navionics.com/tile/ +DefURLBase=https://tile{s}.navionics.com/tile/{z}/{x}/{y} +ServerNames=1,2,3,4,5 NameInCache=navionics Ext=.png ContentType=image/png @@ -12,4 +13,4 @@ projection=1 sradiusa=6378137 sradiusb=6378137 IsUseDownloaderInScript=1 -RequestHead=Referer: http://webapp.navionics.com/ +RequestHead=Referer: https://maps.garmin.com/