Extract URL from HAR 1.0

 main.bat

 1 @echo off
 2 color 0a
 3 title Extract URL from HAR 1.0
 4 
 5 SETLOCAL ENABLEEXTENSIONS
 6 SETLOCAL ENABLEDELAYEDEXPANSION
 7 
 8 pushd "%TEMP%"
 9 
10 set PARAM=%~1
11 set FILE_EXT=.har
12 
13 if "%PARAM%" equ "" (
14     echo Please drag and drop a ^'*%FILE_EXT%' file onto this batch program.
15     goto NORMAL_EXIT
16 )
17 
18 for %%i in ("%PARAM%") do (
19     if /i "%%~xi" neq "%FILE_EXT%" (
20         echo Type of file must be ^'%FILE_EXT%'.
21         goto NORMAL_EXIT
22     )
23     if /i %%~zi equ 0 (
24         echo Error #1
25         goto NORMAL_EXIT
26     )
27 )
28 
29 findstr /c:"""url""" "%PARAM%" > tve_segment_1
30 cd . > tve_segment_2
31 for /f "tokens=1* delims=:" %%i in (tve_segment_1) do (
32     set T_STR=%%j
33     >> tve_segment_2 echo !T_STR:~2,-2!
34 )
35 
36 clip < tve_segment_2
37 del tve_segment_1 tve_segment_2
38 
39 SETLOCAL DISABLEDELAYEDEXPANSION
40 echo Hey! Now you can add batch download from clipboard.
41 
42 :NORMAL_EXIT
43 popd
44 pause
45 exit

 

Firefox --> Ctrl+Shift+E --> Media --> Save All As HAR

 

 

附件1

posted @ 2019-05-20 14:45  RMS365  阅读(...)  评论(...编辑  收藏