Web with register

If you made a script you can offer it to the others here, or ask help to improve it. You can also report here bugs & problems with existing scripts.
Post Reply
raulsara
Posts: 54
Joined: 2006-02-13 14:05:04

Web with register

Post by raulsara »

Hello;

I've a problem with the web to extract Pictures www.covercaratulas.com, i've developed a new script but on the last page, tells me i must be registered. So i can't Get Picture because it doesn't show me the page with the picture. Pleasse what can i do, i don't know who can i register with the script. My nick web coveratula.com is raulsara and the password antmovie

Maybe i have to add the user / password in the url. I don't know.

Pleasse help me.

Thanks
J
Posts: 224
Joined: 2008-02-17 17:09:26

Post by J »

hm, looks like you need to send a cookie when you try to dl a picture. You can try the cookie you got from the site when you first login with your browser.

Use GetPage3 instead of GetPage

Code: Select all

function GetPage3(address: string; referer: string; cookies: string): string;
Same as GetPage2, but allows to specify cookies as a string: 'uid=120; pwd=FHNHESW' for example.
for example the site set the cookie:
Server: www.covercaratulas.com
Name: usuario
Value: MzYwMzY2OnJhdWxzYXJhOjZhNTUzOWQ1MDU2OTRiNDlkMTZiNzgzMjgyM2YzOGQ3
end date: 2014-11-19
raulsara
Posts: 54
Joined: 2006-02-13 14:05:04

Post by raulsara »

Ok J, tomorrow I'll try and tell you something.

Thanks
raulsara
Posts: 54
Joined: 2006-02-13 14:05:04

Post by raulsara »

Hi J:

I tried to do what you tell me and it doesn't work me.

Could you help me?.

My user in the web www.covercaratulas.com is 'raulsara' and the password is 'antmovie'.

Getpage3 (pageweb , ? , ?);

I've tried several ways but it does not work me

Thanks
antp
Site Admin
Posts: 9651
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

From what he posted, the cookie would be
'usuario=MzYwMzY2OnJhdWxzYXJhOjZhNTUzOWQ1MDU2OTRiNDlkMTZiNzgzMjgyM2YzOGQ3'
The refered parameter is the "previous page" (the address of the page you loaded before, e.g. the main page or the movie page url)
J
Posts: 224
Joined: 2008-02-17 17:09:26

Post by J »

hi, a bit of a mess with this site :( but the magic part is:

Code: Select all

page := GetPage3(address,'','usuario=MzYwMzY2OnJhdWxzYXJhOjZhNTUzOWQ1MDU2OTRiNDlkMTZiNzgzMjgyM2YzOGQ3');
well, it´s a four step path to get to the picture, but perhaps you find a shortcut.

movie:
http://www.covercaratulas.com/El_poder_ ... 35614.html

firstpic:
http://www.covercaratulas.com/caratula- ... 21314.html

picpage:
http://www.covercaratulas.com/caratula/ ... r_Peppito/

picture:
http://www.covercaratulas.com/ode2/cart ... EPPITO.jpg

I wrote little demo prog. with an example movie to test:

Code: Select all

program cookietest;
uses
  StringUtils1;
var
  address: string;
  page: string;

begin
  address := 'http://www.covercaratulas.com/caratula-carteles-Paranoia__2013__V2-21314.html';
  page := GetPage3(address,'','usuario=MzYwMzY2OnJhdWxzYXJhOjZhNTUzOWQ1MDU2OTRiNDlkMTZiNzgzMjgyM2YzOGQ3');
  address := 'http://www.covercaratulas.com/' + TextBetween(page, 'Visualizar: <a href="', '"');
  ShowMessage (address);
  page := GetPage3(address,'','usuario=MzYwMzY2OnJhdWxzYXJhOjZhNTUzOWQ1MDU2OTRiNDlkMTZiNzgzMjgyM2YzOGQ3');
  ShowMessage (page);
  address := TextBetween(page, 'src="http://', '"');
  ShowMessage (address);
  GetPicture('http://' + address);
end.
hope this is the right picture ;)
raulsara
Posts: 54
Joined: 2006-02-13 14:05:04

Post by raulsara »

Hi J:

Tonight I'll prove it well but I've done a little test and I think it works well !!!.
The script I got it done just me missing the last access to the image.
Thank you very much, I didn't know how to finish the script.

Tonight I'll prove it right and i'll say something.

Thank you very much :grinking: :grinking: :)
raulsara
Posts: 54
Joined: 2006-02-13 14:05:04

Post by raulsara »

HI J

I tried your solution and it works great. Now I can finish the script.

Thank you very much :grinking: :grinking:
raulsara
Posts: 54
Joined: 2006-02-13 14:05:04

Post by raulsara »

Hi "J", I have a problem with the script. If you are using the ShowMessage then it works fine but when you take away the showmessages sometimes goes well and other times I do not read web page. I've tried everything but I have not managed to make it works. Is random, when there is ShowMessage it works but when ther isn't showmessage is randon. Please could you help me. :cry: :cry: :cry:

Thanks
antp
Site Admin
Posts: 9651
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Maybe it is because the script goes too fast ?
Instead of the showmessage, try to put a call to "sleep" (I think it is that, check the help file) to wait for one or two seconds for example.
raulsara
Posts: 54
Joined: 2006-02-13 14:05:04

Post by raulsara »

Hi Antp, thanks. I will try it.
J
Posts: 224
Joined: 2008-02-17 17:09:26

Post by J »

hm, that sounds really strange.

The ShowMessage(s) are only good for debugging to see how it works, so there is absolutely no need for them for the final script functionality itself.

Are you sure that you have nothing else changed? What is the exact error you get back? What do you get back when the error occurs - just an empty page or a different content?

How many GetPage do you send per movie?

Maybe the script is sometimes too fast, or there is a timer or something. I for example had sometimes connection problems with IMDB server when doing a script in batch mode for hundreds or thousands of movies.

To be honest, without testing I have no clue what the problem comes from.
raulsara
Posts: 54
Joined: 2006-02-13 14:05:04

Post by raulsara »

Hi antp and J. I put ' Sleep 40000' after getpage3 and it seems to work fine. I'll keep testing it but I think it works.

Thanks again. :) :) :grinking:
antp
Site Admin
Posts: 9651
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

40000 ? That makes 40 seconds, seems a lot (or you mean 4000 ?)
raulsara
Posts: 54
Joined: 2006-02-13 14:05:04

Post by raulsara »

I'm sorry antp, i mean 4000.

Thanks
Post Reply