Git Product home page Git Product logo

Comments (6)

jiang925 avatar jiang925 commented on July 20, 2024 1

我用的zip安装模式。找到一个临时补救方法。

resource/sites/xp.m-team.cc/getUserSeedingTorrents.js文件里的load()改成下面的样子。隔几秒重试一次。只是个临时的补救。如果请求一直被屏蔽的话,这个方法会导致无限重试。

    /**
     * 加载当前页内容
     */
    load() {
      let url = this.dataURL;
      let postData = this.options.rule.requestData;
      postData.pageNumber = this.pageInfo.current + 1;

      function makeRequest() {
        $.ajax({
          url,
          method: "POST",
          dataType: "JSON",
          data: JSON.stringify(postData),
          contentType: "application/json",
          headers: this.options.rule.headers
        })
          .done(result => {
            try {
              this.rawData = result;
              if (this.rawData.data.data.length > 0) {
                this.parse();
              } else {
                this.done();
              }
            } catch (error) {
              console.error('Error processing mt load result:', error);
              setTimeout(() => {
                makeRequest.call(this);
              }, 8000);
            }
          })
          .fail(() => {
            this.done();
          });
      }

      makeRequest.call(this);
    }

下面这个加了次数限制。但我没有深入测试。。

function makeRequest(retryCount = 0) {
  $.ajax({
    url,
    method: "POST",
    dataType: "JSON",
    data: JSON.stringify(postData),
    contentType: "application/json",
    headers: this.options.rule.headers
  })
    .done(result => {
      try {
        this.rawData = result;
        if (this.rawData.data.data.length > 0) {
          this.parse();
        } else {
          this.done();
        }
      } catch (error) {
        console.error('Error processing result:', error);
        if (retryCount < 2) {
          setTimeout(() => {
            makeRequest.call(this, retryCount + 1);
          }, 8000);
        } else {
          this.done();
        }
      }
    })
    .fail(() => {
      this.done();
    });
}

// Call the function for the first time
makeRequest.call(this);

from pt-plugin-plus.

ted423 avatar ted423 commented on July 20, 2024

Mit | Snow on the beach, [2024/7/3 16:44]
你的保种太多就容易不成功

游戏真有意思, [2024/7/3 16:44]
所以是保种太多丢了一堆请求过去?

Mit | Snow on the beach, [2024/7/3 16:44]
一次请求不完 就第二次第三次

from pt-plugin-plus.

ted423 avatar ted423 commented on July 20, 2024

image

from pt-plugin-plus.

ted423 avatar ted423 commented on July 20, 2024

@jiang925 无限千万不行,到时候指不定号就没了

from pt-plugin-plus.

jiang925 avatar jiang925 commented on July 20, 2024

@jiang925 无限千万不行,到时候指不定号就没了

明白。只能临时用一下。我打算手动刷新的时候,如果看一直重试,刷新一下页面就可以终止重试。不过提醒了我,如果半夜自动刷新的时候无限重试的话就可能会跪。

又多测试了一下后面带retry的。在try里面强制生成了一个错误。测试可以retry两次后停止。

from pt-plugin-plus.

trim21 avatar trim21 commented on July 20, 2024

建议你每天去馒头群问问什么时候有统计做种情况的api

from pt-plugin-plus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.