-
Notifications
You must be signed in to change notification settings - Fork 0
/
RUN.bat
130 lines (115 loc) · 3.12 KB
/
RUN.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
@echo off
cecho {A0}YASE v1.1 2016 Sept{#}
echo.
cecho {06}#####################################{#}
echo.
set /P url=Right-click paste video URL, Enter:
echo.
"%~dp0/youtube-dl/youtube-dl.exe" -F %url%
echo.
cecho {06}#####################################{#}
echo.
cecho CHOOSE FORMAT CODE {lime on black}(default: 140) {#}
set /P format=""
cecho {06}#####################################{#}
echo.
::ask (or) statement to set type m4a(mp4) for filename output, else original filename
if '%format%'=='m4a' set type=m4a
if '%format%'=='140' set type=m4a
if '%format%'=='36' set type=m4a
if '%format%'=='22' set type=m4a
if '%format%'=='18' set type=m4a
if '%format%'=='17' set type=m4a
if '%format%'=='opus' set type=opus
if '%format%'=='251' set type=opus
if '%format%'=='250' set type=opus
if '%format%'=='249' set type=opus
if '%format%'=='ogg' set type=vorbis
if '%format%'=='171' set type=vorbis
if '%format%'=='43' set type=vorbis
if defined type (goto audio_only) else (goto download_other)
:download_m4a
echo initialize download mp4
"%~dp0/youtube-dl/youtube-dl.exe" -f %format% -o input.mp4 %url%
goto mux_m4a
:download_opus
echo initialize download webm
"%~dp0/youtube-dl/youtube-dl.exe" -f %format% -o input.webm %url%
goto mux_opus
:download_vorbis
echo initialize download webm
"%~dp0/youtube-dl/youtube-dl.exe" -f %format% -o input.webm %url%
goto mux_vorbis
:download_other
echo download
"%~dp0/youtube-dl/youtube-dl.exe" -f %format% %url%
goto end
:audio_only
cecho AUDIO ONLY? (Y/N) {lime on black}(default: Y) {#}
set /P inputao=""
cecho {06}#####################################{#}
echo.
echo.
if '%inputao%'=='y' set ao=1
if '%inputao%'=='Y' set ao=1
if '%inputao%'=='1' set ao=1
if defined inputao goto ao_sort
:ao_sort
if '%ao%'=='1' (
if %type%==m4a goto download_m4a
if %type%==vorbis goto download_vorbis
if %type%==opus goto download_opus
) else (goto download_other)
:mux_m4a
echo.
cecho {06}#####################################{#}
echo.
cecho {0A}MP4BOX MUX PROCESS TO LEGACY CONTAINER (DE-DASH){#}
echo.
cecho {0A}extension:.M4A container:MP4 codec:AAC{#}
echo.
cecho {06}#####################################{#}
echo.
echo.
if exist song.m4a del song.m4a
"%~dp0/mp4box/mp4box.exe" -add "input.mp4#audio" "song.m4a"
goto end
:end
echo.
cecho {06}#####################################{#}
echo.
cecho {05}EXITING!{#}
echo.
cecho {06}#####################################{#}
echo.
echo.
if exist input.webm del input.webm
if exist input.mp4 del input.mp4
pause
exit
:mux_opus
echo.
cecho {06}#####################################{#}
echo.
cecho {0A}FFMPEG MUX PROCESS TO LEGACY CONTAINER (DE-DASH){#}
echo.
cecho {0A}extension:.OPUS container:OGG codec:OPUS{#}
echo.
cecho {06}#####################################{#}
echo.
echo.
"%~dp0/ffmpeg/ffmpeg.exe" -i "input.webm" -vn -acodec copy "song.opus"
goto end
:mux_vorbis
echo.
cecho {06}#####################################{#}
echo.
cecho {0A}FFMPEG MUX PROCESS TO LEGACY CONTAINER (DE-DASH){#}
echo.
cecho {0A}extension:.OGG container:OGG codec:VORBIS{#}
echo.
cecho {06}#####################################{#}
echo.
echo.
"%~dp0/ffmpeg/ffmpeg.exe" -i "input.webm" -vn -acodec copy "song.ogg"
goto end