播片源

自动播放片源网资源

As of 2017-01-23. See the latest version.

// ==UserScript==
// @name 		播片源
// @namespace 		play
// @version 		0.0.32
// @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');

if(magnet=='undefined'){
	$('.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>');
	magnet = $('.tdown').find('a').eq(1).attr('href');
	GM_setValue('magnet', magnet);
	$('#playBtn').bind('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);
	// }

}