解決arxiv.org打開pdf緩慢問題


由於之前在學校都是使用的校園網,在家了去arxiv.org看篇文章,結果中途就掛掉了,不加載了,綜合百度的方法,提供一下方法:

1、中科院有arxiv的鏡像地址:cn.arxiv.org,備用地址:xxx.itp.ac.cn。我們可以將arxiv.org/pdf/2002.02256.pdf都轉換成cn.arxiv.org/pdf/2002.02256.pdf或xxx.itp.ac.cn/pdf/2002.02256.pdf。第一種我試的時候不行,選擇第二個地址。

2、我們每次都要手動更改地址會很麻煩,可以利用tampermonkey+腳本的方式來解決。

3、tampermonkey是一個管理瀏覽器腳本的插件,它可以做很多東西,具體怎么安裝就不說明了。

4、安裝完成之后,以UC瀏覽器為例,可以看到右上角有個圖標:,左鍵點擊它:

點擊獲取新腳本:

將里面代碼替換為:

// ==UserScript==
// @name        Redirect arxiv.org to CN.arxiv.org/pdf
// @namespace   uso2usom
// @description On any web page it will check if the clicked links goes to arxiv.org. If so, the link will be rewritten to point to cn.arxiv.org
// @include     http://*.*
// @include     https://*.*
// @version     1.2
// @grant       none
// ==/UserScript==

// This is a slightly brute force solution, but there is no other way to do it using only a userscript.

// Release Notes

// version 1.2
// Focus on pdf link only!
// Add '.pdf' link  automatically. Convenient for saving as pdf.

// version 1.1
// Redirect arxiv.org to CN.arxiv.org

document.body.addEventListener('mousedown', function(e){
    var targ = e.target || e.srcElement;
    if ( targ && targ.href && targ.href.match(/https?:\/\/arxiv.org\/pdf/) ) {
        targ.href = targ.href.replace(/https?:\/\/arxiv\.org/, 'http:/xxx.itp.ac.cn');
    }
    if ( targ && targ.href && targ.href.match(/http?:\/\/arxiv.org\/pdf/) ) {
        targ.href = targ.href.replace(/http?:\/\/arxiv\.org/, 'http://xxx.itp.ac.cn');
    }
    if ( targ && targ.href && targ.href.match(/https?:\/\/arxiv.org\/abs/) ) {
        targ.href = targ.href.replace(/https?:\/\/arxiv\.org\/abs/, 'http://xxx.itp.ac.cn/pdf');
    }
    if ( targ && targ.href && targ.href.match(/http?:\/\/arxiv.org\/abs/) ) {
        targ.href = targ.href.replace(/http?:\/\/arxiv\.org\/abs/, 'http:/xxx.itp.ac.cn/pdf');
    }
    if (targ && targ.href && targ.href.match(/http?:\/\/xxx.itp.ac.cn\/pdf/) && !targ.href.match(/\.pdf/) )
    {
       targ.href = targ.href + '.pdf';
    }
});

該段代碼會將arxiv.org之類的替換為xxx.itp.ac.cn。然后點擊文件--保存即可。成功之后:

之前的兩個是我以前安裝的百度網盤直接下載和破解愛奇藝、優酷、BILIBILI等會員時安的。我們注意第三個,是我們剛剛安裝的。

我們測試一篇文章:

NIPS 2016 Tutorial: Generative Adversarial Networks

點擊pdf:

完成。有時候還是不穩定,聽天由命了。

還有一種方式是使用URLRedirector - 重定向插件,我沒試過,有想法的可以去試一下。

參考了:

https://www.jianshu.com/p/184799230f20

https://blog.csdn.net/seasermy/article/details/95176357

https://chromecj.com/productivity/2019-01/1697.html 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM