├── LICENSE ├── README.md ├── chrome_fYt4G3WOB3.png └── main.js /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Oasis 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 脚本功能 2 | 配合[fake115](https://github.com/kkHAIKE/fake115)使用获得PC端最佳体验 3 | 1.油猴脚本,115网盘调用本地播放器 4 | 2.视频信息添加按钮,点击调用本地播放器 5 | 3.优化界面(移除无用侧边栏、上传按钮,<链接任务>按钮移至主界面) 6 | ![preview](chrome_fYt4G3WOB3.png) 7 | 8 | # 环境 9 | 1.操作系统:Win10 1093 10 | 2.浏览器:Chromium 74.0.3729.169 11 | 3.本地播放器:PotPlyer 1.7.19955 + madVR 12 | 4.115年费会员(非会员不能在线播放视频) 13 | 14 | # 原理 15 | 以potplayer为例,浏览器请求potplayer://+url,即可调用播放器打开url 16 | 其他播放器同理 17 | -------------------------------------------------------------------------------- /chrome_fYt4G3WOB3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2xx8/115.com_local_player/457171c7afde9121d82c5c0506cc054703cc836d/chrome_fYt4G3WOB3.png -------------------------------------------------------------------------------- /main.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name [115.com] Local Player 3 | // @version 2.0.2 4 | // @description Play Videos Via Local Player 5 | // @match https://115.com/* 6 | // @author sam 7 | // @run-at document-end 8 | // @grant none 9 | // @namespace 115.com 10 | // ==/UserScript== 11 | $(document).ready(function(){ 12 | 13 | changeWindow();//去除无用侧边栏 14 | 15 | //仅在wangpan框架内执行 16 | var page_url = window.location.href.substr(0,25); 17 | if (page_url =='https://115.com/?ct=file&'){ 18 | addPlayer();//添加播放按钮 19 | addMenu();//调整菜单 20 | }; 21 | }); 22 | 23 | function addMenu(){ 24 | document.querySelector("#js_top_panel_box > div:nth-child(7)").remove(); //移除上传按钮 25 | // 26 | //document.querySelector("#js_top_panel_box > div.right-tvf > a:nth-child(1)").remove(); //移除我的分享 27 | 28 | //添加'链接任务'按钮 29 | //$('链接任务').prependTo(document.querySelector("#js_top_panel_box > div.right-tvf")); 30 | //自动粘贴 31 | //var btn = document.querySelector("#add_task"); 32 | //btn.addEventListener("click", autoPaste()); 33 | } 34 | 35 | function autoPaste(){ 36 | 37 | } 38 | 39 | function changeWindow(){ 40 | if(window.location.href === "https://115.com/home/userhome"){ 41 | window.location = "https://115.com/?mode=wangpan"; 42 | }else{ 43 | var item_list,item_obj,item_name; 44 | var ifr = $("iframe[style='position: absolute; top: 0px;']"); 45 | $("div#js-main_mode").css("display","none"); 46 | $("div.main-core").css("left","0"); 47 | ifr.load( 48 | function(){ 49 | setCss(); 50 | addMarkButton(); 51 | item_list = ifr.contents().find("body").find("div#js_data_list"); 52 | item_list.mouseenter( 53 | function(){ 54 | if($("div.exph-loader").css("display") === "none" && !(item_list.find("div#isload").length)){ 55 | item_list.append("
"); 56 | itemEvent(); 57 | } 58 | } 59 | ); 60 | } 61 | ); 62 | } 63 | } 64 | 65 | function addPlayer(){ 66 | //本地播放器打开 67 | var requests = [], 68 | CloudVideo = window.CloudVideo = { 69 | showPanel: function (code) { 70 | this.getFileUrl(code, function (url) { 71 | //var xurl = 'ygl://' + encodeURIComponent(url); 72 | var xurl = 'potplayer://' + url; //原生potplayer调用 73 | console.log(xurl); 74 | window.location.href = xurl; 75 | }); 76 | }, 77 | getFileUrl: function (pickcode, callback) { 78 | requests.push([pickcode, callback]) 79 | } 80 | }; 81 | 82 | $('