English > Development
download all together more poster-picture from url
(1/1)
ferofrantisek:
Hi
I would like to ask if someone could help me.
Is it possible to download all together more poster-picture from url? I used TmpURLpr where is all url which I want to download.
(11.02.2015 12:24:43) GET: http://img7.anidb.net/pics/anime/14764.jpg; http://img7.anidb.net/pics/anime/16119.jpg; http://img7.anidb.net/pics/anime/14768.jpg; http://img7.anidb.net/pics/anime/14771.jpg; http://img7.anidb.net/pics/anime/14766.jpg; http://img7.anidb.net/pics/anime/14767.jpg; http://img7.anidb.net/pics/anime/16090.jpg;
But I get http/1.0 400 Bad Request
Code:
if DOWNLOAD_POSTER_ROLE then begin
curPos := Pos('<h4><span>main character</span></h4>', HTML);
LogMessage('10 if POSTER_ROLE');
if curPos > 0 then begin
TmpURLpr := '';
curPos := PosFrom('<img src="http://img7.anidb.net/pics/anime/thumbs/', HTML, curPos);
EndPos := curPos;
curPos1 := PosFrom('<h4><span>secondary cast</span></h4>', HTML, curPos)
LogMessage('21.1 ROLE Actors jpg');
while (curPos < curPos1) do begin
curPos := PosFrom('<img src="http://img7.anidb.net/pics/anime/thumbs/', HTML, curPos) + Length('<img src="http://img7.anidb.net/pics/anime/thumbs/50x65/');
EndPos := PosFrom('-thumb.jpg"', HTML, curPos);
LogMessage('10.1 DOWNLOAD_POSTER_ROLE');
URLpr := 'http://img7.anidb.net/pics/anime/' + Copy(HTML, curPos, EndPos - curPos);
LogMessage('10.2 URL ROLE ACTORS: '+URLpr);
TmpURLpr := TmpURLpr + URLpr+';'+#32 ;
end;
LogMessage('10.3 URL ROLE ACTORS List to download: '+TmpURLpr);
ExtraLinks[smPoster] := TmpURLpr
end;
end;
Thanks for all.
ferofrantisek:
During the testing i find out how to download all poster-image.
Code:
if DOWNLOAD_POSTER_ROLE then begin
curPos := Pos('<h4><span>main character</span></h4>', HTML);
LogMessage('10 IF POSTER_ROLE');
if curPos > 0 then begin
TmpURLpr := '';
curPos := PosFrom('<img src="http://img7.anidb.net/pics/anime/thumbs/', HTML, curPos);
EndPos := curPos;
curPos1 := PosFrom('<h4><span>secondary cast</span></h4>', HTML, curPos)
LogMessage('21.1 ROLE POSTER Actors jpg');
//while (curPos < curPos1) and (curPos > EndPos) do begin
while (curPos < curPos1) do begin
curPos := PosFrom('<img src="http://img7.anidb.net/pics/anime/thumbs/', HTML, curPos) + Length('<img src="http://img7.anidb.net/pics/anime/thumbs/50x65/');
EndPos := PosFrom('-thumb.jpg"', HTML, curPos);
LogMessage('10.1 DOWNLOAD_POSTER_ROLE');
URLpr := 'http://img7.anidb.net/pics/anime/' + Copy(HTML, curPos, EndPos - curPos);
LogMessage('10.2 URL ROLE ACTORS: '+URLpr);
LogMessage('10.3 List of URL ROLE ACTORS to download: '+TmpURLpr);
TmpURLpr := TmpURLpr + URLpr+';'+#32 ;
ExtraLinks[smPoster] := URLpr
//AddImageURL(0,URLpr);
end;
//ExtraLinks[smPoster] := TmpURLpr **not working error bad request
end;
I would like to ask if someone know how to download poster-image:
1. save in the place where is file with movie or some other place not in to the database file. (which setting can i use?)
2. save poster-image with specific name (for example name of role from movie) which is different when i download from url.
Thanks for any advice.
Ivek23:
--- Quote from: ferofrantisek on February 11, 2015, 05:57:24 pm ---I would like to ask if someone know how to download poster-image:
1. save in the place where is file with movie or some other place not in to the database file. (which setting can i use?)
2. save poster-image with specific name (for example name of role from movie) which is different when i download from url.
Thanks for any advice.
--- End quote ---
At this would Nostra best able to respond, which is, unfortunately, more often than not lately absent.
pra15:
I don't know if i understand well your question.
I you want download more than one image for a movie script you must use AddImageUrl for each image in the same procedure.
ex: AddImageURL(0,Urlimage1);
AddImageURL(0,Urlimage2);
AddImageURL(1,UrlImage3);
ect....
If your data is like url1,url2,url3 you can use the function ExplodeString to put each url in a array then use a boucle for.
For i := Low(Array) to High(Array) do begin
AddImageUrl(0,Array);
end;
ferofrantisek:
Thank you, I used something different, but I have some other problems which i mentioned in Subject: How to do that in the title.... There is also full working script and Skin for Anime Database. Please look for it.
Thank you for any advice.
:D
Navigation
[0] Message Index
Go to full version