Pagetual

Perpetual pages - powerful auto-pager script. Auto fetching next paginated web pages and inserting into current page for infinite scroll. Support thousands of web sites without any rule.

< Feedback on Pagetual

Review: Good - script works

§
Posted: 14.09.2024

【NSFW】jabletv翻页错误
测试链接:https://jable.tv/search/%E6%B1%BD%E8%BB%8A/4/
版本:1.9.37.100
环境:FIREFOX128 + 暴力猴2.20

问题描述:无论你当前页面是第几页,自动翻页加载的页码永远是第一页。

hoothinAuthor
§
Posted: 14.09.2024

试试这个

{
    "name": "Jable",
    "author": "skofkyo",
    "example": "https://jable.tv/new-release/",
    "url": "^https?://(jable|fs1)\\.(tv|app)/",
    "nextLinkByJs": "let checked=doc.querySelector('li.active>a');let blockId=checked.dataset.blockId;let sortBy=checked.dataset.parameters?.replace('sort_by:','');let page=doc.querySelector('.page-link.active').innerText;return `?mode=async&function=get_block&block_id=${blockId}&sort_by=${sortBy}&from=${parseInt(page)+1}`;",
    "pageElement": "section>.row",
    "replaceElement": ".pagination",
    "action": 0,
    "refreshByClick": "[data-action='ajax']"
}
§
Posted: 14.09.2024

搜索參數多一個q,這樣寫應該比較通用,手機上編輯尚未在永頁機測試。

let next = document.querySelector('.container li.active>a,.container li:has(>.active)+li>a');
let blockId = next.dataset.blockId;
let parameters = next.dataset.parameters;
let dataArr = parameters.split(';').filter(e => e).map(e => e.split(':'));
let dataObj = {};
for (let [k, v] of dataArr) {
    dataObj[k] = v;
}
new URLSearchParams({
    mode: 'async',
    function: 'get_block',
    block_id: blockId,
    ...dataObj
}).toString();
§
Posted: 14.09.2024

试试这个

{
    "name": "Jable",
    "author": "skofkyo",
    "example": "https://jable.tv/new-release/",
    "url": "^https?://(jable|fs1)\\.(tv|app)/",
    "nextLinkByJs": "let checked=doc.querySelector('li.active>a');let blockId=checked.dataset.blockId;let sortBy=checked.dataset.parameters?.replace('sort_by:','');let page=doc.querySelector('.page-link.active').innerText;return `?mode=async&function=get_block&block_id=${blockId}&sort_by=${sortBy}&from=${parseInt(page)+1}`;",
    "pageElement": "section>.row",
    "replaceElement": ".pagination",
    "action": 0,
    "refreshByClick": "[data-action='ajax']"
}
导入

这个有效!但是一时间翻页太快,会被禁IP,可能需要加个延时。

§
Posted: 14.09.2024

搜索參數多一個q,這樣寫應該比較通用,手機上編輯尚未在永頁機測試。

let next = document.querySelector('.container li.active>a,.container li:has(>.active)+li>a');
let blockId = next.dataset.blockId;
let parameters = next.dataset.parameters;
let dataArr = parameters.split(';').filter(e => e).map(e => e.split(':'));
let dataObj = {};
for (let [k, v] of dataArr) {
    dataObj[k] = v;
}
new URLSearchParams({
    mode: 'async',
    function: 'get_block',
    block_id: blockId,
    ...dataObj
}).toString();

这个我测试没有效果

§
Posted: 14.09.2024

搜索參數多一個q,這樣寫應該比較通用,手機上編輯尚未在永頁機測試。

let next = document.querySelector('.container li.active>a,.container li:has(>.active)+li>a');
let blockId = next.dataset.blockId;
let parameters = next.dataset.parameters;
let dataArr = parameters.split(';').filter(e => e).map(e => e.split(':'));
let dataObj = {};
for (let [k, v] of dataArr) {
    dataObj[k] = v;
}
new URLSearchParams({
    mode: 'async',
    function: 'get_block',
    block_id: blockId,
    ...dataObj
}).toString();

这个我测试没有效果

這只是主控台用來測試生成下一頁API的代碼而已,並非完整的永頁機規則。

§
Posted: 14.09.2024

搜索參數多一個q,這樣寫應該比較通用,手機上編輯尚未在永頁機測試。

let next = document.querySelector('.container li.active>a,.container li:has(>.active)+li>a');
let blockId = next.dataset.blockId;
let parameters = next.dataset.parameters;
let dataArr = parameters.split(';').filter(e => e).map(e => e.split(':'));
let dataObj = {};
for (let [k, v] of dataArr) {
    dataObj[k] = v;
}
new URLSearchParams({
    mode: 'async',
    function: 'get_block',
    block_id: blockId,
    ...dataObj
}).toString();

这个我测试没有效果

這只是主控台用來測試生成下一頁API的代碼而已,並非完整的永頁機規則。

我是将你这段代码粘贴进 作者“nextLinkByJs”语句中的。

§
Posted: 14.09.2024

我是将你这段代码粘贴进 作者“nextLinkByJs”语句中的。

就說是主控台測試用的,不能直接放進nextLinkByJs。
還要改document為doc,加if判斷next,加return返回api字串。

有空摸電腦寫規則,會在這貼上完整規則的。

§
Posted: 14.09.2024

加了2秒延遲

{
    "name": "Jable",
    "author": "skofkyo",
    "example": "https://jable.tv/new-release/",
    "url": "^https?://(jable\\.tv|fs1\\.app)/",
    "action": 0,
    "refreshByClick": "[data-action='ajax']",
    "nextLinkByJs": "let next=doc.querySelector('.container li.active>a,.container li:has(>.active)+li>a');if(next){let blockId=next.dataset.blockId;let parameters=next.dataset.parameters;let dataArr=parameters.split(';').filter(e=>e).map(e=>e.split(':'));let dataObj={mode:'async',function:'get_block',block_id:blockId};for(let[k,v]of dataArr){dataObj[k]=decodeURIComponent(v)}return`?${new URLSearchParams(dataObj)}`}else{return null}",
    "pageElement": "section>.row",
    "replaceElement": ".pagination",
    "pageAction": "let ps=[...document.querySelectorAll('section>.row')];let last=ps.at(-1);last.querySelectorAll('.img-box>a').forEach(a=>{a.onmouseenter=e=>{let v=document.createElement('video');let img=a.querySelector('img');let src=img.dataset.preview;$(v).attr({loop:'',autoplay:'',src:src});$(v).css({position:'absolute',left:'0',top:'0',width:img.offsetWidth+'px',height:img.offsetHeight+'px',background:'#000000',visibility:'visible'});a.appendChild(v)};a.onmouseleave=e=>{a.querySelector('video').remove()}})",
    "sleep": 2000,
    "css": ".pagetual_pageBar{margin-top:0px!important;margin-bottom:20px!important}"
}
§
Posted: 15.09.2024

加了2秒延遲

{
    "name": "Jable",
    "author": "skofkyo",
    "example": "https://jable.tv/new-release/",
    "url": "^https?://(jable\\.tv|fs1\\.app)/",
    "action": 0,
    "refreshByClick": "[data-action='ajax']",
    "nextLinkByJs": "let next=doc.querySelector('.container li.active>a,.container li:has(>.active)+li>a');if(next){let blockId=next.dataset.blockId;let parameters=next.dataset.parameters;let dataArr=parameters.split(';').filter(e=>e).map(e=>e.split(':'));let dataObj={mode:'async',function:'get_block',block_id:blockId};for(let[k,v]of dataArr){dataObj[k]=decodeURIComponent(v)}return`?${new URLSearchParams(dataObj)}`}else{return null}",
    "pageElement": "section>.row",
    "replaceElement": ".pagination",
    "pageAction": "let ps=[...document.querySelectorAll('section>.row')];let last=ps.at(-1);last.querySelectorAll('.img-box>a').forEach(a=>{a.onmouseenter=e=>{let v=document.createElement('video');let img=a.querySelector('img');let src=img.dataset.preview;$(v).attr({loop:'',autoplay:'',src:src});$(v).css({position:'absolute',left:'0',top:'0',width:img.offsetWidth+'px',height:img.offsetHeight+'px',background:'#000000',visibility:'visible'});a.appendChild(v)};a.onmouseleave=e=>{a.querySelector('video').remove()}})",
    "sleep": 2000,
    "css": ".pagetual_pageBar{margin-top:0px!important;margin-bottom:20px!important}"
}
导入

感谢,经测试有效!

Post reply

Sign in to post a reply.