草榴社区永久vip vip视频无限制观看

草榴社区永久vip vip视频随意观看

  1. // ==UserScript==
  2. // @name 草榴社区永久vip vip视频无限制观看
  3. // @name:zh-TW 草榴社區永久vip vip視頻無限制觀看
  4. // @namespace http://tampermonkey.net/
  5. // @version 2.3.0
  6. // @description 草榴社区永久vip vip视频随意观看
  7. // @description:zh-TW 草榴社區永久vip vip視頻隨意觀看
  8. // @author FFFFFFeng
  9. // @match https://*/*
  10. // @match http://*/*
  11. // @icon https://www.google.com/s2/favicons?domain=swag555.xyz
  12. // @grant none
  13. // @antifeature payment
  14. // ==/UserScript==
  15. (function () {
  16. let kitty_emojiList = ["😃","😄","😁","😆","😅","🤣","😂","🙂","🙃","🫠","😉","😊","😇","😕","🫤","😟","🙁","☹","😯","😲","🥺","🥹","😦","😧","😨","😰","😥","😢","😭","😱","😖","😣","😞","😓","😩","😫","😤","😡","😠"]
  17. let kitty_emojiIndex = 0
  18. let kitty_StatusColor = {
  19. success: "#67C23A",
  20. warning: "#E6A23C",
  21. info: "#909399",
  22. danger: "#F56C6C",
  23. '200': "#67C23A",
  24. '300': "#E6A23C",
  25. '400': "#909399",
  26. '500': '#F56C6C'
  27. }
  28. let kitty_config = {
  29. name: "草榴社区脚本",
  30. id: "cl",
  31. version: "2.3.0",
  32. homePageName: "kitty猫",
  33. homePageUrl: "www.kittymao.xyz",
  34.  
  35. update: 3,
  36. logListMaxLength: 5,
  37. logItemLength: 20,
  38.  
  39. useMethodUrlList: ["docs.kittymao.xyz"],
  40. payUrlList: ["shop.kittymao.xyz"],
  41.  
  42. updateUrl: "https://sleazyfork.org/zh-CN/scripts/440819-cao",
  43. requestHostList: ["https://baixiaodu.uk/api","https://www.kittymao.xyz/api","https://kittymao.xyz/api"],
  44. }
  45. let kitty_isrun = {
  46. getNewVersion: false
  47. }
  48. let kitty_tabIndex = 0
  49. let kitty_logList = []
  50. let kitty_successHost = ""
  51. function kitty_setCookie(cname, cvalue, exdays) {
  52. var d = new Date();
  53. d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
  54. var expires = "expires=" + d.toGMTString();
  55. document.cookie = cname + "=" + cvalue + "; " + expires;
  56. }
  57. function kitty_setScriptName(name) {
  58.  
  59. }
  60. function kitty_insertStyle() {
  61. let style = document.createElement("style")
  62. style.innerHTML = `
  63. /* 整体-start */
  64. #kitty_vipPanel {
  65. width: 310px;
  66. height: 500px;
  67. box-shadow: 0 0 0 1px rgb(0 0 0 / 5%), 0 2px 4px 1px rgb(0 0 0 / 9%);
  68. border-left: 1px solid transparent;
  69. border-right: none;
  70. border-top: 1px solid transparent;
  71. border-bottom: 1px solid transparent;
  72. background-color: #FFFFFF;
  73. position: fixed;
  74. left: 6px;
  75. bottom: 6px;
  76. z-index: 99999;
  77. font-size: 1rem;
  78. --script-panel-main-color: #004c7d;
  79. }
  80. #kitty_vipPanel a {
  81. text-decoration: underline;
  82. }
  83. .kitty_panelMain {
  84. font-size: 0.85em;
  85. }
  86. .hitty_hiddenPanel {
  87. left: -310px !important;
  88. }
  89. /* 整体-end */
  90. /* panelHead-start */
  91. .kitty_panelHead {
  92. display: flex;
  93. border-bottom: 1px solid #ececec;
  94. }
  95. .kitty_panelHead>div {
  96. color: #444;
  97. padding: 0 10px;
  98. height: 40px;
  99. line-height: 40px;
  100. box-sizing: border-box;
  101. user-select: none;
  102. text-align: center;
  103. width: 76px;
  104. font-size: 1em;
  105. }
  106. .kitty_panelHead>div:not(.kitty_headDivActive):hover {
  107. border-bottom: 3px solid #ccc;
  108. cursor: pointer;
  109. }
  110. .kitty_headDivActive {
  111. border-bottom: 3px solid var(--script-panel-main-color);
  112. color: #444;
  113. font-weight: bold;
  114. }
  115. /* panelHead-end */
  116. /* 界面显示按钮 */
  117. .kitty_showPanelBtn {
  118. position: absolute;
  119. left: 320px;
  120. bottom: 20px;
  121. width: 60px;
  122. height: 40px;
  123. line-height: 40px;
  124. color: var(--script-panel-main-color);
  125. user-select: none;
  126. background-color: #FFFFFF;
  127. position: absolute;
  128. left: 320;
  129. bottom: 20px;
  130. display: none;
  131. cursor: pointer;
  132. border-radius: 5px;
  133. }
  134. /* 身体 */
  135. .kitty_panelBody {
  136. padding: 0 10px;
  137. }
  138. /* 输入框-start */
  139. .kitty_searchInput {
  140. width: 98%;
  141. border-radius: 24px;
  142. box-shadow: 0 0 0 1px rgb(0 0 0 / 5%), 0 2px 4px 1px rgb(0 0 0 / 9%);
  143. height: 40px;
  144. border-left: 1px solid transparent;
  145. border-right: none;
  146. border-top: 1px solid transparent;
  147. border-bottom: 1px solid transparent;
  148. overflow: hidden;
  149. margin: 0 auto;
  150. margin-top: 40px;
  151. margin-bottom: 50px;
  152. display: flex;
  153. }
  154. .kitty_searchInput:hover {
  155. border-top-left-radius: 24px;
  156. box-shadow: 0 0 0 1px rgb(0 0 0 / 10%), 0 2px 4px 1px rgb(0 0 0 / 18%);
  157. border-left: 1px solid transparent;
  158. border-right: none;
  159. border-top: 1px solid transparent;
  160. border-bottom: 1px solid transparent;
  161. }
  162. .kitty_searchInput input {
  163. height: 100%;
  164. border: 0;
  165. outline: 0;
  166. padding: 0 10px;
  167. color: black;
  168. width: 100%;
  169. }
  170. /* 输入框-end */
  171. /* go按钮-start */
  172. .kitty_goToVipBtn {
  173. color: #FFFFFF;
  174. font-weight: bold;
  175. background-color: var(--script-panel-main-color);
  176. height: 100px;
  177. width: 100px;
  178. border-radius: 50px;
  179. text-align: center;
  180. line-height: 100px;
  181. margin: 20px auto;
  182. box-shadow: 0 0 0 1px rgb(0 0 0 / 5%), 0 2px 4px 1px rgb(0 0 0 / 9%);
  183. user-select: none;
  184. }
  185. .kitty_goToVipBtn:hover {
  186. cursor: pointer;
  187. box-shadow: 0 0 0 0 rgb(0 0 0 / 5%), 0 2px 4px 1px rgb(0 0 0 / 18%);
  188. -webkit-box-shadow: 0 0 0 0 rgb(0 0 0 / 5%), 0 2px 4px 1px rgb(0 0 0 / 18%);
  189. -moz-box-shadow: 0 0 0 0 rgba(0,0,0,.05),0 2px 4px 1px rgba(0,0,0,.18);
  190. }
  191. /* 动画 */
  192. @keyframes kitty_float {
  193. 0% {
  194. transform: translateY(0px);
  195. }
  196. 5% {
  197. transform: translateY(-10px);
  198. }
  199. 10%,100% {
  200. transform: translateY(0px);
  201. }
  202. }
  203.  
  204. .kitty_navy {
  205. position: relative;
  206. }
  207.  
  208. .kitty_navy span {
  209. position: relative;
  210. display: inline-block;
  211. color: white;
  212. animation: kitty_float 9s ease-in-out infinite;
  213. animation-delay: 2s;
  214. font-size: 1.5em;
  215. }
  216. /* go按钮-end */
  217. .kitty_logOutput {
  218. color: #71777d;
  219. font-size: 0.9em;
  220. margin-top: 50px;
  221. }
  222. .kitty_logOutput div {
  223. margin: 0;
  224. padding: 0;
  225. line-height: 1.5;
  226. }
  227. `
  228. document.querySelector("head").appendChild(style);
  229. }
  230. function kitty_createPanel() {
  231. let panel = document.createElement("div")
  232. panel.setAttribute("id", "kitty_vipPanel")
  233. panel.innerHTML = `
  234. <div class="kitty_showPanelBtn">&gt;&gt;显示</div>
  235. <div class="kitty_panelMain">
  236. <div class="kitty_panelHead">
  237. <div class="kitty_headDivActive">获取权限</div>
  238. <div>令牌登录</div>
  239. <div>使用指南</div>
  240. <div>支付</div>
  241. </div>
  242. <div class="kitty_panelBody kitty_panelBody_0">
  243. <div class="kitty_searchInput">
  244. <input id="kitty_txm" type="text" placeholder="">
  245. </div>
  246. <div class="kitty_goToVipBtn kitty_navy">
  247. <span>G</span>
  248. <span>O</span>
  249. <span>!</span>
  250. </div>
  251. <div class="kitty_logOutput">
  252. <div>脚本--><span class="kitty_scriptName"></span>-<span class="kitty_version"></span>-<span class="kitty_update"></span></div>
  253. <div>主页--><a class="kitty_homepage" target="_blank" href="">主页地址</a></div>
  254. <div>邮箱-->JamJamToday@protonmail.com</div>
  255. <div>操作--><span style="color: red;cursor:pointer;" class="kitty_hiddenPanelBtn">点此隐藏此脚本操作界面&lt;&lt;</span></div>
  256. <div class="kitty_logList">
  257. </div>
  258. </div>
  259. </div>
  260. <div class="kitty_panelBody kitty_panelBody_1" style="display:none;">
  261. <p>暂未开放</p>
  262. </div>
  263. <div class="kitty_panelBody kitty_panelBody_2" style="display:none;">
  264. <p>+ 使用方法线路1: <a target="_blank" href="https://docs.kittymao.xyz">docs.kittymao.xyz</a></p>
  265. </div>
  266. <div class="kitty_panelBody kitty_panelBody_3" style="display:none;">
  267. <p>+ 支付线路1: <a target="_blank" href="https://shop.kittymao.xyz">shop.kittymao.xyz</a></p>
  268. </div>
  269. </div>
  270. `
  271. document.body.appendChild(panel)
  272. }
  273.  
  274. function kitty_eventBind() {
  275. let tabs = document.querySelectorAll(".kitty_panelHead>div")
  276. for (let i = 0; i < tabs.length; i++) {
  277. tabs[i].addEventListener("click", function() {
  278. for (let ii = 0; ii < tabs.length; ii++) {
  279. tabs[ii].className = ""
  280. }
  281. tabs[i].className = "kitty_headDivActive"
  282. kitty_changeTab(i)
  283. })
  284. }
  285. document.querySelector(".kitty_hiddenPanelBtn").addEventListener("click", function() {
  286. kitty_hiddenPanel()
  287. })
  288. document.querySelector(".kitty_showPanelBtn").addEventListener("click", function() {
  289. kitty_showPanel()
  290. })
  291. let gets = document.querySelectorAll(".kitty_goToVipBtn")
  292. gets[0].addEventListener("click", function() {
  293. kitty_getPermissionStart()
  294. })
  295. }
  296. function kitty_changeTab(index) {
  297. kitty_tabIndex = index
  298. let panelBodys = document.querySelectorAll(".kitty_panelBody")
  299. if(!panelBodys[kitty_tabIndex]) {
  300. return
  301. }
  302. for (let i = 0; i < panelBodys.length; i ++) {
  303. panelBodys[i].style.display = "none"
  304. }
  305. panelBodys[kitty_tabIndex].style.display = "block"
  306. }
  307. function kitty_hiddenPanel() {
  308. document.querySelector("#kitty_vipPanel").className = "hitty_hiddenPanel"
  309. document.querySelector(".kitty_showPanelBtn").style.display = "block"
  310. }
  311. function kitty_showPanel() {
  312. document.querySelector("#kitty_vipPanel").className = ""
  313. document.querySelector(".kitty_showPanelBtn").style.display = "none"
  314. }
  315. function kitty_bodyChange() {
  316. let bodys = document.querySelectorAll(".kitty_panelBody")
  317. bodys.forEach(item => {
  318. item.style.display = "none"
  319. })
  320. }
  321. function kitty_getPermissionStart() {
  322. let emoLength = kitty_emojiList.length
  323. let txm = document.querySelector("#kitty_txm").value
  324. if (!txm) {
  325. kitty_logListPush(`请输入口令,然后点击GO按钮${kitty_emojiList[kitty_emojiIndex]}`, "info")
  326. kitty_emojiIndex++
  327. if (kitty_emojiIndex>=emoLength) {
  328. kitty_emojiIndex = 0;
  329. }
  330. return
  331. }
  332. localStorage.setItem("kitty_txm", txm)
  333. kitty_getSuccessHost();
  334. kitty_getPermission(0, txm, false);
  335. }
  336. function kitty_getSuccessHost() {
  337. let successHost = localStorage.getItem("kitty_requestSuccessHost")
  338. if(successHost) {
  339. let findIndex = kitty_config.requestHostList.indexOf(successHost);
  340. if (findIndex!=-1) {
  341. kitty_config.requestHostList.splice(findIndex, 1);
  342. kitty_config.requestHostList.unshift(successHost);
  343. }
  344. }
  345. }
  346. function kitty_getHost(index) {
  347. return kitty_config.requestHostList[index]
  348. }
  349.  
  350. function kitty_getStatusTypeText(type) {
  351. let typeText = "提示";
  352. switch(type){
  353. case "success":
  354. typeText = "成功"
  355. break
  356. case "warning":
  357. typeText = "警告"
  358. break
  359. case "info":
  360. typeText = "信息"
  361. break
  362. case "danger":
  363. typeText = "失败"
  364. break
  365. case '200':
  366. typeText = "成功"
  367. break
  368. case '300':
  369. typeText = "警告"
  370. break
  371. case '400':
  372. typeText = "信息"
  373. break
  374. case '500':
  375. typeText = "失败"
  376. break
  377. }
  378. return typeText;
  379. }
  380. function kitty_logListPush(item, type) {
  381. if (kitty_logList.length >= kitty_config.logListMaxLength) {
  382. kitty_logListShift()
  383. }
  384. let stringLength = item.length
  385. let start = 0;
  386. let end = kitty_config.logItemLength-1
  387. let headLine = true
  388. while(stringLength>=0) {
  389. let typeText = `${kitty_getStatusTypeText(type)}-->`;
  390. let styleColor = ""
  391. if (type) {
  392. styleColor = type?`color: ${kitty_StatusColor[type]}`:"";
  393. }
  394. kitty_logList.push(`<span style="${styleColor}">${headLine?typeText:'<span style="opacity: 0;">续行--</span>&gt;'}${item.substring(start, end)}</span>`)
  395. start = end
  396. end += end
  397. stringLength = stringLength-kitty_config.logItemLength
  398. headLine = false
  399. }
  400. kitty_showLogList()
  401. }
  402. function kitty_logListShift() {
  403. kitty_logList.shift();
  404. kitty_showLogList();
  405. }
  406. function kitty_showLogList() {
  407. let innerhtml = "";
  408. let kitty_logListDiv = document.getElementsByClassName("kitty_logList")[0]
  409. kitty_logList.forEach(item => {
  410. innerhtml+=`<div>${item}</div>`
  411. })
  412. kitty_logListDiv.innerHTML = innerhtml;
  413. }
  414. function kitty_setConfig() {
  415. document.getElementsByClassName("kitty_scriptName")[0].innerHTML = kitty_config.name;
  416. document.getElementsByClassName("kitty_version")[0].innerHTML = `v${kitty_config.version}`;
  417. let homepage = document.getElementsByClassName("kitty_homepage")[0];
  418. homepage.innerHTML = kitty_config.homePageName+`(${kitty_config.homePageUrl})`
  419. homepage.href = "https://"+kitty_config.homePageUrl
  420. if (kitty_config.update===1) {
  421. let versionSpan = document.getElementsByClassName("kitty_update")[0];
  422. versionSpan.innerHTML = `已最新`;
  423. versionSpan.style = `color: ${kitty_StatusColor.success};`;
  424. } else if (kitty_config.update===2) {
  425. let versionSpan = document.getElementsByClassName("kitty_update")[0];
  426. versionSpan.innerHTML = `<span class="kitty_toNewVersion" style="user-select: none;cursor: pointer;">点此更新</span>`;
  427. versionSpan.style = `color: ${kitty_StatusColor.warning};`;
  428. document.querySelector(".kitty_toNewVersion").addEventListener("click", function() {
  429. window.open(kitty_config.updateUrl)
  430. })
  431. } else {
  432. let versionSpan = document.getElementsByClassName("kitty_update")[0];
  433. versionSpan.innerHTML = `<span class="kitty_checkVersion" style="user-select: none;cursor: pointer;">检查更新</span>`;
  434. versionSpan.style = `color: ${kitty_StatusColor.warning};`;
  435. document.querySelector(".kitty_checkVersion").addEventListener("click", function() {
  436. kitty_getNewVersion(0, false)
  437. })
  438. }
  439. }
  440. function kitty_getCardNumber() {
  441. let txm = localStorage.getItem("txm")
  442. if (txm) {
  443. localStorage.setItem("kitty_txm", txm)
  444. localStorage.removeItem("txm")
  445. kitty_logListPush("shanchutsm", "warning")
  446. }
  447. let kitty_txm = localStorage.getItem("kitty_txm")
  448. if (kitty_txm) {
  449. document.querySelector("#kitty_txm").value = kitty_txm
  450. kitty_logListPush("在使用前请安装好modheader并配置,详情请查看使用指南", "warning")
  451. if (kitty_isSuccess()) {
  452. kitty_logListPush("请求成功请尝试观看", "success")
  453. } else {
  454. kitty_logListPush("已获取到上次使用的口令,请另外保存口令", "info")
  455. kitty_logListPush("已准备就绪,请点击GO按钮", "info")
  456. }
  457. } else {
  458. if (kitty_isSuccess()) {
  459. kitty_logListPush("请求成功请尝试观看", "success")
  460. } else {
  461. kitty_logListPush("已准备就绪,请点击GO按钮", "info")
  462. kitty_logListPush(`请输入口令,然后点击GO按钮${kitty_emojiList[kitty_emojiIndex]}`, "info")
  463. }
  464. kitty_emojiIndex++
  465. }
  466. }
  467. function kitty_getPermission(index, txm, change) {
  468. if (kitty_isrun.getPermission&&!change) {
  469. return
  470. }
  471. let host = kitty_getHost(index)
  472. if(!change) {
  473. kitty_logListPush("发送请求中请耐心等待...", "info")
  474. }
  475. kitty_isrun.getPermission = true
  476. let url = `${host}/cl/getPermission`
  477. fetch(url,{
  478. method: "POST",
  479. headers: {
  480. "Content-Type": "application/json",
  481. },
  482. body: JSON.stringify({
  483. "version": kitty_config.version,
  484. "cardContent": txm.trim(),
  485. "nickname": "cl"
  486. })
  487. }).then(res => res.json()).then(res => {
  488. localStorage.setItem("kitty_requestSuccessHost", host)
  489. try {
  490. if (res.success) {
  491. dealGetPermissionRes(res.data)
  492. } else {
  493. kitty_logListPush(res.message, "warning")
  494. }
  495. } catch(e) {
  496. kitty_logListPush("失败,返回值处理有问题", "danger")
  497. console.log(e)
  498. }
  499. kitty_isrun.getPermission = false
  500. }).catch((e) => {
  501. if (e.toString().includes("JSON")) {
  502. kitty_logListPush("JSON解析失败,请联系作者", "danger")
  503. kitty_isrun.getPermission = false
  504. } else {
  505. console.log(e)
  506. index++
  507. let getHost = kitty_getHost(index)
  508. if (getHost) {
  509. kitty_logListPush("请求失败,切换线路中请耐心等待...", "warning")
  510. kitty_getPermission(index, txm, true)
  511. } else {
  512. kitty_logListPush("请求失败,请联系作者", "danger")
  513. kitty_isrun.getPermission = false
  514. }
  515. }
  516. })
  517. }
  518. function dealGetPermissionRes(resData) {
  519. let cookieArr = resData.token
  520. cookieArr.forEach((item) => {
  521. let temp = item.split(";")[0]
  522. let tempArr = temp.split("=")
  523. kitty_setCookie(tempArr[0], tempArr[1], 359)
  524. })
  525. kitty_logListPush("请求成功, 刷新页面中请稍候...", "success");
  526. setTimeout(() => {
  527. location.reload()
  528. }, 1000)
  529. }
  530. function kitty_checkIsSuccess() {
  531. if (kitty_isSuccess()) {
  532. kitty_hiddenPanel();
  533. }
  534. }
  535. function kitty_isSuccess() {
  536. let account = document.querySelectorAll("[style='font-weight:bold']")
  537. if (account.length == 0) {
  538. return false
  539. }
  540. for (let i = 0; i < account.length; i++) {
  541. if (account[i].innerHTML == "cl20220227") {
  542. return true;
  543. }
  544. }
  545. }
  546. function kitty_getNewVersion(index, change) {
  547. if (kitty_isrun.getNewVersion&&!change) {
  548. return
  549. }
  550. let host = kitty_getHost(index)
  551. if(!change) {
  552. kitty_logListPush("检查版本号中请耐心等待...", "info")
  553. }
  554. kitty_isrun.getNewVersion = true
  555. let url = `${host}/getVersion`
  556. fetch(url,{
  557. method: "POST",
  558. headers: {
  559. "Content-Type": "application/json",
  560. },
  561. body: JSON.stringify({
  562. "nickname": "cl"
  563. })
  564. }).then(res => res.json()).then(res => {
  565. localStorage.setItem("kitty_requestSuccessHost", host)
  566. try {
  567. let data = res.data
  568. if (data.version === kitty_config.version) {
  569. kitty_config.update = 1
  570. kitty_logListPush("已是最新版", "success")
  571. } else {
  572. kitty_config.update = 2
  573. kitty_config.updateUrl = data.updateUrl
  574. kitty_logListPush("不是最新版,可能无法使用", "warning")
  575. }
  576. kitty_setConfig()
  577. } catch(e) {
  578. kitty_logListPush("失败,返回值处理有问题", "danger")
  579. console.log(e)
  580. }
  581. kitty_isrun.getNewVersion = false
  582. }).catch((e) => {
  583. if (e.toString().includes("JSON")) {
  584. kitty_logListPush("JSON解析失败,请联系作者", "danger")
  585. kitty_isrun.getNewVersion = false
  586. } else {
  587. console.log(e)
  588. index++
  589. let getHost = kitty_getHost(index)
  590. if (getHost) {
  591. kitty_logListPush("请求失败,切换线路中请耐心等待...", "warning")
  592. kitty_getNewVersion(index, true)
  593. } else {
  594. kitty_logListPush("请求失败,请联系作者", "danger")
  595. kitty_isrun.getPermission = false
  596. }
  597. }
  598. })
  599. }
  600. function kitty_vipPanelInit() {
  601. kitty_insertStyle();
  602. kitty_createPanel();
  603. kitty_getSuccessHost();
  604. kitty_showLogList();
  605. kitty_eventBind();
  606. kitty_getCardNumber();
  607. kitty_setConfig();
  608. kitty_checkIsSuccess()
  609. }
  610. function kitty_isRun() {
  611. let site = false
  612. let run = false
  613. if(document.title.includes("草榴社區")||document.title.includes("欢迎您")) {
  614. site = true
  615. }
  616. if (document.querySelector("#kitty_vipPanel")||document.querySelector("#vipPanel")) {
  617. run = true
  618. }
  619. if (site&&!run) {
  620. kitty_vipPanelInit();
  621. }
  622. }
  623. kitty_isRun()
  624. })();