【问题标题】:uTorrent API add url giving 400 invalid requestuTorrent API 添加 url 给出 400 无效请求
【发布时间】:2014-03-31 12:51:11
【问题描述】:

为什么它对以下代码给出 400 错误请求。我们想使用 utorrent 的 Web API 来安排一个 torrent。

import urllib2, base64

username = "username"
password = "password"

request = urllib2.Request("http://<my_ip>:<torrent_webapi_port>/gui/?action=add-url&s=%s" % urllib2.quote("http://torcache.net/torrent/CDADFE86960C3255EB37B15F7E45C281F3A3C937.torrent?title=[kickass.to]arrow.s02e14.hdtv.x264.lol.ettv"))
base64string = base64.encodestring('%s:%s' % (username, password)).replace('\n', '')
request.add_header("Authorization", "Basic %s" % base64string)
result = urllib2.urlopen(request)
print result.read()

【问题讨论】:

    标签: asp.net-web-api utorrent


    【解决方案1】:

    请阅读以下令牌认证系统。

    您应该在所有请求中发送一个名为“token=”的额外参数。 您可以从

    获取token_value

    http://:utorrent_web_api_port/gui/token.html

    http://www.utorrent.com/community/developers/webapi#devs4

    下面的链接给出了详细的解释。

    https://github.com/bittorrent/webui/wiki/TokenSystem

    【讨论】:

      猜你喜欢
      • 2014-12-11
      • 2017-11-11
      • 1970-01-01
      • 2017-03-12
      • 2018-06-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多