Linux命令行用wget下载精彩电影

某些网站通过http header信息限制下载文件,在linux下面可以使用wget来模拟realplay等的,http header信息。

wget --head "ClientID: WinNT_5.0_6.0.12.1056_play32_R30CND_zh-CN_686_axembed" --head "User-Agent: RMA/1.0 (compatible; RealMedia)" http://localhost/head.php

说明:每一个header信息项用一个 --head参数来指定,可以多次使用 --head参数。

下面是我的http://localhost/head.php获得的header的信息:

Array
(
[User-Agent] => RMA/1.0 (compatible; RealMedia)
[Accept] => */*
[Host] => localhost
[Connection] => Keep-Alive
[ClientID] => WinNT_5.0_6.0.12.1056_play32_R30CND_zh-CN_686_axembed
)

以下是下载成功和不成功的http链接信息记录:

> >从IE点播的http请求,播放成功。(VOD1.cap)
> >
> >GET /vod2/%5bTV%5dFZXF/01.rmvb HTTP/1.1
> >
> >Accept: */*
> >
> >User-Agent: RMA/1.0 (compatible; RealMedia)
> >
> >Icy-MetaData: 1
> >
> >Bandwidth: 10485800
> >
> >ClientID: WinNT_5.0_6.0.12.1056_play32_R30CND_zh-CN_686_axembed
> >
> >GUID: 00000000-0000-0000-0000-000000000000
> >
> >Language: zh-CN, zh, *
> >
> >RegionData: 0
> >
> >SupportsMaximumASMBandwidth: 1
> >
> >Connection: Keep-Alive
> >
> >Host: 10.146.189.104
> >
> >Accept-Language: zh-CN, zh, *
> >
> >Accept-Encoding: gzip
> >
> >===================================================================
> >从realplayer直接打开对应文件播放成功。(vod2.cap)
> >
> >GET /vod2/%5bTV%5dFZXF/01.rmvb HTTP/1.1
> >
> >Accept: */*
> >
> >User-Agent: RMA/1.0 (compatible; RealMedia)
> >
> >Icy-MetaData: 1
> >
> >Bandwidth: 10485800
> >
> >ClientID: WinNT_5.0_6.0.12.1056_RealPlayer_R30CND_zh-CN_686
> >
> >GUID: 00000000-0000-0000-0000-000000000000
> >
> >Language: zh-CN, zh, *
> >
> >RegionData: 0
> >
> >SupportsMaximumASMBandwidth: 1
> >
> >Connection: Keep-Alive
> >
> >Host: 10.146.189.104
> >
> >Accept-Language: zh-CN, zh, *
> >
> >Accept-Encoding: gzip
> >
> >
> >===================================================================

相关推荐