Baton34V
Advanced Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору kenko2 Цитата: Вот еще что у нас в статусе не работает/требует "апгрейда": | Код: {"R_darudar.org":{"img":"^(static\\.daru-dar\\.org/s)\\d+(/[0-9a-f]{2}\\.[0-9a-f]{2}/[0-9a-f]{2}/[0-9a-f]{2}/[0-9a-f]{2}/[0-9a-f]+\\.jpe?g)$","ci":2,"to":"$11024$2","note":"by Rodny\n\nlink: ^http://darudar.org/gift/\\d+/$"}} | вместо двух R_badfon.ru|goodfon.ru и R_goodfon.ru один Код: {"R_badfon.ru|goodfon.ru":{"link":"(?:avto\\.)?(?:bad|good)fon\\.ru/(?:[^/]+/)?(?:wallpaper/.+\\.html|download\\.php\\?id=\\d+&rash=\\d+x\\d+|download/[^/]+/\\d+x\\d+/?)$","res":":\nlet res;\nlet mtch=$._.match(/<meta property=\"og:image\" content=\"(https?:\\/\\/img\\d\\.(?:good|bad)fon\\.ru\\/)wallpaper\\/big(\\/\\w\\/\\w+\\/.+\\.jpe?g)\"[\\s\\S]+<meta property=\"og:description\" content=\"автор:[^:]+: (\\d+x\\d+)/);\nif (mtch!=null) {\n res=mtch[1]+'original/'+mtch[3]+mtch[2];\n}\nelse {\n mtch=$._.match(/<a href=\"([^\"]+)\" id=\"/);\n res=mtch[1];\n}\nreturn res;","note":"http://www.goodfon.ru/wallpaper/graffiti-poezd-vagon.html\nhttp://www.badfon.ru/wallpaper/section8-voyna-roboty-strelba.html"}} | Добавлено: kenko2 Цитата: Например здесь, при наведении на описание товара: | у товаров с одной фоткой такое было. Исправил: Код: {"R_Ozon.ru":{"link":"(?:www\\.)?ozon\\.ru/(?:product/[\\w-]+|context/detail/id/\\d+)/.*","res":":\n// debugger;\nconst r = []\ntry {\n const title = (/<title.*?>(.+?)<\\/title>/.exec($._) || [])[1];\n\n // product images\n const regexp = new RegExp('<div data-index=\"\\\\d+\"[\\\\s\\\\S]+?<img loading=\"lazy\" src=\"(.+?)\"', 'gi');\n let m;\n while ((m = regexp.exec($._)) !== null) {\n let url = m[1];\n url = url.replace(/\\/\\w+50\\//, '/');\n r.push([url, title]);\n }\n\n // fallback image\n if (!r.length) {\n const url = ($._.match(/<meta.+data-hid=\"property::og:image\" property=\"og:image\" content=\"(.+?)\"/) || [])[1];\n if (url) r.push([url, title]);\n }\n // reviews images\n const path = ($.base.match(/https?:\\/\\/(www\\.)?ozon.ru(\\/.+?)(\\?|$)/) || [])[2];\n const x = new XMLHttpRequest;\n x.open('POST', 'https://www.ozon.ru/api/composer-api.bx/widget/json/v2', false);\n x.send(JSON.stringify({\n \"asyncData\": btoa(JSON.stringify({\n \"url\": path,\n \"ci\": {\n \"id\": 1,\n \"name\": \"listReviewsDesktop\",\n \"vertical\": \"rpProduct\",\n \"version\": 1,\n \"params\":\n [\n { \"name\": \"paginationType\", \"text\": \"loadMoreButton\" },\n { \"name\": \"sortingType\", \"text\": \"created_at_desc\" },\n { \"name\": \"paramPageSize\", \"int\": 100 },\n { \"name\": \"paramVariantModeEnabled\" },\n { \"name\": \"videoAllowed\", \"bool\": true }\n ]\n }\n })),\n \"extraBody\": {},\n \"url\": path + \"?tab=reviews&reviewsFilters=eyJ3aXRoUGhvdG9zIjp0cnVlfQ&sort=created_at_desc\",\n \"componentName\": \"listReviewsDesktop\"\n }));\n\n JSON.parse(x.responseText).state.reviews.forEach(f => {\n const c = f.content;\n c.photos.forEach(p => {\n const text = [c.score + '⭐'];\n if (c.comment) text.push(c.comment);\n if (c.positive) text.push('👍🏻 ' + c.positive);\n if (c.negative) text.push('👎🏻 ' + c.negative);\n r.push([p.url, text.join(' | ')]);\n });\n });\n} catch (e) {}\nreturn r;","img":"(cdn\\d\\.ozone\\.ru/s3/(rp-photo-\\d|multimedia-\\w)/)wc\\d+/(.+\\.jpe?g)","to":"$1$3","note":"by hababr\nhttp://forum.ru-board.com/topic.cgi?forum=5&topic=48222&start=3600#11\nOLD\nby Baton34V\nhttp://forum.ru-board.com/topic.cgi?forum=5&topic=48222&start=2920#20\nhttp://forum.ru-board.com/topic.cgi?forum=5&topic=48222&start=2900#3\n\n!!!\nПодгружает не только фото товара, но и фото+отзывы, сделанные покупателями."}} | Добавлено: Код: {"R_PlayGround":{"img":"^(i\\.playground\\.ru/i/(?:pix|screenshot)/\\d+/[\\w_]+\\.\\w+)\\?\\d+x\\d+$","to":"$1","note":"ПРИМЕРЫ / EXAMPLES:\nhttp://www.playground.ru/gallery/star_wars_the_old_republic/\nhttp://pix.playground.ru/resident_evil_revelations_2/\nhttp://pix.playground.ru/mass_effect_3/"}} | Добавлено: Код: {"R_tophotels.ru":{"link":"^tophotels\\.ru/hotel/\\w+/media/gallery$","res":":\nlet i = $._.indexOf('<div class=\"hotelPhoto-list__block\"');\nif(i<0) { return null; }\nlet t = $._.indexOf('</section>', i);\nif(t<0) { return null; }\nlet data=$._.substring(i,t);\nlet res = [];\nlet re = /href=\"([^\"]+)\"/gi\nlet a = re.exec(data);\nwhile(a) {\n res.push([a[1]]);\n a = re.exec(data);\n}\nreturn res;","img":"^(tophotels\\.ru/icache/)((?:hotel|user)_photos/)([0-9/]+)(\\d+)_\\d+x\\d+\\.jpg","to":"$1$2$3$4_1140x820.jpg","note":"by Rodny\n\nПРИМЕРЫ:\nhttps://tophotels.ru/catalog/hotel/83?sort=5"}} |
|