// ==UserScript==
// @name 学人VIP
// @namespace studyVIP.taozhiyu.gitee.io
// @version 0.6
// @description 解锁VIP
// @author 涛之雨
// @match *://www.businessreview.global/*
// @match *://*.economist.com/*
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcwAAAHMCAMAAABvBWi0AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABC1BMVEX4AADVAABjAACxAAA4AAAAAACMAAD4Awj4BAb4BAQRERERbbn/////uW1tuf+5bRHclEMREW25/////7ltERERQ5Tc//8REUOU3P///9yUQxFDlNz/3JRDERG5uZRtbW1tQ0NDQxERQ23/3Ny5lG1tlLnc3P/cubm5ubltQ5RtEUO5udz/3LltQxG5lENDQ0MRQ0OUlG25lJTc3Ny5bUNDbbm53P9DbZS53NxDbW1tbUPcuZSU3LmUbW2UlLncuW0TEREREg9tubkTEBMQEw9tudyUudwRbZSUbUNtlNxDlLnc3LlDQ21tbZTclG1DQ5SUQ0P/ubltlJSUubm53LmUuf+5bW2UlNy5/9yMDBpxAAAAAWJLR0QMgbNRYwAAGPRJREFUeNrtnWt720Z6hgWAYrsURclxJIahFNmyJauNbKsryyd112nTuM7a67Tbw+7//yV7EZjzeYChAI6e+4stnPnemBczA2CwtQUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABDoSj7PgIQRzUqbDO2t9dls6hE+g5BNpTb29smm+PtGkugR+Pue+X0HYNMKEbGaBalO9Bju+YwIDM9NKYjaSox3GAqgkWzUgedkJkaQZp4baykQJtyMF3PdrX1A5mJkQIqFsCRFOmRtuKYzyxb6oTMtMjKxEtgYZ1jmN2uvjuCzKQo2VSMaLntirVyFmy3qdhK2xiFr1cqBFy2x8oqLJcUthmW+RLjqmp9jVkHY9mJGFKXLWW1u5WpnkgBq6qHy2aoZ7M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ftJf3VeyLNK8wUyLQgqaXCkm9NSV5nlPoRb5pvX9g2IF8Ynr4xb1bMsZFoQXZmfaBfKlafvzShTLJaGaEv1qSevjo2Hpq4GmRZYA4H3kauvqd9YmvdXx/J8k0ypGnNpCLZkU06nS/NkyLRDO7L5BVEbc2D+0XXl0kq2xNLtcjKxXlA3md4qQEv11pVhAIlV4dPO+6Ui0/i0CFduU8U2M5yC1Zn+Xun7TqmnmkYDmZ8daq6UvlyLLJrHP0xs0DSd0cBA/bUzT5UmR+igS8ojXc63DZx3rZtHTnp7lG4N9N7RzggeQUusvDhszaQrspGbQ9/bK5vFBsrkF81r12h5D/72wrup+V/yuWAOSiboDGRmBGRmBGRmBGRmBGRmBGRmBGRmBGRmBGRmBGRmBGRmBGRmBGRmBGRmBGRmBGRmBGRmBGRmBGRmBGRmBGRmBGRmBGRmBGRmBGRmBGRmBGRmBGRmBGRmBGRmBGRmBGRmBGRmBGRmBGRmBGRmBGRmBGRmBGRmxN8B9RLqV70c7QYAAAAASUVORK5CYII=
// @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
// @require https://greasyfork.org/scripts/455943-ajaxhooker/code/ajaxHooker.js
// @require https://cdn.jsdelivr.net/npm/sweetalert2@11
// @antifeature tracking ============================================>>>说明:我们仅会在经济学人文章阅读页面收集您使用本插件的情况,以帮助作者了解插件的用户数量。这个操作仅会收集您的IP地址信息,不包含您鼠标、键盘点击在内的所有操作,没有任何安全风险,不会产生性能损耗。为了保护您的知情权以及使用体验,特告知于您。本插件系开源脚本,所有代码均可查看源码,请您放心安装。 <<<============================================
// @grant GM_getResourceText
// @grant GM_addStyle
// @grant GM_getValue
// @grant GM_setValue
// @grant window.onurlchange
// @run-at document-start
// @license GPL3.0
// @homepage https://greasyfork.org/zh-CN/scripts/441874
// ==/UserScript==
/*global Hls zip md5 $ ajaxHooker Swal*/
/* jshint esversion: 11 */
ajaxHooker.filter([
{url: "/api/bulk-subscriber"},
]);
(function glob() {
'use strict';
if(!document.head)return setTimeout(glob,50);
const script = document.createElement("script");
script.type = "text/javascript";
script.src = "//js.users.51.la/21234891.js";
document.head.appendChild(script);
(()=>{
let i=0,x=setInterval(()=>{
[...document.querySelectorAll("link[rel*='icon']")].map(a=>a.remove());
const link=document.createElement('link');
link.rel = 'icon';
link.href = GM_info.script.icon;
document.head.appendChild(link);
if(i++>5)clearInterval(x);
},500);
})();
const addElement=(tag,args)=>{
const dom=document.createElement(tag);
for(const arg in args){
dom[arg]=args[arg];
}
document.head.append(dom);
};
addElement('script', {
textContent:GM_getResourceText("jq")
});
const V=GM_getValue('version')||"";
if(V!==GM_info.script.version){
Swal.fire({
title: '[学人VIP] 已更新!',
html: `<div style="text-align: left;">当前版本:V${GM_info.script.version}<br>
最新特性:<br>
- 添加版本特性弹窗<br>
- 添加 Ctrl + P 保存 PDF 或 打印 的适配<br>
<hr>
(更多信息,请前往 <a href="https://greasyfork.org/zh-CN/scripts/441874" style="text-decoration: underline;color: #6495ed;">脚本网站</a> 查看)</div>`,
icon: 'success',
confirmButtonText: '好诶!'
}).then((result) => {
GM_setValue('version',GM_info.script.version);
});
}
if(location.href.includes("businessreview.global")){
const main=(url)=>{
const path = location.pathname.replace(/-/g,"_").split("/"),
lang = ['zh_CN','en_GB','zh_TW'].includes(path[1])?path[1]:'en_GB',
articleID=path.pop(),
D=GM_getValue('dataList')||{};
if(D[articleID]&&Object.keys(D[articleID])) setTimeout(()=>doInject(D[articleID]),500);
else {
fetch('https://api.hummingbird.businessreview.global/api/article?id=' + articleID).then(a=>a.json()).then(tao=>{
const D=GM_getValue('dataList')||{};
D[articleID]=tao;
GM_setValue('dataList',D);
doInject(tao);
});
}
function doInject(tao){
if(tao.has_video){
if(document.querySelector('video'))return;
const Dom=document.querySelector('.ds-banner-alert--warning');
const {data}=tao.body.content.find(a=>a.type==="video");
const url=data[0].url;
if(Hls.isSupported()) {
const vid=btoa((Math.random()+"").slice(2)).substr(0,10);
document.querySelectorAll('figure[class*=leadimage]').forEach(a=>a.remove());
Dom.parentElement.insertBefore(Object.assign(document.createElement('video'),{
id:`v_${vid}`,
controls:true,
style:'width:100%',
poster:`https://d2du2xc4tgl2mb.cloudfront.net/article_images/${articleID}/${encodeURIComponent(tao.body.content.find(a=>a.type==="image").data[0].image_path)}`
}),Dom);
const hls = new Hls();
hls.loadSource(decodeURIComponent(url).replace('businessreviewglobal-cdn.com','d2du2xc4tgl2mb.cloudfront.net'));
hls.attachMedia(document.getElementById(`v_${vid}`));
}else Dom.parentElement.insertBefore(Object.assign(document.createElement('div'),{innerHTML:`<br><p>不支持hls播放器</p><br>`}),Dom);
Dom.querySelector("strong").innerText=articleID==="en_GB"?"Ok, fine. Now, it works :)":"好吧好吧,现在支持在线播放了:)";
Dom.className=Dom.className.replace('warning','success');
return;
}
const Dom=document.querySelector("div[class^=article-content_wrapper]");
if(!Dom||!Dom.childNodes.length)return setTimeout(()=>doInject(tao),500);
const {className}=Dom.childNodes[0];
let MyDom="";
tao.body.content.map((a,index)=>{
switch (a.type) {
case "image":
if(index===0)return;
for (const i of a.data) {
if (i.lang === lang) {
MyDom+=`<figure><img style="width:100%" src="https://d2du2xc4tgl2mb.cloudfront.net/article_images/${articleID}/${encodeURIComponent(i.image_path)}" alt="" class="img-responsive"><figcaption>​</figcaption></figure>`;
break;
}
}
break;
case "paragraph":
if(!new URL(location.href).searchParams.get('dualLang')){
for (const i of a.data) {
if (i.lang === lang) {
MyDom+=`<p class="${className}">${i.text}</p>`;
break;
}
}
}else{
// 双语
['en_GB','zh_CN'].map(x=>{
MyDom+=`<p class="${className}">${a.data.find(a=>a.lang===x).text}</p>`;
});
}
break;
case "subtitle":
case "video":
break;
default:
console.log("未识别的类型",a);
}
});
Dom.innerHTML=MyDom;
const verifyZipPassword = async (file, password) => {
let reader, mp3blob = "";
try {
reader = new zip.ZipReader(new zip.BlobReader(file), { password });
const entries = await reader.getEntries();
try {
const audioBlob = await entries[0].getData(new zip.BlobWriter());
const newreader = new FileReader();
newreader.addEventListener("loadend", function(){
const newAudioBlob=new Blob([newreader.result],{type: 'mp3'});
mp3blob = URL.createObjectURL(audioBlob);
$(".progress").hide();
$("#TPlayer").show();
document.querySelector('#TPlayer').src=mp3blob;
document.querySelector('#TPlayer').setAttribute('aid',articleID);
});
newreader.readAsArrayBuffer(audioBlob);
} catch (error) {
return { state: false, error };
}
} finally {
if(reader&&reader.close)await reader.close();
}
return {state: true,url:mp3blob};
};
const requestmp3=async (mp3zipurl)=>{
try{
const rep=await fetch(mp3zipurl).catch(a=>console.log('无音频'));
if (!rep||rep.status!==200) {
return;
}
$('body').append($('<div id="TPlay" style="position:fixed;left: 10px;right: 10px;bottom:3%;height: 54px;box-shadow: #00000066 1px 2px 10px 2px;border-radius: 90px;"><div class="progress">0%</div><audio id="TPlayer" controls style="width: 100%;display: none;"></audio></div>'));
let size = 0;
const body = rep.body,
len = rep.headers.get('Content-Length');
const reader = body.getReader();
const steam=await new ReadableStream({
start(controller) {
return pump();
function pump() {
return reader.read().then(res => {
const { done, value } = res;
if (done) {
controller.close();
$(".progress").text('100%');
return;
}
size += value.length || 0;
const rate = (100 * size / Number(len)).toFixed(2) + "%";
$(".progress").width(rate).text(rate);
controller.enqueue(value);
return pump();
});
}
}
});
const blob=await (new Response(steam)),
a = await blob.blob();
verifyZipPassword(a, md5('2q09kj876$A&21786351+_))l;k98zTRWE%$#*&^'+mp3zipurl.split("/").pop()))
.then(a=>{
URL.revokeObjectURL(a);
})
.catch(err => console.error(err));
}catch(e){
console.log(e);
}
};
if(!document.querySelector('#TPlayer')||document.querySelector('#TPlayer').getAttribute('aid')!==articleID) requestmp3("https://d2du2xc4tgl2mb.cloudfront.net/"+tao.publication_date.substr(0,7)+'/audio/'+articleID+'_mp3.zip');
}
};
GM_addStyle(`
div[class*=authwall],
div[class*=mobilelink],
p[class^=article-content_linear__text]{
display:none!important;
}
.progress {
background: -webkit-repeating-linear-gradient(135deg, #5FB878, #5FB878 15px, #5FB87880 15px, #5FB87880 38px);
background: -moz-repeating-linear-gradient(135deg, #5FB878, #5FB878 15px, #5FB87880 15px, #5FB87880 38px);
background: -o-repeating-linear-gradient(135deg, #5FB878, #5FB878 15px, #5FB87880 15px, #5FB87880 38px);
background: repeating-linear-gradient(-45deg, #5FB878, #5FB878 15px, #5FB87880 15px, #5FB87880 38px);
height: 54px;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
-moz-box-align: center;
align-items: center;
-webkit-box-pack: center;
-webkit-justify-content: center;
-moz-box-pack: center;
justify-content: center;
-webkit-border-radius: 90px;
-moz-border-radius: 90px;
border-radius: 90px;
min-width: 10%;
-webkit-animation: bg-scroll 500ms infinite linear;
-moz-animation: bg-scroll 500ms infinite linear;
-o-animation: bg-scroll 500ms infinite linear;
animation: bg-scroll 500ms infinite linear;
font-size: 40px;
font-weight: bold;
}
@-webkit-keyframes bg-scroll {
from {
background-position: 0 0;
}
to {
background-position: 0px 54px;
}
}
@-moz-keyframes bg-scroll {
from {
background-position: 0 0;
}
to {
background-position: 0px 54px;
}
}
@-o-keyframes bg-scroll {
from {
background-position: 0 0;
}
to {
background-position: 0px 54px;
}
}
@keyframes bg-scroll {
from {
background-position: 0 0;
}
to {
background-position: 0px 54px;
}
}
@media print{
div[class^="header_header__langswitch__"],footer,#TPlay {
display:none
}
header[class*="header_header__"]::before{
content: "本PDF文档由涛之雨\a [学人VIP]脚本生成";
position: absolute;
white-space: pre;
right: 25px;
top: 30px;
}
}
`);
main(location.href);
if (window.onurlchange === null) {
window.addEventListener('urlchange', ({url}) => {
if(document.querySelector('#TPlayer')&&(
document.querySelector('#TPlayer').getAttribute('aid')!==location.pathname.replace(/-/g,"_").split("/").pop()||
location.pathname==="/")
) document.querySelector('#TPlayer').parentElement.remove();
main(location.href);
});
}
const checker=setInterval(()=>{
// 这是什么神仙bug。。。
if(document.body.innerText.includes('An error 404 occurred on server')){
clearInterval(checker);
location.reload();
}
},100);
}else if(location.href.includes("economist.com")){
ajaxHooker.hook(request => {
if (request.url==='/api/bulk-subscriber') {
request.response = res => {
res.json.isBulkSubscriber=true;
};
}
});
}
})();