Перейти из форума на сайт.

НовостиФайловые архивы
ПоискАктивные темыТоп лист
ПравилаКто в on-line?
Вход Забыли пароль? Первый раз на этом сайте? Регистрация
Компьютерный форум Ru.Board » Компьютеры » Программы » Imagus | Viewhance (Часть 1)

Модерирует : gyra, Maz

Maz (01-02-2022 08:09): Imagus | Viewhance (Часть 2)  Версия для печати • ПодписатьсяДобавить в закладки
На первую страницук этому сообщениюк последнему сообщению

   

gpl2731

Junior Member
Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору

Код:
{"R_brazzers|realitykings|mofos|digitalplayground|twistys":{"link":"(?:brazzers|rk|realitykings|mofos|digitalplayground|twistys)\\.com\\/(?:video|scene)\\/(\\d+)\\/[^#]+(?:#([\\da-zA-z=]+))?","res":":\nconst max_resolution = 1080;\n\nif ($[2]) return decodeURIComponent(atob($[2]));\n\nconst url_selector = $[0].split('/').slice(3).join('/');\nconst a_elem = document.querySelector(`a[href*=\"${url_selector}\"]`);\nconst vid_id = $[1];\nconst m = /jwt\":\"([^\"]+)/g.exec($._);\nconst token = m ? m[1] : null;\nif (!token) return;\n\nasync function getTrailer(vid_id, token, a_elem) {\n  const url = `https://site-api.project1service.com/v2/releases/${vid_id}`;\n\n  fetch(url, { headers: { instance: token } })\n    .then(response => response.json())\n    .then(data => {\n      let trailers = data.result.children.find(\n        c => c.type.toLowerCase() === 'trailer'\n      )?.videos?.full?.files;\n\n      if (!trailers) {\n        trailers = data?.result?.videos?.mediabook?.files;\n      }\n\n      if (!trailers) return;\n\n      const resolutions = Object.keys(trailers)\n        .map(a => ({ key: a, res: a.replace(/\\D/g, '') }))\n        .map(a => ({ key: a.key, res: Number(a.res) }))\n        .filter(a => a.res <= max_resolution)\n        .sort((a, b) => b.res - a.res);\n\n      const trailer = trailers[resolutions[0].key]?.urls?.view;\n      if (trailer) {\n        a_elem.href += `#${btoa(encodeURIComponent(trailer))}`;\n        a_elem.style.cssText += 'border-bottom: 3px solid #ebff00; !important';\n      }\n    });\n}\n\ngetTrailer(vid_id, token, a_elem);\nreturn;","note":"Change max_resolution to your max preferred resolution.\ne.g.\n1080 will result in 1080p video\n900 will result in 720p video\n\nby gpl2731\nhttp://forum.ru-board.com/topic.cgi?forum=5&topic=48222&start=3600#18\n\n!!!\nВ некоторых случаях курсор нужно пробовать наводить на клип несколько раз. С первого раза не всегда срабатывает / In some cases, the cursor needs to be tried to hover over the clip several times. It doesn't always work the first time.\n\n\nПРИМЕРЫ / EXAMPLES:\nhttps://www.brazzers.com/videos\nhttps://www.realitykings.com/scenes"},"R_vixen|tushy|tushyraw|blacked|slayed|deeper2":{"link":"(vixen|tushy|tushyraw|blacked|blackedraw|slayed|deeper)\\.com/videos/[^#]+(?:#(.+))?","res":":\nconst max_resolution = 1080;\n\nif ($[2]) return decodeURIComponent(atob($[2]));\n\nconst m = /videoTokenId\":\"(\\d+)/g.exec($._);\nconst vidId = m ? m[1] : null;\nif (!vidId) return;\n\nconst url_selector = $[0].split('/').slice(3).join('/');\nconst a_elems = document.querySelectorAll(`a[href*=\"${url_selector}\"]`);\n\nasync function getTrailer(vidId, a_elems) {\n  const url = `https://www.${$[1]}.com/graphql`;\n\n  fetch(url, {\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json',\n    },\n    body: `{\"operationName\":\"getToken\",\"variables\":{\"videoId\":\"${vidId}\",\"device\":\"trailer\"},\"query\":\"query getToken($videoId: ID!, $device: Device!) {generateVideoToken(input: {videoId: $videoId, device: $device}) {p270 {token cdn __typename}p360 {token cdn __typename}p480 {token cdn __typename}p480l {token cdn __typename}p720 {token cdn __typename}p1080 {token cdn __typename}p2160 {token cdn __typename}hls {token cdn __typename}__typename}}\"}`,\n  })\n    .then(response => response.json())\n    .then(data => {\n      const trailers = data?.data?.generateVideoToken;\n\n      if (!trailers) return;\n\n      const resolutions = Object.keys(trailers)\n        .map(a => ({ key: a, res: a.replace(/\\D/g, '') }))\n        .map(a => ({ key: a.key, res: Number(a.res) }))\n        .filter(a => a.res <= max_resolution)\n        .sort((a, b) => b.res - a.res);\n\n      const trailer = trailers[resolutions[0].key].token;\n      if (trailer) {\n        [...a_elems].forEach(a_elem => {\n          a_elem.href += `#${btoa(encodeURIComponent(trailer))}`;\n          if (a_elem.innerText.length > 0) {\n            a_elem.innerText =\n              String.fromCodePoint(parseInt('25B6', 16)) +\n              ' ' +\n              a_elem.innerText;\n          }\n          if (location.hostname.includes($[1])) {\n            if (!a_elem.getAttribute('data-test-component')) {\n              a_elem.parentElement.style.cssText +=\n                'border-bottom: 3px solid #ebff00; !important';\n            }\n            if (\n              a_elem.parentElement.getAttribute('data-test-component') ==\n              'FeaturedVideoListItem'\n            ) {\n              a_elem.childNodes[0].style.cssText +=\n                'border-top: 3px solid #ebff00; !important';\n            }\n          }\n        });\n      }\n    });\n}\n\ngetTrailer(vidId, a_elems);\nreturn;\n","note":"Change max_resolution to your max preferred resolution.\ne.g.\n1080 will result in 1080p video\n900 will result in 720p video\n\nby gpl2731\nhttp://forum.ru-board.com/topic.cgi?forum=5&topic=48222&start=3640#8\nOLD\nhttp://forum.ru-board.com/topic.cgi?forum=5&topic=48222&start=3620#6\n\n!!!\nМожет понадобиться наводить курсор два раза / You may need to hover the cursor twice"}}

 
Updated these two. The first one works on 2 more sites (twistys and digitalplayground).
You can now change the max_resolution to whatever you want in both.

Всего записей: 52 | Зарегистр. 26-09-2021 | Отправлено: 11:43 04-10-2021 | Исправлено: gpl2731, 11:47 04-10-2021
   

На первую страницук этому сообщениюк последнему сообщению

Компьютерный форум Ru.Board » Компьютеры » Программы » Imagus | Viewhance (Часть 1)
Maz (01-02-2022 08:09): Imagus | Viewhance (Часть 2)


Реклама на форуме Ru.Board.

Powered by Ikonboard "v2.1.7b" © 2000 Ikonboard.com
Modified by Ru.B0ard
© Ru.B0ard 2000-2024

BitCoin: 1NGG1chHtUvrtEqjeerQCKDMUi6S6CG4iC

Рейтинг.ru