China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-24 19:36
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » 9flash All swf Download freely (Support breakpoint resumption) v1.0.bat View 2,361 Replies 5
Original Poster Posted 2007-01-15 06:04 ·  中国 甘肃 陇南 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
wget + sed written, read readme.txt before use

[ Last edited by vkill on 2007-10-22 at 08:48 PM ]
Floor 2 Posted 2007-01-15 06:05 ·  中国 甘肃 陇南 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
Update Download Address.bat


@echo off
title 9flash *.swf Let Me Download----Update

set "url=http://www.9flash.com/"
set "music=FlashDefault/1.html"
set "movie=FlashDefault/2.html"
set "game=FlashDefault/3.html"
set "t=test.tx"
::There are a total of n pages in the category page, the larger the slower, can be between 1~100
set "top=50"

copy /y swfs.txt swfs.back>nul 2>nul
cd.>swfs.txt
md "%t%">nul 2>nul
PUSHD "%t%"
del /a/s/f/q *.html *.txt>nul 2>nul
title Update category list
cls
echo Please wait......
wget -q -O 1.html "%url%%music%"
wget -q -O 2.html "%url%%movie%"
wget -q -O 3.html "%url%%game%"
sed "/Work Category/,/*<\/ul>/!d;{/Work Category/{s/<*>//g;s/*//g;s/^/\/};s/*\x22\(\/.*\)\x22>\(*\)<\/a.*/\1→\2/;/^\/\|^\

Update work list of category
cls
echo This step is a bit slow, please be patient
echo.
for /f "tokens=1,2 delims=→" %%a in (category.txt) do (
del /a/s/f/q *.html>nul 2>nul
echo %%a|findstr /B "



*Page * of * pages/!d;{/.html/!d;/http:/d;{s/*\x22\(\/.*\)\x22>\(*\)<\/a.*/\1→\2/};/^\//!d}" *.html |more>temp.txt
sed -n 1,$p temp.txt>>htmls.txt
)
)

title Update download address of work
cls
for /f "tokens=1,2 delims=→" %%a in ('sed "s:/FlashPlay/:/Flash/:" htmls.txt') do (
echo %%a|findstr /B "^/">nul && (
echo Updating download address of work %%b
wget -q -O temp.html "%url%%%a"
sed "/\(\{32\}\).swf/!d;{s/.*\(http:.*\{32\}.swf\).*/\1/}" temp.html|more>temp.txt
for /f "tokens=*" %%? in ('sed -n 1p temp.txt') do (>>../swfs.txt echo %%?→%%b)
)||(>>../swfs.txt echo %%a)
)

title Update completed
echo.
echo The old list file swfs.txt is backed up as swfs.back
echo.
echo Please check if the new list file swfs.txt is correct, if not correct, please restore immediately
pause>nul
goto :eof



Download.bat


@echo off
title 9flash *.swf Let Me Download(Support breakpoint resuming) by:vkill V:1.0
if not exist swfs.txt (echo Missing file swfs.txt&pause>nul&goto :eof)
findstr . swfs.txt>nul ||(echo swfs.txt is empty&pause>nul&goto :eof)
set "t=test.tx"
:choose
cls
echo.
echo Please enter the name of the flash file you want to download, enter all for all download
echo.
set name=
set/p name= name=
if "%name%*"=="*" goto choose
if "%name%*"=="all*" goto down_all
md "%t%">nul 2>nul
PUSHD "%t%"
del /a/s/f/q *.txt>nul 2>nul
sed "/→.*%name%/!d" ../swfs.txt|more>temp.txt
echo.
findstr . temp.txt>nul ||(echo Did not find the flash you want to search&pause>nul&goto choose)
cls
echo ________________________________________________________________________________
echo The list of flash works you want to search is as follows, automatic download starts after 5 seconds
type temp.txt
echo ________________________________________________________________________________
ping -n 10 127.1>nul 2>nul
popd
for /f "tokens=1,2 delims=→" %%a in (temp.txt) do (
echo Downloading work%%b
wget -q -c -O %%b.swf "%%a"
)
goto end

:down_all
cls
for /f "tokens=1,2 delims=→" %%a in (swfs.txt) do (
echo %%a|findstr /B "



















[ Last edited by vkill on 2007-1-15 at 06:06 AM ]
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
lxmxn +4 2007-10-21 23:16
Floor 3 Posted 2007-01-15 06:07 ·  中国 甘肃 陇南 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
Use it, see if it works, I did it in the internet café and it's okay
Floor 4 Posted 2007-08-20 04:42 ·  美国 加利福尼亚州 圣克拉拉 Cogent
初级用户
Credits 37
Posts 18
Joined 2007-08-20 03:13
18-year member
UID 95371
Gender Male
Status Offline
Came a bit late, but still need to support good stuff
Floor 5 Posted 2007-08-20 07:39 ·  中国 广东 东莞 电信
中级用户
★★
Credits 326
Posts 152
Joined 2007-05-04 06:16
19-year member
UID 87412
Gender Male
Status Offline
Floor 6 Posted 2007-10-21 17:49 ·  中国 新疆 阿克苏地区 电信
初级用户
Credits 23
Posts 12
Joined 2007-02-12 10:53
19-year member
UID 79302
Gender Male
Status Offline
Forum Jump: