procedure TMainForm.btn1Click(Sender: TObject);
var
lHTTP: TIdHTTP;
begin
lHTTP := TIdHTTP.Create(nil);
try
mmo1.Text := lHTTP.Get('http://guessit.io/guess?filename=House.of.Cards.2013.S02E03.1080p.NF.WEBRip.DD5.1.x264-NTb.mkv');
finally
lHTTP.Free;
end;
end;
结果将是这样的:
{
"series":"House of Cards",
"episodeNumber":3,
"releaseGroup":"NTb",
"format":"WEBRip",
"season":2,
"audioCodec":"DolbyDigital",
"year":2013,
"mimetype":"video/x-matroska",
"container":"mkv",
"videoCodec":"h264",
"other":[
"Netflix"
],
"audioChannels":"5.1",
"screenSize":"1080p",
"type":"episode"
}
例如,我如何阅读系列(“系列”:“纸牌屋”)值。
我尝试使用
Function ExtractBetweenTags(Const Line, TagI, TagF: string): string;
var
i, f : integer;
begin
i := Pos(TagI, Line);
f := Pos(TagF, Copy(Line, i+length(TagI), MAXINT));
if (i > 0) and (f > 0) then
Result:= Copy(Line, i+length(TagI), f-1);
end;
mmo1.Text := StringReplace(ExtractBetweenTags(mmo1.Text,'"series": "','"'), ' ', '-',[rfReplaceAll, rfIgnoreCase]);
但我需要自动解析所有值