Baton34V
Advanced Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору Окончательная версия, наверное: Код: {"R_flickr.com_albums":{"link":"^flickr\\.com/photos/(?:[^/]+/albums/(\\d+)$|(\\d+)/([a-f0-9]+)/(\\d+)(?:/([\\w@]+)/([\\w:]+))?/$)","url":": $[2] ? 'https://api.flickr.com/services/rest?extras=url_h%2Curl_k%2Curl_o%2Curl_3k%2Curl_4k%2Curl_5k%2Curl_6k%2Cpage=0&photoset_id='+$[2]+'&format=json&method=flickr.photosets.getPhotos&api_key='+$[3]+'&per_page='+$[4]+($[5] ? '&viewerNSID='+$[5]+'&csrf='+$[6] : '')+'&nojsoncallback=1' : $[0]","res":":\nif($[2]) {\n let res=[];\n let jsn=JSON.parse($._);\n for (img of jsn.photoset.photo) {\n res.push([img.url_6k || img.url_5k || img.url_4k || img.url_3k || img.url_o || img.url_k || img.url_h, img.title]);\n }\n return res;\n}\nlet api=$._.match(/root.YUI_config.flickr.api.site_key = \"([^\"]+)\";/)[1];\nconsole.log(api);\nlet length=$._.match(/<span class=\\\"photo-counts\\\">(\\d+) photos?<\\/span>/)[1];\nconsole.log(length);\nlet vnsid2=$._.match(/class=\"gn-title you\"\\s+href=\"\\/photos\\/([^\\/]+)\\/\"\\s/);\nlet vnsid=vnsid2 ? vnsid2[1] : null;\nlet csrf2=$._.match(/root.auth = {\"signedIn\":true,\"csrf\":\"([^\"]+)/);\nlet csrf=csrf2? csrf2[1] : null;\nreturn api&&{loop:'https://www.flickr.com/photos/' + $[1] + '/' + api + '/' + length +'/'+(csrf ? vnsid+'/'+csrf+'/' : \"\")};\n","note":"https://www.flickr.com/photos/carolsgardenofphotos/albums"}} |
|