Advertisement
Guest User

Untitled

a guest
May 13th, 2025
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.25 KB | None | 0 0
  1. {"Inkbunny-x-p":{"link":"^(inkbunny\\.net)\\/s\\/\\d+","url":": (location.hostname===$[1] ? 'data:,' : '')+$[0]","res":":\n\nlet highdefinition = true;\n\nlet debug = false;\n\nif($.base.startsWith('data:')){\nconst x=new XMLHttpRequest();\nx.open('Get',$[0],false);\nx.send();\n$._=x.responseText;\n}\n\nlet singleitemmatch=$._.match(/submission-standarddefURL.*?(https:\\/\\/\\w\\w\\.ib\\.metapix\\.net\\/files\\/screen\\/\\d+\\/\\d+[^'\\\"]*?)['\\\"]/);\nlet galleryitemsiterator=$._.matchAll(/<a.*?href=['\\\"][^'\\\"]*?pictop['\\\"].*?src=['\\\"]([^'\\\"]*)['\\\"]/g);\nlet titlematch = $._.match(/<meta name=\"og:title\" content=\"(.+)? &lt;/);\n\nlet galleryitemsmatch = Array.from(galleryitemsiterator);\n\nif(debug) console.log($._);\nif(debug) console.log(singleitemmatch);\nif(debug) console.log(galleryitemsmatch);\nif(debug) console.log(titlematch);\n\nlet returnval;\nlet toptext = titlematch[1];\n\n\n//If no single image found, try special cases\nif(singleitemmatch == null) {\n\n //MP3s and Video\n let mp3match = $._.match(/jwplayer-file.*?value=['\\\"](.*?)['\\\"]/);\n if(mp3match != null) {\n if(debug) console.log(\"Video/MP3 Media Context.\");\n let mp3medialink = mp3match[1];\n\n returnval = [\n [mp3medialink, toptext]\n ];\n return returnval;\n }\n\n //Image from pool case\n let poolmatch = $._.match(/src=['\\\"](https:\\/\\/\\w\\w\\.ib\\.metapix\\.net\\/files\\/screen\\/\\d+\\/.*?)['\\\"]/);\n if(poolmatch != null) {\n if(debug) console.log(\"Pool Image Media Context.\");\n let poolmedialink = poolmatch[1];\n\n returnval = [\n [poolmedialink, toptext]\n ];\n return returnval;\n }\n\n //Final try for general thumbnail. Happens with literature posts as an example.\n let generalthumbmatch = $._.match(/<meta content=['\\\"](.*?)['\\\"] property=['\\\"]og:image['\\\"]>/);\n if(generalthumbmatch != null) {\n if(debug) console.log(\"General Thumbnail Media Context.\");\n let generalthumblink = generalthumbmatch[1];\n\n returnval = [\n [generalthumblink, toptext]\n ];\n return returnval;\n }\n \n console.error(\"No known media context found.\")\n return;\n}\n\n\nlet singleimagelink = singleitemmatch[1];\n\n//Split cases where gallery thumbnails are found or default to a single item\nif(galleryitemsmatch.length == 0) {\n //No gallery found, transform URL and display based on high def preference and return\n if(debug) console.log(\"Standard Image Media Context.\");\n\n if(highdefinition) {\n singleimagelink = singleimagelink.replace(\"/screen/\", \"/full/\");\n }\n\n returnval = [\n [singleimagelink, toptext]\n ];\n}\nelse {\n if(debug) console.log(\"Gallery Media Context.\");\n\n returnval = [];\n\n //Probe for filetypes in main image to guess gallery image filetypes\n let filetype = singleimagelink.match(/(.(jpg|jpeg|png|webp|gif))/)[1];\n\n let replaceurltext = highdefinition ? \"/files/full/\" : \"/files/screen/\";\n for(let i=0; i<galleryitemsmatch.length; i++) {\n let currentthumburl = galleryitemsmatch[i][1];\n currentthumburl = currentthumburl.replace(\"/thumbnails/medium/\", replaceurltext);\n currentthumburl = currentthumburl.replace(\"_noncustom\", \"\");\n currentthumburl = [currentthumburl.replace(\".jpg\", filetype), currentthumburl, currentthumburl.replace(\".jpg\", \".jpeg\"), currentthumburl.replace(\".jpg\", \".png\"), currentthumburl.replace(\".jpg\", \".webp\"), currentthumburl.replace(\".jpg\", \".gif\")];\n returnval.push([currentthumburl, toptext])\n }\n}\n\nif(debug) console.log(\"Final Return Value\", returnval);\nreturn returnval;","note":"imqswt\nhttps://www.reddit.com/r/imagus/comments/z0zyox/comment/l7ni13x\nOLD\nhttps://www.reddit.com/r/imagus/comments/vvxi32/comment/ifn4bvt\nhttps://www.reddit.com/r/imagus/comments/7268xq/anybody_have_inkbunny_imagus_sieve_data/\n\n!!!\nО проблемах с доступом из РФ:\nhttps://forum.ru-board.com/topic.cgi?forum=5&topic=50874&start=2620#9\n\n\nEXAMPLES\nhttps://inkbunny.net\nhttps://inkbunny.net/gallery/Caitsith511/1/868d60410a\nhttps://inkbunny.net/submissionsviewall.php?rid=c6f18f24ee&mode=pool&pool_id=76632&page=1"}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement