diff --git a/tieba page.js b/tieba page.js index 03bc193..5ad729a 100644 --- a/tieba page.js +++ b/tieba page.js @@ -400,8 +400,11 @@ let src = video.getAttribute('data-vhsrc'); let img = video.querySelector('img'); let hr = video.getAttribute('data-vsrc'); - if (src) { + let t = video.parentElement.querySelector('.net_search_url'); + if (t) { + src = t.dataset.vhsrc + } video.outerHTML = ``; } else if (hr && hr.indexOf('bilibili.com') > -1) { let av = hr.match(/av(\d+)/)[1] @@ -707,7 +710,6 @@ let u = document.createElement('div'); u.innerHTML = ul; let lis = u.querySelectorAll('li.j_thread_list'); - if (lis.length > 0) { lis.forEach(li => { let time = li.querySelector('.is_show_create_time'); @@ -719,10 +721,11 @@ if (tid !== null || tid !== 'null') { let tar = document.querySelector('li[data-tid="' + tid + '"] .ti_author_icons'); let ttt = document.querySelector('li[data-tid="' + tid + '"] .ti_time'); + if (!tar) { return; } - let ki = li.querySelector('span[class="tb_icon_author_rely j_replyer"]'); + let ki = li.querySelector('.tb_icon_author_rely'); if (!ki) { return; } @@ -792,12 +795,29 @@ let observer = new MutationObserver((mutations) => { if (mutations.length > 0) { createTime(); + op(); slio(document.querySelectorAll('#frslistcontent>li')); } }); observer.observe(list, { childList: true, }); + + function op() { + let lis = document.querySelectorAll('li.tl_shadow>a.ti_item'); + if (lis.length > 0) { + lis.forEach(value => { + let url = `mo/q/m?kz=${value.dataset.tid}`; + let w = value.querySelector('.ti_icon_huati'); + if (w) { + url += '&post_type=normal&' + } + value.href = url; + }) + } + } + + op(); } function ft(event) { @@ -851,7 +871,7 @@ function lzl() { let kz = document.querySelector('html').innerHTML.match(/kz: "(\d+)"/)[1]; - let url = `/p/${kz}`; + let url = `/mo/q?kz=${kz}`; $.ajax({ url: url, async: false, @@ -859,6 +879,9 @@ success: (res) => { let html = (new DOMParser()).parseFromString(res, 'text/html'); let lz = html.querySelector('#pblist li') + if (!lz) { + debugger + } window.lz = JSON.parse(lz.dataset.info) } }) @@ -875,6 +898,10 @@ } function detail() { + let title = document.querySelector('.post_title_text'); + if (title) { + // title.href=title.href.replace('f?kw=','mo/q/m?word=') + } god(); p(); reply(); @@ -1186,11 +1213,17 @@ document.querySelector('body').appendChild(d); } + try { if (!check()) { return; } + let x = location.href.match(/\/p\/(\d+)(\?|\#)?/); + if (x) { + location.href = `/mo/q/m?kz=${x[1]}`; + return; + } fnav(); clickControl(); let css = document.createElement('style'); @@ -1206,9 +1239,14 @@ .floor_footer_item .user_name,.floor_footer_item .user_name:visited { color:#125bc7; } .floor_content a,.floor_content a:visited { color:#498bef; } .fr_list .list_item_floor:nth-child(odd){ background-color:rgba(180, 228, 207, 0.2); } - .fr_list .list_item_floor:nth-child(even){ background-color:rgba(168, 191, 157, 0.16); } + .fr_list .list_item_floor:nth-child(even){ background-color:rgba(168, 191, 157, 0.16); } + .nav-bar-wrapper { display:none; } + .tb-threadlist__item.tb-banner { display:none; } + .tb-threadlist__item.tb-hotthread-wrapper{ display:none; } + `; document.querySelector('head').append(css); + //debugger delElement(['.ui_image_header_bottom']);