百度贴吧科学看图君

去除百度贴吧的连续看图模式,改为点击新标签打开无水印原图,同时支持帖子预览中“查看大图”按钮。

< Feedback on 百度贴吧科学看图君

Question/comment

§
Posted: 2022-09-27

废了,尾缀多了一串像MD5的东东,
比如
https://tiebapic.baidu.com/forum/pic/item/b1576994d143ad4b75ce8819c7025aafa60f06e9.jpg?tbpicau=2022-09-30-05_316419da6cb7afc86b9a4b72811afd97

在原页拿不到316419da6cb7afc86b9a4b72811afd97这串东西

§
Posted: 2022-09-27
Edited: 2022-09-27

从隔壁抄了点代码

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    // 帖子
    $(document).on('mousedown', '.BDE_Image', function () {
        $(this).off('click');

        this.onclick = function(e){
            if (e.button == 0) {
                let url = null;
                let tSrc = /https?:\/\/(\w+)\.baidu\.com\/.+\/(\w+\.[a-zA-Z]{3,4}([^_]*_?))/.exec(this.src);
                if(tSrc && tSrc[3]){
                    var tiebaTid = /\d+/.exec(location.pathname)[0];
                    var xhttp = new XMLHttpRequest();
                    xhttp.onreadystatechange = function() {
                        if (this.readyState == 4 && this.status == 200) {
                            url = JSON.parse(this.responseText).data.img.original.waterurl;
                            window.open(url);
                        }
                    };
                    tSrc = /(\w+)/.exec(tSrc[2])[0];
                    xhttp.open("GET", "https://tieba.baidu.com/photo/p?alt=jview&pic_id="+tSrc+"&tid="+tiebaTid, true);
                    xhttp.send();
                }else{
                    url = tSrc ? `//${tSrc[1]}.baidu.com/forum/pic/item/${tSrc[2]}` : t.src;
                }

                if(url) window.open(url);
            }
        }
    });
jiayimingAuthor
§
Posted: 2022-09-30

这睿智网站蒸鹅心 没时间仔细看刚瞎改了下好像能凑活用

Post reply

Sign in to post a reply.