Sleazy Fork is available in English.

542372.com免费看

try to take over the world!

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください。
  1. // ==UserScript==
  2. // @name 542372.com免费看
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1.1
  5. // @description try to take over the world!
  6. // @author You
  7. // @match https://*.542372.com:*/*
  8. // @match https://*.542969.com:*/*
  9. // @match https://*.543786.com:*/*
  10. // @match https://*.542732.com:*/*
  11. // @match https://*.544979.com:*/*
  12. // @icon https://www.google.com/s2/favicons?sz=64&domain=543786.com
  13. // @grant none
  14. // ==/UserScript==
  15.  
  16. (function () {
  17. 'use strict';
  18. function decode(text) {
  19. let secret = new fernet.Secret("NyGRG56A8i5J2JMqh7da83r2MMfgbM7Ppw1aCF8YnAY=");
  20. var token = new fernet.Token({
  21. secret: secret,
  22. token: text,
  23. ttl: 0
  24. })
  25. return token.decode();
  26. }
  27.  
  28. function getVideoId(url_path) {
  29. let videoId = url_path.split("/")[2];
  30. return videoId;
  31. }
  32.  
  33. function playUrl(videoId, play_url, config) {
  34. new window.DPlayer({
  35. element: document.getElementById(`myVideoPlayer_${videoId}`),
  36. video: {
  37. type: "auto",
  38. url: play_url,
  39. pic: ""
  40. },
  41. pluginOptions: {
  42. hls: {
  43. maxMaxBufferLength: 10
  44. }
  45. },
  46. ...config.defaultConfig
  47. })
  48. }
  49.  
  50.  
  51. function after(videoId,download_url,play_url_path,config){
  52. document.querySelector("#root > div > div:nth-child(7) > div:nth-child(4) > div:nth-child(2)").remove();
  53. document.querySelector("#root > div > div:nth-child(7) > div:nth-child(4)").innerHTML = `<a class="sc-bkkeKt sc-dJjYzT iETJJG ciOzeC" style="background: rgb(70, 164, 180);width="31%";height="36px" " href="${download_url}">下载</a>`
  54.  
  55. document.querySelector("#root > div > div:nth-child(7) > div:nth-child(1) > div:nth-child(4) > div:nth-child(2) > div:nth-child(2)").addEventListener("click", () => {
  56. let video_host2 = config.video_play_url_list[1].url[0]
  57. let play_url = "https://" + video_host2 + play_url_path;
  58. playUrl(videoId, play_url, config)
  59. })
  60. document.querySelector("#root > div > div:nth-child(7) > div:nth-child(1) > div:nth-child(4) > div:nth-child(2) > div:nth-child(3)").addEventListener("click", () => {
  61. let video_host2 = config.video_play_url_list[2].url[0]
  62. let play_url = "https://" + video_host2 + play_url_path;
  63. playUrl(videoId, play_url, config)
  64. })
  65. }
  66.  
  67. async function main() {
  68. //document.querySelector("#root > div> div:nth-child(2)").innerHTML = ""
  69. //document.querySelector("#root > div> div:nth-child(5)").innerHTML = ""
  70. //document.querySelector("#root > div> div:nth-child(6)").innerHTML = ""
  71. //document.querySelector("#root > div> div:nth-child(9)").innerHTML = ""
  72. //document.querySelector("#root > div > div:nth-child(7) > div:nth-child(2)").innerHTML = ""
  73. let config = JSON.parse(decode(window.CONFIG))
  74. let api_host = config.api_url
  75. let videoId = getVideoId(window.location.pathname)
  76. let api_path = "/api/vod/video/" + videoId + "?site_id=8&channel_id=531"
  77. let url = "https://" + api_host + api_path
  78. let res = await fetch(url)
  79. let data = await res.json()
  80. let res_json = decode(data["x-data"])
  81. let resObj = JSON.parse(res_json)
  82. let play_url_path = resObj.data.play_url;
  83. let down_url_path = resObj.data.down_url;
  84. let video_host1 = config.video_play_url_list[0].url[0]
  85. let video_download_host1 = config.video_download_url[0]
  86. let play_url = "https://" + video_host1 + play_url_path;
  87. let download_url = "https://" + video_download_host1 + down_url_path;
  88. //let play_url = "https://" + window.play_host + resObj.data.play_url;
  89. // let download_url = "https://" + window.play_host + resObj.data.down_url;
  90. console.log(play_url)
  91.  
  92. if (window.DPlayer) {
  93. playUrl(videoId, play_url, config)
  94. after(videoId,download_url,play_url_path,config)
  95. } else {
  96. setTimeout(() => {
  97. playUrl(videoId, play_url, config)
  98. after(videoId,download_url,play_url_path,config)
  99. }, 200)
  100. }
  101. }
  102.  
  103.  
  104. let intervalValue = setInterval(() => {
  105. if (document.readyState === "complete") {
  106. main()
  107. clearInterval(intervalValue)
  108. }
  109. }, 200)
  110.  
  111.  
  112. // Your code here...
  113. })();