快速跳转bangumi排行榜最后一页

分别以雷锋的故事(subject/6476),我的英雄学院(subject/122003),White Wings 白色之翼(subject/310476),英雄 命运之诗(subject/217123),特利迦奥特曼 新世代迪迦(subject/333282)为锚点定位排行榜最后一页

  1. // ==UserScript==
  2. // @name 快速跳转bangumi排行榜最后一页
  3. // @namespace https://github.com/bangumi/scripts/tree/master/liaune
  4. // @version 0.3
  5. // @description 分别以雷锋的故事(subject/6476),我的英雄学院(subject/122003),White Wings 白色之翼(subject/310476),英雄 命运之诗(subject/217123),特利迦奥特曼 新世代迪迦(subject/333282)为锚点定位排行榜最后一页
  6. // @author Liaune
  7. // @license MIT
  8. // @include /^https?://(bgm\.tv|chii\.in|bangumi\.tv)/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. if(location.href.match(/(anime|book|game|music|real)\/browser(\/platform\/all\?|\?)sort=rank/)){
  14. const ids = {"anime":"6476","book":"122003","game":"310476","music":"217123","real":"333282"};
  15. var type = location.href.match(/(anime|book|game|music|real)\/browser.*\?sort=rank/)[1];
  16. $.get(`https://api.bgm.tv/subject/${ids[type]}`,(data)=>{
  17. var max_page = Math.ceil(data.rank/24);
  18. var lastpage = location.origin+location.href.match(/\/(anime|book|game|music|real)\/browser.*\?sort=rank/)[0]+'&page='+max_page;
  19. $('#columnSubjectBrowserA .section .page_inner a.p').last()[0].href = lastpage;
  20. var current_page = location.href.match(/sort=rank&page=(\d+)/)?location.href.match(/sort=rank&page=(\d+)/)[1]:1;
  21. $('#columnSubjectBrowserA .section .page_inner .p_edge')[0].textContent = `( ${current_page} / ${max_page} )`;
  22. $('#columnSubjectBrowserA .section .page_inner a.p').each( (i,e) => {
  23. if(parseInt(e.text)>max_page) $(e).hide();
  24. });
  25. },"json");
  26. }
  27. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址