码迷,mamicode.com
首页 > 其他好文 > 详细

自动下载快手视频

时间:2017-04-27 10:13:19      阅读:246      评论:0      收藏:0      [点我收藏+]

标签:支持   time   call   led   dexp   echo   wget   com   ble   

@echo off
:: 自动下载快手视频
:: get kuaishou video _GKV
:: _kslists.txt - https://www.kuaishou.com/live/user/xxx 支持多行 
:: 从 _kslists.txt 文本中读取URL并自动下载该页面的所有视频

setlocal enabledelayedexpansion

for /f "delims=" %%i in (‘type _kslists.txt‘) do (
  call :getAllVideo "%%i"
)
exit /b

:getAllVideo
set url=%1
set savepage=save_%random%-%random%-%random%.html
wget %url% -O "%savepage%"

sed -i "s/.jpg/.jpg\r\n/g" "%savepage%"
sed -i "s/http/\nhttp/g" "%savepage%"
set tempfn=%savepage%.info.txt
cat "%savepage%"|grep -Eio "https(.*)upic.*.jpg">"%tempfn%"
sed -i "s/.jpg/.mp4/g" "%tempfn%"

set /a index=1
for /f "delims=" %%i in (‘type %tempfn%‘) do (
  set outfn=!date!_!time:~0,8!_!index!.mp4
  set outfn=!outfn::=.!
  set outfn=!outfn: =0!
  set inurl=%%i
  set /a index=!index!+1
  wget "!inurl!" -O "!outfn!"
)

del "%savepage%"
del "%tempfn%"
exit /b

自动下载快手视频

标签:支持   time   call   led   dexp   echo   wget   com   ble   

原文地址:http://www.cnblogs.com/nlsoft/p/6772185.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!