diff --git a/baseunits/modules/PecintaKomik.pas b/baseunits/modules/PecintaKomik.pas index 1be686352..5eec6c2aa 100644 --- a/baseunits/modules/PecintaKomik.pas +++ b/baseunits/modules/PecintaKomik.pas @@ -101,7 +101,7 @@ function GetImageURL(var DownloadThread: TDownloadThread; const AURL: String; Module: TModuleContainer): Boolean; var query: TXQueryEngineHTML; - s: String; + s, b: String; begin Result:=False; if DownloadThread=nil then Exit; @@ -113,9 +113,10 @@ function GetImageURL(var DownloadThread: TDownloadThread; const AURL: String; query:=TXQueryEngineHTML.Create; try query.ParseHTML(StreamToString(Document)); + b:=query.XPathString('//base/@href'); + if b='' then b:=Module.RootURL; s:=query.XPathString('//img[@class="picture"]/@src'); - if s<>'' then - PageLinks[DownloadThread.workCounter]:=MaybeFillHost(Module.RootURL,s); + if s<>'' then PageLinks[DownloadThread.workCounter]:=MaybeFillHost(b,s); finally query.Free; end;