Author Topic: IAFD People  (Read 3740 times)

0 Members and 1 Guest are viewing this topic.

Offline oenghus

  • Member
  • *
  • Posts: 10
    • View Profile
IAFD People
« on: November 14, 2013, 04:25:33 am »
There is a problem loading the image for some people and I think it's where the image URL contains spaces. The URL for the person is:

http://www.iafd.com/person.rme/perfid=alishaadams/gender=f/alisha-adams.htm

The current procedure in the script I use is:

procedure ParsePhoto(PhotoURL : String);
begin
   LogMessage('PARSING PHOTO...' + PhotoURL);
   PhotoURL:=HTMLToText (PhotoURL);
   AddImageURL(4,PhotoURL);
   
end;


PVD log:

PARSING PHOTO...http://www.iafd.com/graphics/headshots/alishaadams_f_alisha adams aalluredotcom hs.jpg
Url di download: Foto
GET: http://www.iafd.com/graphics/headshots/alishaadams_f_alisha adams aalluredotcom hs.jpg
HTTP/1.1 400 Bad Request


I tried replacing spaces in PhotoURL with %20 before AddImageURL but it didn't make any difference.

Does anyone have any ideas how to fix this ?

Thx
Oenghus


Offline afrocuban

  • Power User
  • ****
  • Posts: 163
    • View Profile
Re: IAFD People
« Reply #1 on: November 14, 2013, 08:19:40 pm »
I have no knowledge about scripting, but just a lucky guess. Is it possbile, not to put "%20" instead of spaces in url, but to put whole url under quotes (double, or single, I'm not sure)?

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: IAFD People
« Reply #2 on: January 22, 2014, 02:51:54 am »
No, URLs are not allowed to have spaces in them.
Gentlemen, you can’t fight in here! This is the War Room!

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 1899
    • View Profile
Re: IAFD People
« Reply #3 on: January 08, 2015, 01:26:46 pm »
No, URLs are not allowed to have spaces in them.

Simple solution for this:

Code: [Select]
//Foto
curPos :=Pos('src="/graphics/headshots',HTML);
if curPos >0 then begin
EndPos:= PosFrom('>',HTML,curPos);
LogMessage ('URL Foto: '+PhotoURL);
PhotoURL := BASE_URL + Copy(HTML,curPos + 6, EndPos - curPos - 7);
PhotoURL := StringReplace(PhotoURL, ' ', '%20', true, false, true);
LogMessage ('URL Foto: '+PhotoURL);
ParsePhoto(PhotoURL);
end
else
begin
PhotoURL := '';
LogMessage ('URL Foto: NESSUNO');
end;
Ivek23
Win 7 32bit, 64bit   PVD v0.9.9.21


Offline pra15

  • Power User
  • ****
  • Posts: 164
    • View Profile
Re: IAFD People
« Reply #4 on: April 23, 2015, 01:12:09 am »
Hello everybody,

It seems iafd.com has changed URL photo of headshot.
Correction :
Code: [Select]
//Foto
curPos :=Pos('id="headshot">',HTML);
if curPos >0 then begin
PhotoURL := TextBetween(HTML,'src="','"></div>',True,curpos);
LogMessage ('URL Foto: '+PhotoURL);
ParsePhoto(PhotoURL);
end
else
begin
PhotoURL := '';
LogMessage ('URL Foto: NESSUNO');
end;

I've tested only some page it seems work good.

Offline Frank MT

  • Member
  • *
  • Posts: 1
    • View Profile
Re: IAFD People
« Reply #5 on: May 03, 2015, 12:37:28 pm »
Thx pra15,

works fine again.  :)

Offline pra15

  • Power User
  • ****
  • Posts: 164
    • View Profile
Re: IAFD People
« Reply #6 on: May 03, 2015, 05:15:45 pm »
you're welcome

Offline AimHere

  • Power User
  • ****
  • Posts: 202
    • View Profile
Re: IAFD People
« Reply #7 on: June 08, 2015, 02:43:48 pm »
Can someone post a link/attachment for the complete, corrected, up-to-date version of this script, please? Thanks.

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 1899
    • View Profile
Re: IAFD People
« Reply #8 on: June 09, 2015, 05:24:46 am »
Can someone post a link/attachment for the complete, corrected, up-to-date version of this script, please? Thanks.

The revised script is attached here:

http://www.videodb.info/forum_en/index.php/topic,3951.msg19154.html#msg19154
Ivek23
Win 7 32bit, 64bit   PVD v0.9.9.21


 

anything