Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {"ALIEXPRESS-s":{"link":"^(?:\\w\\w\\.)?(aliexpress\\.(com|[a-z]{2})/(item/|(?:[^/?&]+[?&])*productIds=))(?:[\\w-]*?/)?(\\d+).*","url":": $[3]==='item/' ? `//${$[1]+$[4]}.html` : 'https://aliexpress.'+$[2]+'/aer-jsonapi/v1/bx/pdp/web/productData?productId='+($[4]?.length?$[4]:this.node.closest('[class^=\"product-snippet_ProductSnippet__container\"]').getAttribute('exp_product'))","res":":\nconst r = [];\n\nif($._[0] === '{'){\nconst data = JSON.parse($._).data;\nr.push([data?.skuInfo?.propertyList?.[0]?.values?.[0]?.imageMainUrl?.replace(/_\\d+x\\d+\\..+/,'')]);\ndata.gallery?.forEach(i=>r.push([i.videoUrl||i.imageUrl,data.description]));\n} else {\nlet json = $._.match(/Data\\s*=\\s*([^;]+)/)?.[1];\njson = json ? JSON.parse(json).imagePathList : [];\njson.forEach(i=>r.push([i,'']))\n}\ntry {\n const page = (new window.DOMParser()).parseFromString($._,'text/html');\n let imgs = Array.from(page.querySelectorAll('div[class^=\"gallery_Gallery__picture\"] > 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 const id = $[4];\n const review_json=JSON.parse($._.match(/\"reviews\":(\\[.+?\\]),\"resolveParams\"/)?.[1]||'{}');\n if(!review_json?.[0]){\n const x = new XMLHttpRequest;\n x.open('GET', 'https://feedback.aliexpress.com/pc/searchEvaluation.do?productId='+id+'&page=1&pageSize=50', false);\n x.send();\n JSON.parse(x.responseText).data.evaViewList.forEach(f=>{\n f.images.forEach(p => r.push([p,f.buyerFeedback]));\n });\n } else {\n review_json.forEach(i=>i.root?.images?.forEach(x=>r.push([x.url,i.root?.text])));\n }\n\n} catch (e) {}\n\nreturn r;","img":"^(?:([^/]+\\.ali(?:cdn|express-media)\\.com/(?:@\\w+/)?)(?:kf/)?(.+)_\\d+x\\w+\\.(?:jpe?g|png|webp)|(aliexpress\\.(?:com|[a-z]{2})/one-price\\?)bucketId=&debug=true&releaseId=).*","loop":2,"to":":\nif($[1])return $[1]+'#kf/ #'+$[2];\nconst n=this.node.closest('[class^=\"product-snippet_ProductSnippet__container\"]')?.getAttribute('exp_product');\nreturn n ? `https://${$[3]}productIds=${n}` : ''","note":"hababr + Imagus_fan (fix)\nhttps://www.reddit.com/r/imagus/comments/1fpk0ld/comment/lqf6hvc\nOLD\nhttps://www.reddit.com/r/imagus/comments/1fpk0ld/comment/lprt8m3\nhttps://www.reddit.com/r/imagus/comments/1fpk0ld/comment/loz4n99\nhttp://forum.ru-board.com/topic.cgi?forum=5&topic=50874&start=1700#4\n\n\n!!!\nКурсор желательно наводить на название товара. Данный фильтр показывает не только фото товара, но и фотографии в отзывах покупателей с текстами их отзывов - но только если пользователь авторизован и прошел проверку (слайдер) + в домене COM может не работать.\n==\nIt is desirable to hover the cursor over the name of the product. This sieve shows not only photos of the product, but also photos in customer reviews with the texts of their reviews - but only if the user is authorized and has passed the check (slider) + it may not work in the COM domain.\n\n\nПРИМЕРЫ / EXAMPLES\nhttps://aliexpress.ru/wholesale?SearchText=фонарик&g=y&page=1\nhttps://aliexpress.ru/category/202000005/home-appliances.html?spm=a2g2w.home.category.3.75df5931pbFi9W\nhttps://aliexpress.com/w/wholesale-Shockproof-Armor-Case.html\nhttps://www.aliexpress.com/w/wholesale-TV.html?SearchText=TV&catId=200002397"},"Alibaba":{"link":"^(?:[a-z-]+\\.)?(alibaba\\.com/)product-detail/.+[_-]+(\\d+)\\.html.*","url":": this.alibaba_base ? `https://www.${$[1]}event/app/mainAction/desc.htm?detailId=${$[2]}` : $[0]","res":":\nif($._[0]!=='{'&&!this.alibaba_base){\nthis.alibaba_base=JSON.parse($._.match(/<script type=\"application\\/ld\\+json\">([^<]+)/s)?.[1]||'[]').flatMap(i=>i.contentUrl?[[i.contentUrl,[i.name,i.description].filter(Boolean).join(' | ')]]:[]);\nreturn {loop:$[0]}\n}\nlet m=this.alibaba_base;\ndelete this.alibaba_base;\n$=JSON.parse($._).data.productHtmlDescription;\n$=new DOMParser().parseFromString($,'text/html');\n$=[...$.querySelectorAll('img[data-src]')].map(i=>[i.getAttribute('data-src')]);\nm=m.concat($)\nreturn [...new Map(m)]"}}
Advertisement
Add Comment
Please, Sign In to add comment