Author Topic: download all together more poster-picture from url  (Read 12643 times)

0 Members and 1 Guest are viewing this topic.

Offline ferofrantisek

  • Member
  • *
  • Posts: 21
    • View Profile
download all together more poster-picture from url
« on: February 11, 2015, 12:37:58 pm »
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.

Offline ferofrantisek

  • Member
  • *
  • Posts: 21
    • View Profile
Re: download all together more poster-picture from url
« Reply #1 on: February 11, 2015, 05:57:24 pm »
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.

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2737
    • View Profile
Re: download all together more poster-picture from url
« Reply #2 on: February 12, 2015, 03:38:16 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.

At this would Nostra best able to respond, which is, unfortunately, more often than not lately absent.
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline pra15

  • Older Power User
  • *****
  • Posts: 173
    • View Profile
Re: download all together more poster-picture from url
« Reply #3 on: February 13, 2015, 06:46:58 pm »
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;







Offline ferofrantisek

  • Member
  • *
  • Posts: 21
    • View Profile
Re: download all together more poster-picture from url
« Reply #4 on: March 05, 2015, 05:10:57 pm »
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
« Last Edit: March 06, 2015, 09:52:52 pm by ferofrantisek »