FileCR 助手

一键获取FileCR的软件下载链接(包括快速下载),无需拓展即可访问premium内容。

  1. // ==UserScript==
  2. // @name FileCR Assistant Bypass & Helper
  3. // @name:zh-CN FileCR 助手
  4. // @name:zh-TW FileCR 助手
  5. // @namespace xiakele
  6. // @version 2.2
  7.  
  8. // @description extracts software download links (including 'fast download' URLs) and provides access to premium contents.
  9. // @description:zh-CN 一键获取FileCR的软件下载链接(包括快速下载),无需拓展即可访问premium内容。
  10. // @description:zh-TW 一鍵取得FileCR的軟體下載連結(包括快速下載),無需拓展即可存取premium內容。
  11. // @author xiakele
  12. // @license MIT
  13. // @match *://filecr.com/*
  14. // @icon https://filecr.com/favicon.png
  15. // @grant window.onurlchange
  16. // ==/UserScript==
  17.  
  18. (function () {
  19. const versionInfo = {
  20. id: 'ddgilliopjknmglnpkegbjpoilgachlm',
  21. version: '9.9.9',
  22. };
  23.  
  24. if (!document.cookie.includes('extensionIsInstalled')) {
  25. document.cookie = 'extensionIsInstalled=true; expire=Fri, 01 Jan 2077 00:00:00 GMT';
  26. }
  27.  
  28. window.addEventListener(
  29. 'message',
  30. event => {
  31. const data = {
  32. direction: 'from-content-script',
  33. responseFor: event.data.id,
  34. type: 'response',
  35. };
  36. if (event.data.id === 'install-check') {
  37. data.data = null;
  38. window.postMessage(data);
  39. return;
  40. }
  41.  
  42. switch (event.data.action) {
  43. case 'app.info': {
  44. data.data = versionInfo;
  45. break;
  46. }
  47.  
  48. case 'downloads.extractLink': {
  49. data.data = event.data.data.url;
  50. break;
  51. }
  52.  
  53. case 'favorites.has': {
  54. data.data = false;
  55. break;
  56. }
  57.  
  58. default: {
  59. return;
  60. }
  61. }
  62.  
  63. window.postMessage(data);
  64. },
  65. );
  66.  
  67. async function getLinks(meta) {
  68. if (['Torrent', 'Internal'].includes(meta.type)) {
  69. return fetch(`/api/actions/downloadlink/?id=${meta.id}`)
  70. .then(data => data.json())
  71. .then(json => ({provider: meta.type, url: json.url}));
  72. }
  73.  
  74. return fetch(`https://filecr.com/api/actions/worker/?link_id=${meta.id}`)
  75. .then(data => data.json())
  76. .then(json => ({provider: json.download_provider, url: json.url}));
  77. }
  78.  
  79. async function displayLinks(json) {
  80. if (document.querySelector('#link-field')) {
  81. return;
  82. }
  83.  
  84. const trigger = document.querySelector('#trigger');
  85. const div = document.createElement('div');
  86. div.id = 'link-field';
  87. document.querySelector('.download-info').append(div);
  88. trigger.innerHTML = 'Loading...';
  89. const linksMeta = json.props.pageProps.post.downloads[0].links;
  90. const downloadLinks = await Promise.all(linksMeta.map(meta => getLinks(meta)));
  91. for (const [i, link] of downloadLinks.entries()) {
  92. const a = document.createElement('a');
  93. a.href = link.url;
  94. a.classList.add('link-light');
  95. a.innerHTML = `Link ${i + 1} (${link.provider})\n`;
  96. div.append(a);
  97. }
  98.  
  99. trigger.innerHTML = 'COMPLETE!';
  100. }
  101.  
  102. let reloaded = false;
  103. function addTrigger() {
  104. if (document.querySelector('.e-404') && !reloaded) {
  105. reloaded = true;
  106. window.location.reload();
  107. }
  108.  
  109. if (!document.querySelector('.download-info') || document.querySelector('#trigger')) {
  110. return;
  111. }
  112.  
  113. const rawJSON = JSON.parse(document.querySelector('#__NEXT_DATA__').textContent);
  114. const a = document.createElement('a');
  115. a.id = 'trigger';
  116. a.innerHTML = 'GET DOWNLOAD LINKS';
  117. a.classList.add('link-light');
  118. if (window.location.pathname.includes(rawJSON.query.postSlug)) {
  119. a.addEventListener('click', () => displayLinks(rawJSON));
  120. } else {
  121. a.addEventListener('click', () => window.location.reload());
  122. a.innerHTML += '<br>(Data mismatch. Reload is required.)';
  123. }
  124.  
  125. document.querySelector('.download-info').append(a);
  126. }
  127.  
  128. addTrigger();
  129. if (window.onurlchange === null) {
  130. window.addEventListener('urlchange', () => addTrigger());
  131. } else {
  132. const observer = new MutationObserver(() => addTrigger());
  133. observer.observe(document.head, {childList: true});
  134. }
  135. })();

QingJ © 2025

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