Dalsi zmeny

This commit is contained in:
2026-03-03 16:18:27 +01:00
parent 03ff9ebc84
commit a62b608cfd
97 changed files with 4635 additions and 240 deletions

View File

@ -146,7 +146,7 @@
attrIdx:= attribs.IndexOf('downPDFintMins');
if (attrIdx>-1) then
if (attribs.Get(attrIdx).NodeValue<>null) then
lLoopMax:= attribs.Get(i).NodeValue;
lLoopMax:= attribs.Get(attrIdx).NodeValue;
end; // n1 = config
end; // specCfgXML.DocumentElement<>nil
end; // not specCfgXML.IsEmptyDoc
@ -249,6 +249,9 @@
while not(lQry.EOF) do
begin
PeekMessage (&Msg, 0, 0, 0, PM_NOREMOVE); { Create message queue }
helUtils.ProcessPendingVCLMessages;
idDigiFile:= lQry.FieldByName('ID').asInteger;
if (idDigiFile>0) then
begin
@ -276,21 +279,22 @@
if (Assigned(http1)) then
begin
http1.AllowCookies:= false;
http1.UserAgent:= 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0';
http1.UserAgent:= 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/144.0';
http1.Accept:= 'application/pdf';
datMod.LogInfo (Quick.Logger.etInfo, 'Nacitam data PDF pro downloadPDF id ' + idDigiFile.ToString);
// datMod.LogInfo (Quick.Logger.etInfo, 'Nacitam data PDF pro downloadPDF id ' + idDigiFile.ToString);
iResp:= http1.Get (url);
aResp:= (iResp.ContentStream as TMemoryStream);
outData:= MemStreamToHex (aResp);
datMod.LogInfo (Quick.Logger.etInfo, 'Mam data PDF pro downloadPDF id ' + idDigiFile.ToString);
// datMod.LogInfo (Quick.Logger.etInfo, 'Mam data PDF pro downloadPDF id ' + idDigiFile.ToString);
end;
except on E:Exception do
begin
datMod.LogInfo (Quick.Logger.etError, 'Chyba zpracovani downloadPDF id ' + idDigiFile.ToString + ' : ' + E.Message);
sqlConnX.ExecSQL ('UPDATE ' + tblAPIDigiSoubory + ' SET Blokovano=0 WHERE ID=' + idDigiFile.ToString);
datMod.LogInfo (Quick.Logger.etError, 'Chyba downloadPDF id ' + idDigiFile.ToString + ' : ' + E.Message);
{$IFDEF DEBUG}
WriteLn ('Chyba zpracovani downloadPDF id ' + idDigiFile.ToString + ' >> ' + E.Message);
WriteLn ('Chyba downloadPDF id ' + idDigiFile.ToString + ' >> ' + E.Message);
{$ENDIF}
end;
end;
@ -307,18 +311,28 @@
IdOpenSSLSetLibPath (sslLibPath);
http2:= TIdHttp.Create (nil);
sslHndlr:= TIdSSLIOHandlerSocketOpenSSL.Create (http2);
respHttp2:= TMemoryStream.Create;
try
sslHndlr.SSLOptions.Method:= sslvTLSv1_2;
sslHndlr.SSLOptions.SSLVersions := [sslvTLSv1_2, sslvTLSv1_1];
http2.IOHandler:= sslHndlr;
try
sslHndlr.SSLOptions.Method:= sslvTLSv1_2;
sslHndlr.SSLOptions.SSLVersions := [sslvTLSv1_2, sslvTLSv1_1];
http2.IOHandler:= sslHndlr;
http2.Request.Accept:= 'application/pdf';
http2.Request.BasicAuthentication := False;
http2.HTTPOptions:= http2.HTTPOptions + [hoKeepOrigProtocol] + [hoNoProtocolErrorException];
http2.Request.ContentType:= 'application/pdf; charset=utf-8';
respHttp2:= TMemoryStream.Create;
http2.Get (url, respHttp2);
outData:= MemStreamToHex (respHttp2 as TMemoryStream);
http2.Request.Accept:= 'application/pdf';
http2.Request.BasicAuthentication := False;
http2.HTTPOptions:= http2.HTTPOptions + [hoKeepOrigProtocol] + [hoNoProtocolErrorException];
http2.Request.ContentType:= 'application/pdf; charset=utf-8';
http2.Get (url, respHttp2);
outData:= MemStreamToHex (respHttp2 as TMemoryStream);
except on E:Exception do
begin
sqlConnX.ExecSQL ('UPDATE ' + tblAPIDigiSoubory + ' SET Blokovano=0 WHERE ID=' + idDigiFile.ToString);
datMod.LogInfo (Quick.Logger.etError, 'Chyba downloadPDF (SSL) id ' + idDigiFile.ToString + ' : ' + E.Message + CRLF + url);
{$IFDEF DEBUG}
WriteLn ('Chyba downloadPDF (SSL) id ' + idDigiFile.ToString + ' >> ' + E.Message + CRLF + url);
{$ENDIF}
end;
end;
finally
FreeAndNil (sslHndlr); // must be freed before IdHttp
FreeAndNil (http2);
@ -374,6 +388,7 @@
except on E:Exception do
begin
sqlConnX.ExecSQL ('UPDATE ' + tblAPIDigiSoubory + ' SET Blokovano=0 WHERE ID=' + idDigiFile.ToString);
errMsg:= E.Message; // datMod.sqlQry11.FieldByName('ErrMsg').AsString;
{$IFDEF DEBUG}
WriteLn ('Chyba 2 zpracovani downloadPDF id ' + idDigiFile.ToString + ' >> ' + errMsg);
@ -384,7 +399,7 @@
end;
end;
lQry.Next;
end;
end; // while
end;
finally
lQry.Close;