@echo off
set aa=http://video.banma.com/frontpage2003/index0.shtml
for /f "tokens=3 delims=<=> " %%a in ('curl -s %aa%^|find ".swf"') do echo %%a>>temp.txt
for /f "tokens=7 delims=/." %%a in ('find "http" temp.txt') do set name=%%a.swf
for /f %%a in ('find "http" temp.txt') do set dowm=%%a
curl -o %name% %dowm%
问题:
1,用curl下载得到的文件大小和直接下载的文件大小不一样??用CURL下载的不能播放要缓冲...是不是要加参数才能下载完全?
2,
http://video.banma.com/frontpage2003/index0.shtml 中"index0.shtml"的0不是固定数一共有199份,意思index0.shtml,index1.shtml,index2.shtml....我想写个循环一直下载完....具体不太会.....
3,temp.txt内容:
"movie"
"http://dxdata.dudu.com/video/frontpage2003/xhli6010553.swf"
"26"
for /f %%a in ('find "http" temp.txt') do set dowm=%%a
运行显示:
C:\Documents and Settings\csj.XP\桌面>set dowm=----------
C:\Documents and Settings\csj.XP\桌面>set dowm="http://dxdata.dudu.com/video/fro
ntpage2003/xhli6010553.swf"
怎么多出 set dowm=----------
4,代码可否精短点
Last edited by bbq123bbq on 2007-11-25 at 04:31 AM ]
for /L %%a in (0,1,199) do (
echo do something.....
echo:http://video.banma.com/frontpage2003/index%%a.shtml
)
经过lxmxn提示基本完成,代码如下:
@echo off
for /L %%a in (0,1,199) do (
echo do something.....
for /f "tokens=3 delims=<=> " %%b in ('curl -s
http://video.banma.com/frontpage2003/index%%a.shtml^|find ".swf"') do (
echo %%b>>temp.txt
)
)
setlocal EnableDelayedExpansion
for /f %%c in ('find "http" temp.txt') do (
set dowm=%%c
for /f "tokens=7 delims=/." %%d in (!dowm!) do set name=%%d.swf
curl -o !name! !dowm!
)
觉得应该可以精短一点...技术有限请大家帮忙改改...
Last edited by bbq123bbq on 2007-11-25 at 04:30 AM ]