gpt4 book ai didi

http - 获得正确的 HTTP 范围,以便 Down Them All 有效

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:20:11 24 4
gpt4 key购买 nike

我构建了一个网络应用程序,它应该以下载的形式提供录制的电视(对于那些大喊这是非法的人,我可以告诉他们:在德国它不是,如果你做对了)。您可以在 http://niklasfi.de:8080 查看该项目。 .

现在谈谈我的问题:下载 + 恢复适用于普通 firefox。但是我遇到了一些下载管理器的问题。所以我想知道为什么。我认为这与我的 HTTP 错误或其他原因有关。

当客户端想要下载某些东西时,它首先会得到一张票(在我们的例子中是 45729410)并重定向到实际的下载链接。

GET /createTicketFor/Matrix_Revolutions_11.02.13_22-30_pro7_155_TVOON_DE.mpg.avi.otrkey HTTP/1.1
Host: niklasfi.de:8080
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:2.0b12pre) Gecko/20110216 Firefox/4.0b12pre
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: de-de,de;q=0.8,en;q=0.7,en-gb;q=0.5,en-au;q=0.3,en-us;q=0.2
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Referer: http://niklasfi.de:8080/

HTTP/1.1 302 Moved Temporarily
location: /download/45729410
Connection: keep-alive
Transfer-Encoding: chunked

之后 firefox 向下载链接发送获取请求(这是在为您提供下载选项(打开方式、下载、downThaOneClick)时完成的)

GET /download/45729410 HTTP/1.1
Host: niklasfi.de:8080
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:2.0b12pre) Gecko/20110216 Firefox/4.0b12pre
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: de-de,de;q=0.8,en;q=0.7,en-gb;q=0.5,en-au;q=0.3,en-us;q=0.2
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Referer: http://niklasfi.de:8080/

HTTP/1.1 200 OK
Content-Type: application/octet-stream
Content-Disposition: attachment; filename=Matrix_Revolutions_11.02.13_22-30_pro7_155_TVOON_DE.mpg.avi.otrkey
Content-Length: 1428013574
Connection: keep-alive

我选择了后者,所以 Down them All 开始 4 次下载:

=== DTA.1 ===
GET /download/45729410 HTTP/1.1
Host: niklasfi.de:8080
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:2.0b12pre) Gecko/20110216 Firefox/4.0b12pre
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8, application/metalink4+xml;q=0.9,application/metalink+xml;q=0.8
Accept-Language: de-de,de;q=0.8,en;q=0.7,en-gb;q=0.5,en-au;q=0.3,en-us;q=0.2
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: close
Referer: http://niklasfi.de:8080/
Want-Digest: SHA512;q=0.9, SHA256;q=0.7, SHA, SHA1;q=0.5, MD5;q=0.3
Pragma: no-cache
Cache-Control: no-cache

HTTP/1.1 200 OK
Content-Type: application/octet-stream
Content-Disposition: attachment; filename=Matrix_Revolutions_11.02.13_22-30_pro7_155_TVOON_DE.mpg.avi.otrkey
Content-Length: 1428013574
Connection: close

=== DTA.2 ===
GET /download/45729410 HTTP/1.1
Host: niklasfi.de:8080
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:2.0b12pre) Gecko/20110216 Firefox/4.0b12pre
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: de-de,de;q=0.8,en;q=0.7,en-gb;q=0.5,en-au;q=0.3,en-us;q=0.2
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: close
Range: bytes=714610068-
Referer: http://niklasfi.de:8080/
Pragma: no-cache
Cache-Control: no-cache

HTTP/1.1 200 OK
Content-Type: application/octet-stream
Content-Disposition: attachment; filename=Matrix_Revolutions_11.02.13_22-30_pro7_155_TVOON_DE.mpg.avi.otrkey
Content-Length: 1428013574
Content-Range: bytes 714610068-1428013573/1428013574
Connection: close

=== DTA.3 ===
GET /download/45729410 HTTP/1.1
Host: niklasfi.de:8080
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:2.0b12pre) Gecko/20110216 Firefox/4.0b12pre
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: de-de,de;q=0.8,en;q=0.7,en-gb;q=0.5,en-au;q=0.3,en-us;q=0.2
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: close
Range: bytes=357908315-
Referer: http://niklasfi.de:8080/
Pragma: no-cache
Cache-Control: no-cache

HTTP/1.1 200 OK
Content-Type: application/octet-stream
Content-Disposition: attachment; filename=Matrix_Revolutions_11.02.13_22-30_pro7_155_TVOON_DE.mpg.avi.otrkey
Content-Length: 1428013574
Content-Range: bytes 357908315-1428013573/1428013574
Connection: close

=== DTA.4 ===
GET /download/45729410 HTTP/1.1
Host: niklasfi.de:8080
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:2.0b12pre) Gecko/20110216 Firefox/4.0b12pre
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: de-de,de;q=0.8,en;q=0.7,en-gb;q=0.5,en-au;q=0.3,en-us;q=0.2
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: close
Range: bytes=1071311822-
Referer: http://niklasfi.de:8080/
Pragma: no-cache
Cache-Control: no-cache

HTTP/1.1 200 OK
Content-Type: application/octet-stream
Content-Disposition: attachment; filename=Matrix_Revolutions_11.02.13_22-30_pro7_155_TVOON_DE.mpg.avi.otrkey
Content-Length: 1428013574
Content-Range: bytes 1071311822-1428013573/1428013574
Connection: close

让我奇怪的是,所有请求的 Range header 都没有给出终点。 DTA 应该有所需的信息,因为它“知道”它必须从哪里开始其他三个请求。

到目前为止一切顺利。一切正常。但不是! DTA 取消最后 3 个请求。 这是为什么?

这还算不错,因为我仍然可以暂停下载,这正是我想要的。事实上,让我们现在就这样做。我单击“暂停”按钮。在恢复时发送以下两个请求:

=== RESTART ===
GET /download/45729410 HTTP/1.1
Host: niklasfi.de:8080
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:2.0b12pre) Gecko/20110216 Firefox/4.0b12pre
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: de-de,de;q=0.8,en;q=0.7,en-gb;q=0.5,en-au;q=0.3,en-us;q=0.2
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: close
Range: bytes=10909760-
Referer: http://niklasfi.de:8080/
Pragma: no-cache
Cache-Control: no-cache

HTTP/1.1 200 OK
Content-Type: application/octet-stream
Content-Disposition: attachment; filename=Matrix_Revolutions_11.02.13_22-30_pro7_155_TVOON_DE.mpg.avi.otrkey
Content-Length: 1428013574
Content-Range: bytes 10909760-1428013573/1428013574
Connection: close

=== RESTART +1 ===
GET /download/45729410 HTTP/1.1
Host: niklasfi.de:8080
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:2.0b12pre) Gecko/20110216 Firefox/4.0b12pre
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8, application/metalink4+xml;q=0.9,application/metalink+xml;q=0.8
Accept-Language: de-de,de;q=0.8,en;q=0.7,en-gb;q=0.5,en-au;q=0.3,en-us;q=0.2
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: close
Referer: http://niklasfi.de:8080/
Want-Digest: SHA512;q=0.9, SHA256;q=0.7, SHA, SHA1;q=0.5, MD5;q=0.3
Pragma: no-cache
Cache-Control: no-cache

HTTP/1.1 200 OK
Content-Type: application/octet-stream
Content-Disposition: attachment; filename=Matrix_Revolutions_11.02.13_22-30_pro7_155_TVOON_DE.mpg.avi.otrkey
Content-Length: 1428013574
Connection: close

但是不行!突然间,直到这里的整个下载都被截断了,我什至不能再暂停下载了。我唯一的选择就是取消它。而且我仍然只使用一个下载“线程”。

如果您发布任何解释此行为的想法,我会很高兴。(无论如何感谢您阅读到这里)

最佳答案

如果提供“部分内容”,则必须发送 206 而不是 200 作为响应

关于http - 获得正确的 HTTP 范围,以便 Down Them All 有效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5056414/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com