{"WILDBERRIES.ru":{"link":"^(?:global\\.)?wildberries\\.ru/(?:catalog/|product\\?card=)(\\d+)(?:/(detail\\.aspx|feedbacks)(\\S+)?)?","url":"data:,none?$1$2$3","res":":\nvar r = [];\nconst x = new XMLHttpRequest();\nconst cardInfoUrl = constructHostV2($[1], 'nm') + `/info/ru/card.json`;\nx.open('GET', cardInfoUrl, false);\nx.send();\nconst info = JSON.parse(x.responseText);\n\n// fetch item photos\n// skip when triggered by feedback links or elements\nif (($[2] == 'detail.aspx' || $[2] == null) && !$[3]?.includes('#Comments') && !this.TRG.className.includes('product-card__rating') && !this.TRG.className.includes('product-card__count')) {\n const folder = 1e4 * Math.floor(info.nm_id / 1e4);\n if (info.media.has_video) {\n r.push([`https://video.wbstatic.net/video/new/${folder}/${info.nm_id}.mp4`, info.imt_name]);\n }\n\n for (var i = 1; i <= info.media.photo_count; i++) {\nconsole.log(imageUrl(info.nm_id, 'big', i));\n r.push([imageUrl(info.nm_id, 'big', i), info.imt_name]);\n }\n}\n\n// fetch feedback photos page by page\nx.open('GET', `${feedbackDomain(info.imt_id)}/feedbacks/v1/${info.imt_id}`, false);\nx.send();\nconst resp = JSON.parse(x.responseText);\nresp.feedbacks?.forEach(f => f.photo?.forEach(p => r.push([\n urlFeedbackPhoto(p),\n '⭐' + f.productValuation + ' | ' + f.text + ' | ' + f.createdDate.substring(0, 10)\n])));\n\nif (r.length == 0) r = false;\n\nreturn r;\n\n\nfunction urlFeedbackPhoto(e) {\n const n = parseInt(e, 10);\n return `${constructHostV2(n, \"feedback\")}/photos/fs.webp`\n}\n\nfunction feedbackDomain(t) {\n const e = crc16Arc(t) % 100 >= 50 ? \"2\" : \"1\";\n return `https://feedbacks${e}.wb.ru`;\n}\n\nfunction imageUrl(id, size, number) {\n var i = parseInt(id, 10);\n var ext = \"jpg\";\n var url = constructHostV2(i);\n return \"\".concat(url, \"/images/\").concat(size, \"/\").concat(null != number ? number : 1, \".\").concat(ext)\n}\n\nfunction volHostV2(t) {\n return t >= 0 && t <= 143 ? \"https://basket-01.wb.ru/\"\n : t >= 144 && t <= 287 ? \"https://basket-02.wb.ru/\"\n : t >= 288 && t <= 431 ? \"https://basket-03.wb.ru/\"\n : t >= 432 && t <= 719 ? \"https://basket-04.wb.ru/\"\n : t >= 720 && t <= 1007 ? \"https://basket-05.wb.ru/\"\n : t >= 1008 && t <= 1061 ? \"https://basket-06.wb.ru/\"\n : t >= 1062 && t <= 1115 ? \"https://basket-07.wb.ru/\"\n : t >= 1116 && t <= 1169 ? \"https://basket-08.wb.ru/\"\n : t >= 1170 && t <= 1313 ? \"https://basket-09.wb.ru/\"\n : t >= 1314 && t <= 1601 ? \"https://basket-10.wb.ru/\"\n : t >= 1602 && t <= 1655 ? \"https://basket-11.wb.ru/\"\n : \"https://basket-12.wb.ru/\";\n}\n\nfunction volFeedbackHost(e) {\n let t;\n switch (!0) {\n case e >= 0 && e <= 431: t = \"01\"; break;\n case e >= 432 && e <= 863: t = \"02\"; break;\n case e >= 864 && e <= 1199: t = \"03\"; break;\n case e >= 1200 && e <= 1535: t = \"04\"; break;\n default: t = \"05\"\n }\n return `//feedback${t}.wb.ru/`\n}\n\nfunction constructHostV2(id, t = \"nm\") {\n const e = parseInt(id, 10),\n n = ~~(e / 1e5),\n r = ~~(e / 1e3);\n return `${\"nm\" === t ? volHostV2(n) : volFeedbackHost(n)}vol${n}/part${r}/${e}`;\n}\n\nfunction numToUint8Array(r) {\n const t = new Uint8Array(8);\n for (let n = 0; n < 8; n++)\n t[n] = r % 256,\n r = Math.floor(r / 256);\n return t\n}\n\nfunction crc16Arc(r) {\n const t = numToUint8Array(r);\n let n = 0;\n for (let r = 0; r < t.length; r++) {\n n ^= t[r];\n for (let r = 0; r < 8; r++)\n (1 & n) > 0 ? n = n >> 1 ^ 40961 : n >>= 1\n }\n return n\n}\n","img":"^(feedback\\d+\\.wb\\.ru/.+/photos)/ms.webp","ci":2,"to":"$1/fs.webp","note":"hababr + Baton34V (fix)\nhttp://forum.ru-board.com/topic.cgi?forum=5&topic=50874&start=2360#14\nOLD\nhttp://forum.ru-board.com/topic.cgi?forum=5&topic=50874&start=2120#14\nhttp://forum.ru-board.com/topic.cgi?forum=5&topic=50874&start=2000#17\n\n!!!\nФильтр показывает видео (если есть) + оценку + фото и тексты отзывов покупателей.\n\nПРИМЕРЫ\nhttps://www.wildberries.ru/catalog/igrushki/igrovye-nabory\nhttps://www.wildberries.ru/catalog/0/search.aspx?search=футболка%20женская\nhttps://www.wildberries.ru/catalog/0/search.aspx?search=мини%20пылесос"}} |