Autor Beitrag
Pepp3r
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 82



BeitragVerfasst: So 13.05.07 17:50 
Hey leute ;)
Ich habe da ein kleines Vorhaben, ich will mir mp3 Tags aus freedb auf meinen Rechner bucksieren.
So.
Hab mit nem idtcpclienten eine verbindun zu www.freedb.org gebastelt. Die (Button) Prozedur sieht folgendermaßen aus:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
procedure TForm1.Button1Click(Sender: TObject);
var
answer,
id,
nummer,
URL:
string;
begin
try
idtcpclient1.Connect(1000);
  idtcpclient1.Writeln('GET /freedb_search.php?words='+edit1.text+'&allfields=NO&fields[]=title&fields[]=artist&fields[]=track&allcats=YES&grouping=none HTTP/1.1');
  idtcpclient1.writeln('Host: www.freedb.org');
  idtcpclient1.Writeln('User-Agent: Mp3tag');
  idtcpclient1.writeln('Accept: */*');
  idtcpclient1.writeln();
while idtcpclient1.connected do
  answer:=answer+idtcpclient1.CurrentReadBuffer;
  idtcpclient1.CurrentReadBuffer;
except
end;
// mein erstes Problem: Ich weiß nicht wie ich die Disk-ID bzw die einzelnen Interpreten/Alben etc anzeigen lassen kann.(Dies hier ist nur ein kläglicher Versuch...)
  nummer:=inttostr(pos('http://www.freedb.org/freedb/',answer));
  nummer:=copy(answer,strtoint(inttostr(strtoint(nummer)+29)),13);
  id:=nummer;
  URL:='http://www.freedb.org/freedb/'+id;
  ShellExecute(Form1.Handle,'open',PChar(URL),nil,nil,SW_SHOWNORMAL);
end;


Was passiert:
Ich bekomme von freedb eine Antwort, die meine Informationen enthält.
Naja, weiter komm ich denn leider auch net :(

Moderiert von user profile iconmatze: Code- durch Delphi-Tags ersetzt
Leuchtturm
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: So 13.05.07 17:55 
Und was ist jetzt das Problem?? Für mich klingt es so als würde es funktionieren

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.
Pepp3r Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 82



BeitragVerfasst: So 13.05.07 17:56 
ach ja, hab ma mp3tag gesnifft, und der meint das da:

ausblenden volle Höhe Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
GET /~cddb/cddb.cgi?cmd=cddb+read+rock+a00ebc0c&hello=meineemail+gmx.de+Mp3tag+v2.38&proto=6 HTTP/1.1

Host: freedb.freedb.org

User-Agent: Mp3tag

Accept:*/*



HTTP/1.1 200 OK

Date: Sun, 13 May 2007 14:10:31 GMT

Server: Apache/2.0.54 (Debian GNU/Linux)

Expires: Sun May 13 16:10:31 2007

Transfer-Encoding: chunked

Content-Type: text/plain; charset=UTF-8



32b

210 rock a00ebc0c CD database entry follows (until terminating `.')

# xmcd

#

# Track frame offsets:

#.150

#.25139

#.49579

#.66802

#.95933

#.126373

#.144548

#.162912

#.192178

#.211568

#.234858

#.265578

# Disc length: 3774 seconds

# Revision: 1

# Processed by: cddbd v1.5.2PL0 Copyright (c) Steve Scherf et al.

#

# Submitted via: libkcddb 0.21

#

DISCID=a00ebc0c

DTITLE=Metallica Schwarz / Metallica

DYEAR=1900

DGENRE=Unknown

TTITLE0=Metallica1

TTITLE1=Metallica2

TTITLE2=Metallica3

TTITLE3=Metallica4

TTITLE4=Metallica5

TTITLE5=Metallica6

TTITLE6=Metallica7

TTITLE7=Metallica8

TTITLE8=Metallica9

TTITLE9=Metallica10

TTITLE10=Metallica11

TTITLE11=Metallica12

EXTD=

EXTT0=

EXTT1=

EXTT2=

EXTT3=

EXTT4=

EXTT5=

EXTT6=

EXTT7=

EXTT8=

EXTT9=

EXTT10=

EXTT11=

PLAYORDER=



3

.



0


aber leider löst das mein Problem nicht :(
Pepp3r Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 82



BeitragVerfasst: So 13.05.07 17:58 
user profile iconLeuchtturm hat folgendes geschrieben:
Und was ist jetzt das Problem?? Für mich klingt es so als würde es funktionieren

mein Problem ist, dass ich jetzt zwar eine seite bekomme, aber ich nicht weiß wie ich die Daten(dh. Interpret,Album,Titel) explizit heraus filtern kann.
edit://
ach ja , nochwas. Wenn ich den Buffer in einen String lade, sagt mir Delphi, dass es zu viele zeichen wären. ?_?
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: So 13.05.07 19:01 
Wozu brauchst du den IdTCPClient :shock:. Nimm doch IdHTTP1.Get, da biste schneller am Ziel.

Das andere wäre dann parsen: Suche in der Entwickler-Ecke COPY, Suche in der Entwickler-Ecke POS, Suche in der Entwickler-Ecke EXPLODE.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Pepp3r Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 82



BeitragVerfasst: So 13.05.07 19:10 
user profile iconGTA-Place hat folgendes geschrieben:
Wozu brauchst du den IdTCPClient :shock:. Nimm doch IdHTTP1.Get, da biste schneller am Ziel.

Das andere wäre dann parsen: Suche in der Entwickler-Ecke COPY, Suche in der Entwickler-Ecke POS, Suche in der Entwickler-Ecke EXPLODE.


danke für die Tipps, bzw für die Links, ich werd mich mal mit beschäftigen und poste später nen Statusbericht ^^