View Single Post
Old July 17th, 2017, 06:17 AM   #49
berangus
NotTheDroidURLookingFor
 
berangus's Avatar
 
Join Date: Oct 2010
Posts: 6,179
Thanks: 37,037
Thanked 141,214 Times in 6,175 Posts
berangus 500000+berangus 500000+berangus 500000+berangus 500000+berangus 500000+berangus 500000+berangus 500000+berangus 500000+berangus 500000+berangus 500000+berangus 500000+
Default

Quote:
Originally Posted by effCup View Post
No, the URL Pattern already accommodates both http & https. Thanks very much for those two direct image links as that was very helpful in exposing an aspect of the site's behaviour.

This worked for me; passed all tests from posts here.

Host Label: pixxxels
URL Pattern: ^https?:\/\/(?:s\d+\.)?pixxxels\.org\/image\/.+$
Search Pattern:
Code:
function(pageData, pageUrl) {
    var iUrl = pageData.match(/src=('|")(https?:\/\/s\d+\.pixxxels\.org\/.+?\.jpg)\1/);
    return iUrl ? {imgUrl: iUrl[2] + "?dl=1", status: "OK"} : {imgUrl: null, status: "ABORT"}
}
Super, glad I could help out! Big thanks for this new code, it works aces although it required a tiny fix - guess I know a little about this stuff after all. In the first line of the function there's a single quotation where it should be a double: src=("|") instead of src=('|"). So the whole thing becomes thus:

Host Label: pixxxels
URL Pattern: ^https?:\/\/(?:s\d+\.)?pixxxels\.org\/image\/.+$
Search Pattern:
Code:
function(pageData, pageUrl) {
    var iUrl = pageData.match(/src=("|")(https?:\/\/s\d+\.pixxxels\.org\/.+?\.jpg)\1/);
    return iUrl ? {imgUrl: iUrl[2] + "?dl=1", status: "OK"} : {imgUrl: null, status: "ABORT"}
}
Now it sucks away like Sasha Grey!

__________________

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
berangus is offline   Reply With Quote
The Following 9 Users Say Thank You to berangus For This Useful Post: