// ==UserScript==
// @name 往往搜索影视插件 - 支持腾讯视频、爱奇艺、芒果、优酷、搜狐影视快捷搜索到往往影视
// @namespace http://tampermonkey.net/
// @version 12.26
// @description 往往影视搜索是一个轻量型的搜剧引擎。安装脚本后在播放页右下角可以看到往往影视搜索框,可以跳转到往往影视搜索看剧
// @author 往往搜索
// @match *://v.qq.com/*
// @match *://*.iqiyi.com/*
// @match *://*.mgtv.com/*
// @match *://*.youku.com/*
// @match *://*.le.com/*
// @match *://*.bilibili.com/*
// @match *://tv.sohu.com/*
// @icon https://www.oftens.top/img/logo.png
// @require http://code.jquery.com/jquery-2.1.1.min.js
// @grant none
// @license AGPL License
// @downloadURL https://update.greasyfork.icu/scripts/470466/%E5%BE%80%E5%BE%80%E6%90%9C%E7%B4%A2%E5%BD%B1%E8%A7%86%E6%8F%92%E4%BB%B6%20-%20%E6%94%AF%E6%8C%81%E8%85%BE%E8%AE%AF%E8%A7%86%E9%A2%91%E3%80%81%E7%88%B1%E5%A5%87%E8%89%BA%E3%80%81%E8%8A%92%E6%9E%9C%E3%80%81%E4%BC%98%E9%85%B7%E3%80%81%E6%90%9C%E7%8B%90%E5%BD%B1%E8%A7%86%E5%BF%AB%E6%8D%B7%E6%90%9C%E7%B4%A2%E5%88%B0%E5%BE%80%E5%BE%80%E5%BD%B1%E8%A7%86.user.js
// @updateURL https://update.greasyfork.icu/scripts/470466/%E5%BE%80%E5%BE%80%E6%90%9C%E7%B4%A2%E5%BD%B1%E8%A7%86%E6%8F%92%E4%BB%B6%20-%20%E6%94%AF%E6%8C%81%E8%85%BE%E8%AE%AF%E8%A7%86%E9%A2%91%E3%80%81%E7%88%B1%E5%A5%87%E8%89%BA%E3%80%81%E8%8A%92%E6%9E%9C%E3%80%81%E4%BC%98%E9%85%B7%E3%80%81%E6%90%9C%E7%8B%90%E5%BD%B1%E8%A7%86%E5%BF%AB%E6%8D%B7%E6%90%9C%E7%B4%A2%E5%88%B0%E5%BE%80%E5%BE%80%E5%BD%B1%E8%A7%86.meta.js
// ==/UserScript==
(function() {
'use strict';
var url = `https://www.oftens.top`
var html = `
`
var llqurl = window.location.href
//爱奇艺
if(llqurl.indexOf(`iqiyi.com`) !== -1){
var timeFun = setTimeout(function () {
$("meta").each(function(){
let title = $(this).attr("name")
if(title == "irAlbumName"){
title = $(this).attr("content")
$("#inputs").val(title)
}
})
clearTimeout(timeFun)
}, 5000);
$(".iqp-player-videolayer-inner").prepend(html)
}
//腾讯视频
if(llqurl.indexOf(`v.qq.com`) !== -1){
$("#player").prepend(html)
let title = $(".playlist-intro__title").text()
$("#inputs").val(title)
}
//芒果
if(llqurl.indexOf(`mgtv.com`) !== -1){
$("container").prepend(html)
let title = $("div.m-aside-header.m-aside-header-ie > h2 > div").text()
$("#inputs").val(title)
}
//优酷
if(llqurl.indexOf(`youku.com`) !== -1){
$(".play-paction-wrap").prepend(html)
let title = $("#module_basic_dayu_sub > div > div.thesis-wrap > a").text()
$("#inputs").val(title)
}
//乐视
if(llqurl.indexOf(`le.com`) !== -1){
$("#video").prepend(html)
let title = $("div.juji_bar.j_jujiName").text()
$("#inputs").val(title)
}
//哔哩哔哩
if(llqurl.indexOf(`bilibili.com`) !== -1){
$("#bilibili-player").prepend(html)
let title = $("#viewbox_report > h1").text()
$("#inputs").val(title)
}
//搜狐
if(llqurl.indexOf(`sohu.com`) !== -1){
$(".x-player").prepend(html)
let timeFun = setTimeout(function () {
$("meta").each(function(){
let title = $(this).attr("name")
if(title == "album"){
title = $(this).attr("content")
$("#inputs").val(title)
}
})
clearTimeout(timeFun)
}, 5000);
}
$("#myc").click(function(){
let tit = $("#inputs").val()
window.open(`${url}/oftenssearch/-------------.html?wd=${tit}`);
})
})();