How can I get a version of a file on the Internet but not upload it?

I get a url file like http://cidian.youdao.com/download/YoudaoDict.exe

how can i get its version but not download it?

nots 1: if you first download the file to your computer, there are many ways to get it.

for example, you can use the window tools "filever.exe" to get the version.

but I don’t want to download it, at least not download everything. How can i do this? Waiting for your

help! Thank you

nots 2: I tried to get a part of the file to get the version:

firstly, I used the wget.exe download tool to download part of the file (wget.exe

single-threaded download tool, it can provide head shape loading)

second, I used the filever.exe file to get the version of the file.

Thus, some software can get its version, but some cann't (they should be

loaded). I do not know why.

+3
source share
5 answers

I noticed that this particular exe link supports byte range requests.

$ curl -I http://cidian.youdao.com/download/YoudaoDict.exe
HTTP/1.1 200 OK
...
Accept-Ranges: bytes
Content-Length: 4820792
...
Content-Type: application/octet-stream

You can make one or more HTTP byte range requests to get the parts of the file needed to determine the version. You just make a few requests to get the parts of the file you are looking at if it were on your hard drive.

, HTTP/1.1 spec 500 :

curl -H"Range: bytes=0-499" http://... -o bytes-0-499.dat
+4

, , .exe. .

.exe .

+3

HTTP HEAD, Content-Length. Last-Modified header. , ETag .

netcat:

> nc cidian.youdao.com 80
HEAD /download/YoudaoDict.exe HTTP/1.1
Host: cidian.youdao.com

HTTP/1.1 200 OK
Date: Mon, 10 Aug 2009 06:11:59 GMT
Server: Apache
ETag: "Dcm1w6Vxg51"
Last-Modified: Sat, 08 Aug 2009 02:18:40 GMT
Accept-Ranges: bytes
Content-Length: 4820792
X-Request-Received: t=1249884719506801
X-Request-Processing-Time: D=906244
Content-Type: application/octet-stream

, , . , Date Last-Modified , , .

+3

, HTTP HEAD request iirc, , ( ), Content-Length Last-Modified. : ETag!

, , , - . , .

+1

- , , HTTP- HEAD, .

( ) . <dl id="downloadSth">, . , ; .

I would look at using BeautifulSoup .

+1
source

Source: https://habr.com/ru/post/1714752/


All Articles