Hot-Honeys



.

Author Topic: REQ: pimpandhost  (Read 491 times)

0 Members and 1 Guest are viewing this topic.

Offline pcaca

  • Newbie
  • *
  • Joined: Dec 2016
  • Posts: 9
  • Reputation: 0
Re: REQ: pimpandhost
« Reply #15 on: December 27, 2016, 07:42 pm »
I'm back...

This is an example of the retrieval of weird files I mentioned before:

collection: http://vintage-erotica-forum.com/showpost.php?p=3766194
ex. image: http://pimpandhost.com/image/57914921

Trying to "Get all the files on page" over the collection results in 16 weird ".png" files, instead of the right ones.

If you "Get all the files on page" on the example image, the main image is not retrieved, but interestingly the "previous" and "next" are correctly retrieved (so IHG works well on these URLs).

You need userid and password to access the forum, I'll provide both through a PM.

Regards,

pcaca

Offline firewaran

  • Moderator
  • *****
  • Joined: Apr 2016
  • Posts: 247
  • Reputation: 17
  • Gender: Male
Re: REQ: pimpandhost
« Reply #16 on: December 27, 2016, 08:23 pm »
Here is a solution for maximum compatibility:
Code: [Select]
function(pageData, pageUrl) {
var retVal = {};
if (pageUrl.match(/-original\.html$/)) {
if (pageData.match(/img.+id=("|')main-image\1/)) {
return {imgUrl: pageData.match(/img.+id=("|')main-image\1.+src=\1(.+?)\1/)[2], status: "OK"}
} else {
var iUrl = pageData.match(/src="(http:\/\/.+?)"/);
}
} else {
if (pageUrl.match(/\.html$/)) {
retVal.imgUrl = pageUrl.replace(/.+\/(\d+)_x\.html$/, "http://image.pimpandhost.com/image/$1-medium.html");
retVal.imgUrl = retVal.imgUrl.replace(/(^http.+-)\w+\.html$/, "$1original.html");
} else {
if (pageUrl.match(/\/show\/id\/(\d+)/)) {
retVal.imgUrl = pageUrl.replace(/^http.+\/show\/id\/(\d+)$/, "http://pimpandhost.com/image/$1-original.html");
} else {
return {imgUrl: pageData.match(/img.+id=("|')main-image\1.+src=\1(.+?)\1/)[2], status: "OK"}
}
}
retVal.status = "REQUEUE";
return retVal;
}
return iUrl ? {imgUrl: iUrl[1], status: "OK"} : {imgUrl: null, status: "ABORT"}
}

I suspect that we could achieve the same with this much shorter solution, at least it worked on the recently given examples.
Code: [Select]
function(pageData, pageUrl) {
return {imgUrl: pageData.match(/img.+id=("|')main-image\1.+src=\1(.+?)\1/)[2], status: "OK"}
}
The "medium" and "original" stuff seems to be for "older" maybe out-dated galleries, if there are such links out there, would be a risk i have to admit.

Offline SenileDog

  • Moderator
  • *****
  • Joined: Apr 2016
  • Location: US West Coast
  • Posts: 492
  • Images: 653
  • Reputation: 20
  • Gender: Male
Re: REQ: pimpandhost
« Reply #17 on: December 27, 2016, 08:33 pm »
Hi Fire,

I agree with you, I was thinking of rewriting it. I hate pipe-solutions with bunch of if and else, never a good sign, rarely needed.

We need more tests with the short solution, though.

Cheers, SD

Offline pcaca

  • Newbie
  • *
  • Joined: Dec 2016
  • Posts: 9
  • Reputation: 0
Re: REQ: pimpandhost
« Reply #18 on: December 27, 2016, 09:01 pm »
Thank you very much, fire. Both versions work well in the test cases I have been collecting so far (which include some old "-original" files). I also support coding elegance so I'll use the short one going forward and will come back in case I find any backward compatibility issues with some other pimpandhost sintaxes.

I really appreciate the speed of your responses...

Merry Xmas,

pcaca

Offline astrax

  • Newbie
  • *
  • Joined: Aug 2016
  • Posts: 12
  • Reputation: 0
Re: REQ: pimpandhost
« Reply #19 on: December 28, 2016, 11:38 am »
Thanks, working like a charm.  :thumbsup:

Offline firewaran

  • Moderator
  • *****
  • Joined: Apr 2016
  • Posts: 247
  • Reputation: 17
  • Gender: Male
Re: REQ: pimpandhost
« Reply #20 on: December 28, 2016, 06:45 pm »
I have queued it for the next automatic update so all people get the short version.
We will then see if someone of your members will find some galleries not working anymore.

Thanks for testing pcaca and astrax.

Offline SenileDog

  • Moderator
  • *****
  • Joined: Apr 2016
  • Location: US West Coast
  • Posts: 492
  • Images: 653
  • Reputation: 20
  • Gender: Male
Re: REQ: pimpandhost
« Reply #21 on: December 28, 2016, 08:45 pm »
Fire, you also should put chronos and coreimg in the waiting thread. SD

Offline firewaran

  • Moderator
  • *****
  • Joined: Apr 2016
  • Posts: 247
  • Reputation: 17
  • Gender: Male
Re: REQ: pimpandhost
« Reply #22 on: December 29, 2016, 07:56 pm »
Hi SD, thanks for the hint, i totally forgot them. Consider it done :)

Offline sexylauren

  • Newbie
  • *
  • Joined: Jun 2016
  • Location: us
  • Posts: 12
  • Reputation: 0
  • Gender: Female
Re: REQ: pimpandhost
« Reply #23 on: January 02, 2017, 05:06 am »
aloha

first...happy new year !!!  second..THANKS for all your hard work and sharing.

third.....i get an error message there are no images found at this url:  http://vintage-erotica-forum.com/showpost.php?p=3893381&postcount=247 .  however they open when you click on the individual images.  i edited my copy of grabber with both of the solutions above with no luck.

any help?

lauren

Offline firewaran

  • Moderator
  • *****
  • Joined: Apr 2016
  • Posts: 247
  • Reputation: 17
  • Gender: Male
Re: REQ: pimpandhost
« Reply #24 on: January 03, 2017, 04:52 pm »
Hi,

i can download them well with:

Url Pattern:
Code: [Select]
^http:\/\/(?:image\.|www\.)?pimpandhost\.com\/(?:(?:image|guest)\/.+\.html|image\/(show\/id\/)?\d+)$Search Pattern:
Code: [Select]
function(pageData, pageUrl) {
return {imgUrl: pageData.match(/img.+id=("|')main-image\1.+src=\1(.+?)\1/)[2], status: "OK"}
}

Offline sexylauren

  • Newbie
  • *
  • Joined: Jun 2016
  • Location: us
  • Posts: 12
  • Reputation: 0
  • Gender: Female
Re: REQ: pimpandhost
« Reply #25 on: January 03, 2017, 06:40 pm »
aloha firewaran

THANKS!!!

i edited the host with your suggestion and "Viola!!

Happy New Year!

lauren