// ==UserScript==
// @name 学人VIP
// @namespace studyVIP.taozhiyu.gitee.io
// @version 0.3
// @description 解锁图文
// @author 涛之雨
// @match *://gbr.businessreview.global/articles/view/*
// @match *://www.businessreview.global/*
// @icon https://gbr.businessreview.global/img/GBR-logo_black_50x50.png
// @require https://cdn.bootcdn.net/ajax/libs/hls.js/1.0.8-0.canary.7807/hls.min.js
// @require https://cdn.bootcdn.net/ajax/libs/blueimp-md5/2.19.0/js/md5.min.js
// @resource jq https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.slim.min.js
// @require https://cdn.jsdelivr.net/npm/@zip.js/zip.js@2.6.60/dist/zip-full.min.js
// @antifeature tracking ============================================>>>说明:我们仅会在经济学人文章阅读页面收集您使用本插件的情况,以帮助作者了解插件的用户数量。这个操作仅会收集您的IP地址信息,不包含您鼠标、键盘点击在内的所有操作,没有任何安全风险,不会产生性能损耗。为了保护您的知情权以及使用体验,特告知于您。本插件系开源脚本,所有代码均可查看源码,请您放心安装。 <<<============================================
// @grant GM_getResourceText
// @grant GM_addStyle
// @grant window.onurlchange
// @run-at document-start
// @license GPL3.0
// @homepage https://greasyfork.org/zh-CN/scripts/441874
// @downloadURL none
// ==/UserScript==
/*global Hls zip md5 $*/
/* jshint esversion: 11 */
(function() {
'use strict';
const addElement=(tag,args)=>{
const dom=document.createElement(tag);
for(const arg in args){
dom[arg]=args[arg];
}
document.body.append(dom);
},
main=(url)=>{
if(location.host==="www.businessreview.global"){
const path = (url?new URL(url):location).pathname.replace(/-/g,"_").split("/");
let targ=path.length===4?path[1]:"en_GB";
window.location.replace(`https://gbr.businessreview.global/articles/view/${path.slice(-1)+(targ==="en_GB"?'/en_GB/zh_CN':'/zh_CN/en_GB')}`);
return;
}
addElement('script', {
textContent:GM_getResourceText("jq")
});
const path = location.pathname.split("/"),lang = path[4];
fetch('https://api.hummingbird.businessreview.global/api/article?id=' + path[3]).then(a=>a.json()).then(tao=>{
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "//js.users.51.la/21234891.js";
document.body.appendChild(script);
const Dom=document.querySelector(".maincontent");
Dom.innerHTML='';
document.querySelectorAll(".store_btns,.cover").forEach(a=>a.remove());
tao.body.content.map(a=>{
switch (a.type) {
case "image":
for (const i of a.data) {
if (i.lang === lang) {
Dom.innerHTML+=`
${i.text}
`; break; } } break; case "subtitle": //似乎没什么用? break; case "video": for (const i of a.data) { if (i.lang === lang) { const url=i.url; if(Hls.isSupported()) { const vid=btoa((Math.random()+"").slice(2)).substr(0,10); Dom.innerHTML+=``; var video = document.getElementById(`v_${vid}`); var hls = new Hls(); var m3u8Url = decodeURIComponent(url); hls.loadSource(m3u8Url); hls.attachMedia(video); }else Dom.innerHTML+=`不支持hls播放器