{"R_PornBox.com":{"link":"^pornbox\\.com/application/watch-page/(\\d+)","url":"pornbox.com/contents/$1","res":":\nmax_resolution = 1080;\n\nlet medias\ntry { medias = JSON.parse($._)?.medias || []; } catch (e) { return; }\nconst mediaId = medias.find(a => a.title === \"Trailer\")?.media_id;\nif (!mediaId) return;\n\nconst req = new XMLHttpRequest();\nreq.open('GET', `https://pornbox.com/media/${mediaId}/stream`, false);\nreq.send();\nif (req.status !== 200) return;\n\nlet streams;\ntry { streams = JSON.parse(req.responseText).qualities; } catch (e) { return; }\n\nconst res_map = { '1080p': 1080, hd: 720, vga: 480, web: 240 };\nconst trailers = streams\n .map(a => ({ res: res_map[a.quality], url: a.src }))\n .filter(a => a.res <= max_resolution)\n .sort((a, b) => a.res - b.res);\n\nreturn trailers.pop()?.url || null;\n","note":"Change max_resolution to your max preferred resolution.\ne.g.\n1080 will result in 1080p video\n900 will result in 720p video"},"R_analvids.com":{"link":"analvids.com/watch/\\d+/.+","res":":\nmax_resolution = 1080;\n\nconst textObj = $._.match(/\"qualities\":(?<clips>\\[.+?\\])/i)?.groups?.clips;\nif (!textObj) return;\n\nconst res_map = {'1080p': 1080, hd: 720, vga: 480, web: 240};\nconst trailers = JSON.parse(textObj)\n .map(a => ({ res: res_map[a.quality], url: a.src }))\n .filter(a => a.res <= max_resolution)\n .sort((a, b) => a.res - b.res);\n\nreturn trailers.pop()?.url || null;\n","note":"Change max_resolution to your max preferred resolution.\ne.g.\n1080 will result in 1080p video\n900 will result in 720p video"},"R_pornworld.com_trailers":{"link":"^pornworld.com/watch/\\d+/.+","res":":\nconst max_resolution = 1080;\n\nconst re = /source src=\"(?<url>.+?mp4.*?)\" size=\\\"(?<res>\\d+)\"/g\nconst mp4s = Array.from($._.matchAll(re))\n .map(a => ({ res: Number(a.groups.res), url: a.groups.url }))\n .filter(a => a.res <= max_resolution)\n .sort((a, b) => a.res - b.res);\n\nreturn mp4s.pop()?.url || null;\n","note":"Change max_resolution to your max preferred resolution.\ne.g.\n1080 will result in 1080p video\n900 will result in 720p video"}} |