zoukankan      html  css  js  c++  java
  • 批处理下载抖音无水印视频

     1 @echo off
     2 chcp 65001 1>nul 2>nul
     3 
     4 set url=%~1
     5 
     6 curl -s -H "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1" -H "Upgrade-Insecure-Requests: 1" %url% > page.html
     7 
     8 cat page.html | d:msysopt	oolsingrep -oP "(?<=/)d+(?=/)" > vid.txt
     9 
    10 set /p vid=<vid.txt
    11 
    12 IF EXIST vid.txt del /Q vid.txt
    13 IF EXIST page.html del /Q page.html
    14 
    15 ::echo %vid%
    16 set redirect_url=https://www.iesdouyin.com/web/api/v2/aweme/iteminfo/?item_ids=%vid%
    17 ::echo %redirect_url%
    18 
    19 curl -s -H "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1" -H "Upgrade-Insecure-Requests: 1" %redirect_url% > viode.json
    20 
    21 cat viode.json | jq -M ".item_list[]|"(.author.short_id)_(.author.nickname)_(.desc).mp4"" > filename.txt
    22 cat viode.json | jq -M ".item_list[].video.play_addr.url_list[]" |sed "s/playwm/play/g" > videourl.txt
    23 
    24 set /p filename=<filename.txt
    25 set /p videourl=<videourl.txt
    26 
    27 IF EXIST filename.txt del /Q filename.txt
    28 IF EXIST videourl.txt del /Q videourl.txt
    29 IF EXIST viode.json del /Q viode.json
    30 
    31 echo %filename%
    32 echo %videourl%
    33 
    34 curl -s -H "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1" -H "Upgrade-Insecure-Requests: 1" -L %videourl% > %filename%
    35 
    36 set filename=
    37 set videourl=
    38 set vid=
    39 set redirect_url=

    需要 CURL JQ GREP SED

    注意:  要用支持 -P 参数GREP版本

     
  • 相关阅读:
    1、Elasticsearch教程-从入门到精通
    3、ik分词器
    2、ElasticSearch的安装
    svn操作
    2020-10
    编写第一个linux驱动
    字符设备驱动
    Linux下/dev和/sys/class的区别
    latex
    Qt
  • 原文地址:https://www.cnblogs.com/nlsoft/p/14428171.html
Copyright © 2011-2022 走看看