Ahoj, snažím se rozchodit jednu vec....
Mam seznam m3u (již jsme tady resili)
#EXTM3U
#EXTINF:-1 tvg-chno="1",Radio1
http://xxxxxxxx/radia/mojedoma12?auth=&profile=LQ
#EXTINF:-1 tvg-chno="2",Radio2
http://xxxxxxxx/radia/mojedoma333?auth=&profile=LQ
#EXTINF:-1 tvg-chno="3",Radio3
http://xxxxxxxx/radia/mojedoma98754?auth=&profile=LQ
A potřeboval bych, aby za "auth=" se pridal text z Edit2.text.
Zkousim to jiz nejakou dobu a porad na to nemuzu prijit
pomocí :
const
Protocol = 'http://';
function TryAppendLogin(var URL: string; const Token: string): Boolean;
begin
Result := IsURL(URL); // zjistime zda je retezec URL
if Result then // pokud ano, pak...
Insert(Token, URL, Length(Protocol) + 54); // vlozime jmeno a heslo na pozici za protokol
end;
procedure TForm2.Button3Click(Sender: TObject);
var
S: string;
I: Integer;
begin
begin
ZTable1.Edit;
DBEdit7.Text := 'http://presmeruj.cekuj.net/user/'+DBEdit2.Text+'.m3u';
ZTable1.Post;
end;
Memo2.Clear;
begin
Response1 := TStringList.Create;
try
Response1.Text := IdHTTP1.Get('http://xcxcxcxcxc/radia.m3u');
for I := 0 to Response1.Count - 1 do
begin
S := Response1[I];
if TryAppendLogin(S, Edit2.Text) then
Response1[I] := S;
end;
Memo2.Lines.AddStrings(Response1);
finally
Response1.Free;
end;
end;
end;
Dokážu doplnit ten Token na pozici 54, ale ty radky se meni.. tzn jednou potrebuji token dan na pozici 54 a nekdy na 52 atd... takze bych potreboval to dat za "auth=", ale porad na to nemuzu prijit