播片源

自动播放片源网资源

当前为 2017-01-23 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name 		播片源
// @namespace 		play
// @version 		0.0.28
// @author 		bengben
// @description 	自动播放片源网资源


// @include     http*://pianyuan.net/*
// @include     http*://pan.baidu.com/disk/home*
// @require 	https://code.jquery.com/jquery-2.1.4.min.js

// @grant 		GM_getValue
// @grant 		GM_setValue
// @grant 		GM_listValues
// ==/UserScript==

// test script
// GM_setValue('GMTest1','hello kitty');
// alert(GM_getValue('GMTest1'));


//https://code.jquery.com/jquery-2.1.4.min.js
var url_baiduyun = 'https://pan.baidu.com/disk/home';

//首页

$.each($('table').find('.firstr,.odd,.even'),function(i,n){

	//增加th表头
	if(i===0){
		$(this).append('<th class="lasttd nobr center">操作</th>');
	}else{
		$(this).append('<th class="lasttd nobr center" aria-label="Left Align"><button type="button" class="btn btn-info btn-xs" data-toggle="modal" data-target="#playModal"><span class="glyphicon glyphicon-play-circle" aria-hidden="true"></span>&nbsp;&nbsp;播放</button></th>');
	}
});


// 详情页面
var magnet = GM_getValue('magnet');
console.log('magnet>>>>>>>',magnet);

if(magnet === null){
	magnet = $('.tdown').find('a').eq(1).attr('href');
	GM_setValue('magnet', magnet);

	$('.tdown').append('<a href=":;" id="playBtn" class="btn btn-info btn-sm " aria-label="Left Align"><span class="glyphicon glyphicon-play-circle" aria-hidden="true"></span>播放</a>');
	$('#playBtn').click(function(){
		window.open(url_baiduyun);
	});
}else{

	// if(null===magnet){
	document.querySelector('.g-button[data-button-id=b13]').click();
		setTimeout(function() {
			document.querySelector('#_disk_id_2').click();
			setTimeout(function() {
			  document.querySelector('#share-offline-link').value = magnet;
			  document.querySelector('.g-button[data-button-id=b65]').click();
			}, 1000);
		}, 3000);
	// }

}