zoukankan      html  css  js  c++  java
  • 360 Extension for Chrome Download 1.0

    main.bat

     1 @echo off
     2 color 0a
     3 title 360 Extension for Chrome Download 1.0
     4 pushd "%~dp0"
     5 
     6 SETLOCAL ENABLEEXTENSIONS
     7 SETLOCAL ENABLEDELAYEDEXPANSION
     8 
     9 rem Note: Do not include a backslash at the end.
    10 rem set SAVE_DIR=C:UsersAdministratorDownloads
    11 set SAVE_DIR=C:.Lab1
    12 set WGET_APP=C:Program Files (x86)GnuWin32inwget.exe
    13 set TMP_FILE=.matched.tmp
    14 
    15 rem 键入扩展的编号
    16 :ENTER_EXTID
    17 set EXT_ID=
    18 rem e.g. dogkpdfcklifaemcdfbildhcofnopogp
    19 set /p EXT_ID=Enter extid: 
    20 if "%EXT_ID%" equ "" (
    21     call :FN_BLOCKING
    22     goto :ENTER_EXTID
    23 )
    24 rem 手动拼接扩展页面的URL
    25 set EXT_PAGE=https://ext.chrome.360.cn/webstore/detail/%EXT_ID%
    26 rem 下载扩展页面文件
    27 "%WGET_APP%" --no-check-certificate -q -N -P"%SAVE_DIR%" %EXT_PAGE%
    28 if not exist "%SAVE_DIR%\%EXT_ID%" (
    29     echo Download failed!
    30     goto :NORMAL_EXIT
    31 )
    32 rem crx文件下载地址的开头
    33 set MATCH_STR=var __initData
    34 set MATCH_LINE=
    35 rem 提取整行内容
    36 findstr /c:"%MATCH_STR%" "%SAVE_DIR%\%EXT_ID%" > "%TMP_FILE%"
    37 rem 解析crx文件下载地址
    38 set /a POS_BEGIN=0
    39 for /f "usebackq tokens=*" %%i in (`esft -p filename "%TMP_FILE%"`) do (
    40     set /a POS_BEGIN=%%i + 11
    41 )
    42 set /a POS_END=0
    43 for /f "usebackq tokens=*" %%i in (`esft -p .crx "%TMP_FILE%"`) do (
    44     set /a POS_END=%%i + 4
    45 )
    46 set /a POS_LEN=%POS_END% - %POS_BEGIN%
    47 set DL_EMBRYO=
    48 for /f "usebackq tokens=*" %%i in (`esft -e %POS_BEGIN% %POS_LEN% "%TMP_FILE%"`) do (
    49     set DL_EMBRYO=%%i
    50 )
    51 set DL_FINAL=
    52 for /f "usebackq tokens=*" %%i in (`sr "\" "" "%DL_EMBRYO%"`) do (
    53     set DL_FINAL=%%i
    54 )
    55 "%WGET_APP%" --no-check-certificate -q -N -P"%SAVE_DIR%" %DL_FINAL%
    56 echo Completed.
    57 if exist "%TMP_FILE%" del "%TMP_FILE%"
    58 
    59 goto :NORMAL_EXIT
    60 
    61 :NORMAL_EXIT
    62 popd
    63 pause
    64 exit
    65 
    66 
    67 
    68 @rem ##############################FBP Begin
    69 @title Function Batch Program 1.0
    70 @color 0a
    71 @echo Note: I can't run independently.
    72 @ping /n 3 127.0.0.1 > nul
    73 @exit
    74 
    75 rem eg. call :FN_BLOCKING
    76 :FN_BLOCKING
    77 choice /t 1 /c O /cs /d O /n
    78 cls
    79 goto :EOF
    80 @rem ##############################FBP End

    附件1

  • 相关阅读:
    [转] Vue + Webpack 组件式开发(练习环境)
    [转] 从零构建 vue2 + vue-router + vuex 开发环境到入门,实现基本的登录退出功能
    [转] Redux入门教程(快速上手)
    [转] 前端数据驱动的价值
    [转] React风格的企业前端技术
    [转] 对Array.prototype.slice.call()方法的理解
    [转] webpack之plugin内部运行机制
    [转] 静态资源的分布对网站加载速度的影响/浏览器对同一域名下并发加载资源数量
    Mysql 版本号、存储引擎、索引查询
    linux 查看CPU、内存、磁盘信息命令
  • 原文地址:https://www.cnblogs.com/rms365/p/10932462.html
Copyright © 2011-2022 走看看