diff --git a/src-tauri/icons/zbook.icns b/src-tauri/icons/zbook.icns new file mode 100644 index 0000000..16a4920 Binary files /dev/null and b/src-tauri/icons/zbook.icns differ diff --git a/src-tauri/pake.json b/src-tauri/pake.json index a97dcc7..41df6ca 100644 --- a/src-tauri/pake.json +++ b/src-tauri/pake.json @@ -1,28 +1,32 @@ { - "windows": [ - { - "url": "https://weread.qq.com/", - "transparent": true, - "fullscreen": false, - "width": 1200, - "height": 780, - "resizable": true, - "url_type": "web" - } - ], - "user_agent": { - "macos": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15", - "linux": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36", - "windows": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36" - }, - "menu": { - "macos": true, - "linux": false, - "windows": false - }, - "system_tray": { - "macos": false, - "linux": true, - "windows": true - } + "windows": [ + { + "url": "https://zbook.lol/", + "transparent": true, + "fullscreen": false, + "width": 1200, + "height": 780, + "resizable": true, + "url_type": "web" + } + ], + "user_agent": { + "macos": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15", + "linux": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36", + "windows": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36" + }, + "menu": { + "macos": false, + "linux": false, + "windows": false + }, + "system_tray": { + "macos": false, + "linux": true, + "windows": true + }, + "inject": [ + "/Users/guyifeng/workspace/seeyon/pake-patch/index.js", + "/Users/guyifeng/workspace/seeyon/pake-patch/index.css" + ] } diff --git a/src-tauri/src/app/invoke.rs b/src-tauri/src/app/invoke.rs index 5c13f36..60ec511 100644 --- a/src-tauri/src/app/invoke.rs +++ b/src-tauri/src/app/invoke.rs @@ -1,4 +1,4 @@ -use std::{fs}; +use std::fs; use crate::util::{check_file_or_append, get_download_message, show_toast}; use download_rs::sync_download::Download; @@ -34,21 +34,23 @@ pub async fn download_file(app: AppHandle, params: DownloadFileParams) -> Result } } - #[command] -pub async fn download_file_by_binary(app: AppHandle, params: BinaryDownloadParams) -> Result<(), String> { +pub async fn download_file_by_binary( + app: AppHandle, + params: BinaryDownloadParams, +) -> Result<(), String> { let window: Window = app.get_window("pake").unwrap(); let output_path = api::path::download_dir().unwrap().join(params.filename); let file_path = check_file_or_append(output_path.to_str().unwrap()); - let download_file_result = fs::write(&file_path, ¶ms.binary); + let download_file_result = fs::write(file_path, ¶ms.binary); match download_file_result { Ok(_) => { show_toast(&window, &get_download_message()); Ok(()) - }, + } Err(e) => { show_toast(&window, &e.to_string()); Err(e.to_string()) } } -} \ No newline at end of file +} diff --git a/src-tauri/src/inject/_INJECT_.js b/src-tauri/src/inject/_INJECT_.js index cfa374b..999d1a3 100644 --- a/src-tauri/src/inject/_INJECT_.js +++ b/src-tauri/src/inject/_INJECT_.js @@ -1 +1,485 @@ -// empty \ No newline at end of file +window.addEventListener('DOMContentLoaded', (_event) => { // ==UserScript== +// @name 全网VIP视频免费破解【专注一个脚本只做一件事件】长期更新,放心使用 +// @namespace http://tampermonkey.net/ +// @version 1.6.1 +// @description 全网VIP视频免费破解【专注一个脚本只做一件事件】长期更新,放心使用。支持:腾讯、爱奇艺、优酷、芒果、Bilibili、pptv、乐视等其它网站; +// @icon data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAkACQAAD//gAUU29mdHdhcmU6IFNuaXBhc3Rl/9sAQwADAgIDAgIDAwMDBAMDBAUIBQUEBAUKBwcGCAwKDAwLCgsLDQ4SEA0OEQ4LCxAWEBETFBUVFQwPFxgWFBgSFBUU/9sAQwED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5Y9h71+cUuKuK8ZxVisry6KqUqFSkpJxSiqc6DnKUp7qXPyqKV7pv3WtV8NWyzLKGAhXrNxlNTtZ3fNGdkku3Le/5njU1tDcbfNiSXacrvUHB9q3/AA/438R+Eo5o9D1/VNGSYhpV0+8kgDkdCwRhn8axaK/od0abbbitd9N7bXPh/rNflhDndo3sruyvvbtfrbc6Kf4j+LLq4uJ5vFGszT3CCOaSTUJmaVBnCsS2SBk8H1Nc7RRUU8NRoylOlBRcrXaSTdtFfvZbGU6tSpbnk3buz//Z +// @author w__yi +// @match *://*.youku.com/* +// @match *://*.iqiyi.com/* +// @match *://*.iq.com/* +// @match *://*.le.com/* +// @match *://v.qq.com/* +// @match *://m.v.qq.com/* +// @match *://*.tudou.com/* +// @match *://*.mgtv.com/* +// @match *://tv.sohu.com/* +// @match *://film.sohu.com/* +// @match *://*.1905.com/* +// @match *://*.bilibili.com/* +// @match *://*.pptv.com/* + +// @require https://cdn.bootcdn.net/ajax/libs/jquery/3.2.1/jquery.min.js +// @connect api.bilibili.com +// @grant unsafeWindow +// @grant GM_addStyle +// @grant GM_openInTab +// @grant GM_getValue +// @grant GM_setValue +// @grant GM_xmlhttpRequest +// @grant GM_log +// @charset UTF-8 +// @license GPL License +// ==/UserScript== + + + +window.addEventListener('DOMContentLoaded', function() { + const util = (function () { + + function findTargetElement(targetContainer) { + const body = window.document; + let tabContainer; + let tryTime = 0; + const maxTryTime = 120; + let startTimestamp; + return new Promise((resolve, reject) => { + function tryFindElement(timestamp) { + if (!startTimestamp) { + startTimestamp = timestamp; + } + const elapsedTime = timestamp - startTimestamp; + + if (elapsedTime >= 500) { + GM_log("查找元素:" + targetContainer + ",第" + tryTime + "次"); + tabContainer = body.querySelector(targetContainer); + if (tabContainer) { + resolve(tabContainer); + } else if (++tryTime === maxTryTime) { + reject(); + } else { + startTimestamp = timestamp; + } + } + if (!tabContainer && tryTime < maxTryTime) { + requestAnimationFrame(tryFindElement); + } + } + + requestAnimationFrame(tryFindElement); + }); + } + + function urlChangeReload() { + const oldHref = window.location.href; + let interval = setInterval(() => { + let newHref = window.location.href; + if (oldHref !== newHref) { + clearInterval(interval); + window.location.reload(); + } + }, 500); + } + + function reomveVideo() { + setInterval(() => { + for (let video of document.getElementsByTagName("video")) { + if (video.src) { + video.removeAttribute("src"); + video.muted = true; + video.load(); + video.pause(); + } + } + }, 500); + } + + function syncRequest(option) { + return new Promise((resolve, reject) => { + option.onload = (res) => { + resolve(res); + }; + option.onerror = (err) => { + reject(err); + }; + GM_xmlhttpRequest(option); + }); + } + + return { + req: (option) => syncRequest(option), + findTargetEle: (targetEle) => findTargetElement(targetEle), + urlChangeReload: () => urlChangeReload(), + reomveVideo: () => reomveVideo() + } + })(); + + + const superVip = (function () { + + const _CONFIG_ = { + isMobile: navigator.userAgent.match(/(Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini)/i), + currentPlayerNode: null, + vipBoxId: 'vip_jx_box' + Math.ceil(Math.random() * 100000000), + flag: "flag_vip", + autoPlayerKey: "auto_player_key" + window.location.host, + autoPlayerVal: "auto_player_value_" + window.location.host, + videoParseList: [ + {"name": "综合/B站", "type": "1,3", "url": "https://jx.jsonplayer.com/player/?url="}, + /*{"name": "Player-JY", "type": "1,3", "url": "https://jx.playerjy.com/?url="},*/ + {"name": "虾米", "type": "1,3", "url": "https://jx.xmflv.com/?url="}, + /*{"name": "NNXV", "type": "1,3", "url": "https://jx.nnxv.cn/tv.php?url="},*/ + /*{"name": "听乐", "type": "1,3", "url": "https://jx.dj6u.com/?url="},*/ + /*{"name": "RDHK", "type": "1,3", "url": "https://jx.rdhk.net/?v="},*/ + {"name": "OK", "type": "1,3", "url": "https://api.okjx.cc:3389/jx.php?url="}, + {"name": "OKJX", "type": "1,3", "url": "https://okjx.cc/?url="}, + {"name": "YT", "type": "1,3", "url": "https://jx.yangtu.top/?url="}, + {"name": "爱豆", "type": "1,3", "url": "https://jx.aidouer.net/?url="}, + {"name": "猪蹄", "type": "1,3", "url": "https://jx.iztyy.com/Bei/?url="}, + {"name": "yparse", "type": "1,2", "url": "https://jx.yparse.com/index.php?url="}, + {"name": "夜幕", "type": "1,3", "url": "https://www.yemu.xyz/?url="}, + {"name": "m1907", "type": "1,2", "url": "https://im1907.top/?jx="}, + {"name": "MAO", "type": "1,3", "url": "https://www.mtosz.com/m3u8.php?url="}, + {"name": "M3U8TV", "type": "1,3", "url": "https://jx.m3u8.tv/jiexi/?url="}, + {"name": "铭人云", "type": "1,3", "url": "https://parse.123mingren.com/?url="}, + {"name": "4kdv", "type": "1,3", "url": "https://jx.4kdv.com/?url="}, + + {"name": "1717", "type": "1,3", "url": "https://ckmov.ccyjjd.com/ckmov/?url="}, + {"name": "8090", "type": "1,3", "url": "https://www.8090g.cn/?url="}, + {"name": "qianqi", "type": "1,3", "url": "https://api.qianqi.net/vip/?url="}, + {"name": "laobandq", "type": "1,3", "url": "https://vip.laobandq.com/jiexi.php?url="}, + {"name": "playm3u8", "type": "1,3", "url": "https://www.playm3u8.cn/jiexi.php?url="}, + {"name": "无名小站", "type": "1,3", "url": "https://www.administratorw.com/video.php?url="}, + {"name": "CK", "type": "1,3", "url": "https://www.ckplayer.vip/jiexi/?url="}, + {"name": "盘古", "type": "1,3", "url": "https://go.yh0523.cn/y.cy?url="}, + {"name": "Blbo", "type": "1,3", "url": "https://jx.blbo.cc:4433/?url="}, + ], + playerContainers: [ + { + host: "v.qq.com", + container: "#mod_player,#player-container,.container-player", + name: "Default", + displayNodes: ["#mask_layer", ".mod_vip_popup", "#mask_layer", ".panel-tip-pay"] + }, + { + host: "m.v.qq.com", + container: ".mod_player,#player", + name: "Default", + displayNodes: [".mod_vip_popup", "[class^=app_],[class^=app-],[class*=_app_],[class*=-app-],[class$=_app],[class$=-app]", "div[dt-eid=open_app_bottom]", "div.video_function.video_function_new", "a[open-app]", "section.mod_source", "section.mod_box.mod_sideslip_h.mod_multi_figures_h,section.mod_sideslip_privileges,section.mod_game_rec", ".at-app-banner"] + }, + + {host: "w.mgtv.com", container: "#mgtv-player-wrap", name: "Default", displayNodes: []}, + {host: "www.mgtv.com", container: "#mgtv-player-wrap", name: "Default", displayNodes: []}, + { + host: "m.mgtv.com", + container: ".video-area", + name: "Default", + displayNodes: ["div[class^=mg-app]", ".video-area-bar", ".open-app-popup"] + }, + {host: "www.bilibili.com", container: "#player_module,#bilibiliPlayer,#bilibili-player", name: "Default", displayNodes: []}, + {host: "m.bilibili.com", container: ".player-wrapper,.player-container,.mplayer", name: "Default", displayNodes: []}, + {host: "www.iqiyi.com", container: "#flashbox", name: "Default", displayNodes: ["#playerPopup", "div[class^=qy-header-login-pop]", "section[class^=modal-cover_]" ,".toast"]}, + { + host: "m.iqiyi.com", + container: ".m-video-player-wrap", + name: "Default", + displayNodes: ["div.m-iqyGuide-layer", "a[down-app-android-url]", "[name=m-extendBar]", "[class*=ChannelHomeBanner]", "section.m-hotWords-bottom"] + }, + {host: "www.iq.com", container: ".intl-video-wrap", name: "Default", displayNodes: []}, + {host: "v.youku.com", container: "#player", name: "Default", displayNodes: ["#iframaWrapper", "#checkout_counter_mask", "#checkout_counter_popup"]}, + { + host: "m.youku.com", + container: "#player,.h5-detail-player", + name: "Default", + displayNodes: [".callEnd_box", ".h5-detail-guide", ".h5-detail-vip-guide"] + }, + {host: "tv.sohu.com", container: "#player", name: "Default", displayNodes: []}, + {host: "film.sohu.com", container: "#playerWrap", name: "Default", displayNodes: []}, + {host: "www.le.com", container: "#le_playbox", name: "Default", displayNodes: []}, + {host: "video.tudou.com", container: ".td-playbox", name: "Default", displayNodes: []}, + {host: "v.pptv.com", container: "#pptv_playpage_box", name: "Default", displayNodes: []}, + {host: "vip.pptv.com", container: ".w-video", name: "Default", displayNodes: []}, + {host: "www.wasu.cn", container: "#flashContent", name: "Default", displayNodes: []}, + {host: "www.acfun.cn", container: "#player", name: "Default", displayNodes: []}, + {host: "vip.1905.com", container: "#player,#vodPlayer", name: "Default", displayNodes: []}, + {host: "www.1905.com", container: "#player,#vodPlayer", name: "Default", displayNodes: []}, + ] + }; + + class BaseConsumer { + constructor() { + this.parse = () => { + util.findTargetEle('body') + .then((container) => this.preHandle(container)) + .then((container) => this.generateElement(container)) + .then((container) => this.bindEvent(container)) + .then((container) => this.autoPlay(container)) + .then((container) => this.postHandle(container)); + } + } + + preHandle(container) { + _CONFIG_.currentPlayerNode.displayNodes.forEach((item, index) => { + util.findTargetEle(item) + .then((obj) => obj.style.display = 'none') + .catch(e => console.warn("不存在元素", e)); + }); + return new Promise((resolve, reject) => resolve(container)); + } + + generateElement(container) { + GM_addStyle(` + #${_CONFIG_.vipBoxId} {cursor:pointer; position:fixed; top:120px; left:0px; z-index:9999999; text-align:left;} + #${_CONFIG_.vipBoxId} .img_box{width:32px; height:32px;line-height:32px;text-align:center;background-color:#1c84c6;margin:10px 0px;} + #${_CONFIG_.vipBoxId} .vip_list {display:none; position:absolute; border-radius:5px; left:32px; top:0; text-align:center; background-color: #3f4149; border:1px solid white;padding:10px 0px; width:380px; max-height:400px; overflow-y:auto;} + #${_CONFIG_.vipBoxId} .vip_list li{border-radius:2px; font-size:12px; color:#DCDCDC; text-align:center; width:calc(25% - 14px); line-height:21px; float:left; border:1px solid gray; padding:0 4px; margin:4px 2px;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;-o-text-overflow:ellipsis;} + #${_CONFIG_.vipBoxId} .vip_list li:hover{color:#1c84c6; border:1px solid #1c84c6;} + #${_CONFIG_.vipBoxId} .vip_list ul{padding-left: 10px;} + #${_CONFIG_.vipBoxId} .vip_list::-webkit-scrollbar{width:5px; height:1px;} + #${_CONFIG_.vipBoxId} .vip_list::-webkit-scrollbar-thumb{box-shadow:inset 0 0 5px rgba(0, 0, 0, 0.2); background:#A8A8A8;} + #${_CONFIG_.vipBoxId} .vip_list::-webkit-scrollbar-track{box-shadow:inset 0 0 5px rgba(0, 0, 0, 0.2); background:#F1F1F1;} + #${_CONFIG_.vipBoxId} li.selected{color:#1c84c6; border:1px solid #1c84c6;} + `); + + if (_CONFIG_.isMobile) { + GM_addStyle(` + #${_CONFIG_.vipBoxId} {top:300px;} + #${_CONFIG_.vipBoxId} .vip_list {width:300px;} + `); + } + + let type_1_str = ""; + let type_2_str = ""; + let type_3_str = ""; + _CONFIG_.videoParseList.forEach((item, index) => { + if (item.type.includes("1")) { + type_1_str += `