template is downloading each size (*_k.jpg, *_b.jpg, *_h.jpg, *_o.jpg) available
https://www.flickr.com/photos/84773061@N08/
200 pictures in photostream, 800 pictures downloaded
https://www.flickr.com/photos/144881785@N08/
13 pictures in photostream, 46 pictures downloaded
flickr photostream template downloading all sizes of each picture
-
- Posts: 35
- Joined: 29 Mar 2019, 21:17
-
- Site Admin
- Posts: 2077
- Joined: 02 Mar 2009, 17:02
Re: flickr photostream template downloading all sizes of each picture
Yes, currently I see no way of filtering them automatically. Some photostreams have all sizes, some have only small pics and if I leave only big pics in the template, then some photostreams will produce no downloads at all. So I'm open for any suggestions on this matter.
-
- Posts: 35
- Joined: 29 Mar 2019, 21:17
Re: flickr photostream template downloading all sizes of each picture
I also use Image Host Grabber through my browser (Waterfox or any Fox variant) and it will grab the largest size available however it will only grab from the current page and not the entire photostream like EPF will. Could that be of help?
https://imagehostgrabber.com/forum/index.php
flickr Host File for IHG
URL Pattern:
Search Pattern:
(I don't know how any of this works (EPF or IHG). It all seems like magic to me and I'm just glad it works and I just go on my merry way downloading pictures.)
https://imagehostgrabber.com/forum/index.php
flickr Host File for IHG
URL Pattern:
Code: Select all
^https?:\/\/([^/]+\.)?flickr\.com\/photos\/[^/]+\/\d+(\/in\/explore-[^/]+)?(((?!\/#).)*)$
Code: Select all
function(pageData, pageUrl) {
var retVal = {imgUrl: null, fileName: null, status: "ABORT"};
var sizes = pageData.match(/"sizes":{.+?}}/);
if (sizes) {
var url = sizes[0].match(/"url":"[^"]+/ig);
if (url) {
var iUrl = url[url.length - 1].replace(/\\/g, '').substring(7);
retVal.imgUrl = iUrl;
retVal.status = "OK";
//
// Select the type of filename by setting the value of nameType:
// 1: image title
// 2: name on the host + image title
// 3: image title + name on the host
// else: name on the host
const nameType = 2; // <-- edit this number; default: 2
//
if (nameType == 1 || nameType == 2 || nameType == 3) {
var iName = (pageData.match(/property\s*=\s*('|")og:title\1\s*content\s*=\s*('|")(.*?)\2/i)||[])[3];
if (iName) { // exists and is not empty
iName = iName.replace(/"/g, '\'');
iName = iName.replace(/[\\/|]/g, ' '); // replace backslash, slash, pipe by space
iName = iName.replace(/[:*?"<>]/g, ''); // remove invalid characters
iName = iName.replace(/\s+/g, ' '); // compress whitespace
iName = iName.trim(); // remove leading and trailing whitespaces
iName = iName.replace(/\s/g, '_'); // replace all whitespaces by underscores
if (nameType == 2 || nameType == 3) {
let filename = iUrl.split('?')[0].split('/').pop();
let fnparts = filename.match(/([^/]+?)(\.([^./]+))?$/)||[];
let basefn = fnparts[1]||'';
let dotext = fnparts[2]||'';
if (nameType == 2) iName = basefn + '_' + iName + dotext;
if (nameType == 3) iName = iName + '_' + basefn + dotext;
}
}
}
retVal.fileName = iName;
}
}
return retVal;
}
-
- Site Admin
- Posts: 2077
- Joined: 02 Mar 2009, 17:02
Re: flickr photostream template downloading all sizes of each picture
Well, they can cycle through all available sizes and select the biggest one for every image, while EPF unfortunately cannot :( It can just grab them all with the current way flickr generates their pages. Should they change the way they do it - maybe EPF will be able to parse out only the biggest image size available.