小猴皮皮点读笔下载地址获取

小猴皮皮的资源下载网站(https)使用了http的资源链接,导致下载不正常。现将资源的下载链接提取出来,附在页面上,点击即可下载。

  1. // ==UserScript==
  2. // @name 小猴皮皮点读笔下载地址获取
  3. // @namespace https://github.com/tsccai
  4. // @version 0.1
  5. // @description 小猴皮皮的资源下载网站(https)使用了http的资源链接,导致下载不正常。现将资源的下载链接提取出来,附在页面上,点击即可下载。
  6. // @author Tsccai
  7. // @match https://piyopen.lovereadingbooks.com/content/*
  8. // @icon https://www.lovereadingbooks.com/themes/contrib/bootstrap/logo.svg
  9. // @license MIT
  10. // @grant GM_openInTab
  11. // ==/UserScript==
  12.  
  13. (function () {
  14. 'use strict';
  15. const RES_BASE_URL = 'https://p.lovereadingbooks.com/api/v1/content?_format=json&page=0&id=';
  16. const id = window.location.pathname.replace('/content/', '');
  17. getLinks();
  18. async function getLinks() {
  19.  
  20. const json = await (await fetch(RES_BASE_URL + id)).json();
  21. //console.log(json);
  22. const ele_books = document.querySelectorAll('.ant-list-item-main');
  23. let cnt = 0;
  24. for (let i of ele_books) {
  25.  
  26. const anchor = document.createElement('a');
  27. anchor.target = ":blank";
  28. anchor.innerHTML = i.querySelector('i').innerHTML.replace('currentColor', 'red');
  29. //anchor.innerHTML = anchor.innerHTML.replace('currentColor','red');
  30. //anchor.innerHTML='真下载地址';
  31. anchor.href = json[cnt].fileUrl;
  32. anchor.addEventListener('click', startDownload);
  33. i.querySelector('i').remove();
  34. i.querySelector('.ant-list-item-action span').appendChild(anchor);
  35. cnt++;
  36. }
  37. cnt = 0;
  38.  
  39.  
  40. function startDownload(evt) {
  41. const url = evt.target.parentElement.href;
  42. GM_openInTab(url);
  43. }
  44. }
  45.  
  46. })();

QingJ © 2025

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