{"R_AliExpress":{"link":"(?:\\w\\w|www)?\\.?aliexpress\\.(com|ru)/item/(?:[\\w-]*?/)?(\\d+)\\.html","url":"aliexpress.$1/item/$2.html","res":":\nconst r = [];\nconst oldStyle=$._.match('data: ({.+}),');\nif (oldStyle) {\n const jsn=JSON.parse(oldStyle[1]);\n for (const url of jsn.imageModule.imagePathList) {\n r.push([url, '']);\n }\n}\ntry {\n const page = (new window.DOMParser()).parseFromString($._,'text/html');\n let imgs = Array.from(page.querySelectorAll('div[class^=\"gallery_Gallery__picture\"] > img, div[class^=\"gallery_Gallery__video\"] > video'));\n if (imgs.length<1) {\n imgs = Array.from(page.querySelectorAll('div[class^=\"Product_GalleryBarItem\"] > img, div[class^=\"ProductDescription-module_wrapper\"] img'));\n }\n for (const i of imgs) {\n // filter out images inside links\n if (i.parentElement.nodeName === 'A') continue;\n let url = i.attributes.src.value.replace(/_\\d+x\\d+\\.(jpe?g|png)$/, '');\n url = url.replace('`','');\n r.push([url, '']);\n }\n\n const id = $[2];\n const x = new XMLHttpRequest;\n x.open('POST', 'https://aliexpress.ru/aer-api/v1/review/filters?product_id=' + id, false);\n x.send('{\"productId\":' + id + ',\"starFilter\":\"all\",\"sort\":\"default\",\"page\":1,\"pageSize\":1000,\"translate\":true,\"local\":false}');\n JSON.parse(x.responseText).reviewInfo.reviews.forEach(f => {\n if (f.additionalReview && f.additionalReview.gallery && f.additionalReview.gallery.length) {\n f.text += ' | 💬 ' + f.additionalReview.text;\n f.gallery = f.gallery.concat(f.additionalReview.gallery);\n }\n f.gallery.forEach(p => r.push([p, f.rating + '⭐ | ' + f.text]))\n });\n\n} catch (e) {}\n\nreturn r;","img":"(.*\\.alicdn\\.com/.+)_\\d+x\\d+\\.(jpe?g|png)","to":"$1","note":"hababr\nhttp://forum.ru-board.com/topic.cgi?forum=5&topic=48222&start=3600#20\nOLD\nhttp://forum.ru-board.com/topic.cgi?forum=5&topic=48222&start=3280#9\nhttp://forum.ru-board.com/topic.cgi?forum=5&topic=48222&start=3060#18\nhttp://forum.ru-board.com/topic.cgi?forum=5&topic=48222&start=3060#10\nhttp://forum.ru-board.com/topic.cgi?forum=5&topic=48222&start=2020#11\nhttp://forum.ru-board.com/topic.cgi?forum=5&topic=48222&start=960#5\n\n\n!!!\nКурсор рекомендуется наводить на название товара.\n+\nНе только фото товара, но и фотографии в отзывах покупателей с текстами их отзывов!\n==\nThe cursor is recommended to hover over the product name.\n+\nNot only product photos, but also photos in customer reviews with the texts of their reviews!"}} |