-
Notifications
You must be signed in to change notification settings - Fork 0
/
VLC.bat
802 lines (683 loc) · 22 KB
/
VLC.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
@echo off
:start
setlocal enableExtensions
setlocal enableDelayedExpansion
::title
title amoAR VLC CLI - Stream HTTP source
::set generall global variables
set "tab= "
set "Commands=Commands\"
set "Database=Database\"
set "Design=Design\"
set "style=%Design%style.exe"
set "Help=Help\"
::set foreground oreground colors code
set "fDefaultColor=39m"
set "fBlack=30m"
set "fRed=31m"
set "fGreen=32m"
set "fYellow=33m"
set "fCyan=36m"
pushd %~dp0
:: validate necessary folders and files except .exe files
:: check Commands
:diag
if not exist "%Commands%" (
echo \033[%fYellow% Oh^^! it looks like we detected a problem in directory - ERROR 1 \033[0m | %style%
echo:
echo | set /p="Please wait while we fix the issue... "
set "change=Commands"
goto fix
)
set "counter=findstr /r /n "^^" %Commands%commands.txt | find /c ":""
for /f %%a in ('!counter!') do set number=%%a
if not "%number%"=="40" (
echo \033[%fYellow% Oh^^! it looks like we detected a problem in directory - ERROR 1.1 \033[0m | %style%
echo:
echo | set /p="Please wait while we fix the issue... "
set "change=commands.txt"
goto fix
)
set "counter=findstr /r /n "^^" %Commands%Pcommands.txt | find /c ":""
for /f %%a in ('!counter!') do set number=%%a
if not "%number%"=="38" (
echo \033[%fYellow% Oh^^! it looks like we detected a problem in directory - ERROR 1.2 \033[0m | %style%
echo:
echo | set /p="Please wait while we fix the issue... "
set "change=Pcommands.txt"
goto fix
)
:: check Database
if not exist "%Database%" (
echo \033[%fYellow% Oh^^! it looks like we detected a problem in directory - ERROR 2 \033[0m | %style%
echo:
echo | set /p="Please wait while we fix the issue... "
set "change=Database"
goto fix
)
if not exist "%Database%vlcLocation.txt" (
echo \033[%fYellow% Oh^^! it looks like we detected a problem in directory - ERROR 2.1 \033[0m | %style%
echo:
echo | set /p="Please wait while we fix the issue... "
set "change=vlcLocation.txt"
goto fix
)
if not exist "%Database%subLocation.txt" (
echo \033[%fYellow% Oh^^! it looks like we detected a problem in directory - ERROR 2.2 \033[0m | %style%
echo:
echo | set /p="Please wait while we fix the issue... "
set "change=subLocation.txt"
goto fix
)
if not exist "%Database%playlist.xspf" (
echo \033[%fYellow% Oh^^! it looks like we detected a problem in directory - ERROR 2.3 \033[0m | %style%
echo:
echo | set /p="Please wait while we fix the issue... "
set "change=playlist.xspf"
goto fix
)
:: check Design
if not exist "%Design%" (
echo Oh^^! it looks like we detected a problem in directory - ERROR 3
echo:
pause
exit /b 0
) else (
if not exist "%Design%style.exe" (
echo Oh^^! it looks like we detected a problem in directory - ERROR 3.1
echo:
pause
exit /b 0
)
)
:: check Help
if not exist "%Help%" (
echo \033[%fYellow% Oh^^! it looks like we detected a problem in directory - ERROR 4 \033[0m | %style%
echo:
) else goto helpFiles
:helpFiles
if not exist "%Help%help.txt" (
echo \033[%fYellow% Oh^^! it looks like we detected a problem in directory - ERROR 4.1 \033[0m | %style%
echo:
echo | set /p="Please wait while we fix the issue... "
set "change=help.txt"
goto fix
)
if not exist "%Help%vlc.txt" (
echo \033[%fYellow% Oh^^! it looks like we detected a problem in directory - ERROR 4.2 \033[0m | %style%
echo:
)
if not exist "%Help%subtitle.txt" (
echo \033[%fYellow% Oh^^! it looks like we detected a problem in directory - ERROR 4.3 \033[0m | %style%
echo:
)
if not exist "%Help%commands.txt" (
echo \033[%fYellow% Oh^^! it looks like we detected a problem in directory - ERROR 4.4 \033[0m | %style%
echo:
)
if not exist "%Help%url.txt" (
echo \033[%fYellow% Oh^^! it looks like we detected a problem in directory - ERROR 4.5 \033[0m | %style%
echo:
)
if not exist "%Help%playlist.txt" (
echo \033[%fYellow% Oh^^! it looks like we detected a problem in directory - ERROR 4.6 \033[0m | %style%
echo:
)
if not exist "%Help%error.txt" (
echo \033[%fYellow% Oh^^! it looks like we detected a problem in directory - ERROR 4.7 \033[0m | %style%
echo:
)
:: check VLC open
tasklist /fi "ImageName eq vlc.exe" /fo csv 2>NUL | find /I "vlc.exe">nul
if "%ERRORLEVEL%"=="0" (
echo \033[%fYellow% Oh^^! VLC is open. Would you like to close it to continue? \033[0m | %style%
echo:
pause | set /p="Press any key to continue... "
cls
echo:
echo:
echo | set /p="Press any key to continue... |"
echo \033[%fCyan% The process was terminated successfully \033[0m | %style%
taskkill /f /t /im vlc.exe>nul
echo:
)
::welcome
echo:
::: /$$ /$$ /$$ /$$$$$$ /$$$$$$ /$$ /$$$$$$
::: | $$ | $$| $$ /$$__ $$ /$$__ $$| $$ |_ $$_/
::: | $$ | $$| $$ | $$ \__/ | $$ \__/| $$ | $$
::: | $$ / $$/| $$ | $$ | $$ | $$ | $$
::: \ $$ $$/ | $$ | $$ | $$ | $$ | $$
::: \ $$$/ | $$ | $$ $$ | $$ $$| $$ | $$
::: \ $/ | $$$$$$$$| $$$$$$/ | $$$$$$/| $$$$$$$$ /$$$$$$
::: \_/ |________/ \______/ \______/ |________/|______/
for /f "delims=: tokens=*" %%a in ('findstr /b ::: "%~f0"') do @echo %%a
echo:
echo:
::-------Step 1-------
::validate VLC location --> 1-check the default path | 2-get it from user
:vlcLocation
set /p vlcPath=<%Database%vlcLocation.txt
if exist "%vlcPath%\vlc.exe" (
echo \033[%fGreen% vlc confirmed \033[0m | %style%
goto subLocation
) else (
echo \033[%fRed% Unfortunately, we could not find VLC location. please enter it manually \033[0m | %style%
:getVlcLocationManuallyRetry
echo \033[%fYellow% %tab%------------------------------------------ \033[0m | %style%
set /p "vlcPath=>%tab%Location (e.g. C:\Program Files\VideoLAN\VLC): "
echo \033[%fYellow% %tab%------------------------------------------ \033[0m | %style%
goto checkVlcLocation
)
::validate user input location
:checkVlcLocation
if exist "%vlcPath%\vlc.exe" (
echo %vlcPath%>%Database%vlcLocation.txt
echo:
echo \033[%fGreen% vlc confirmed \033[0m | %style%
goto subLocation
) else (
echo \033[%fRed% Something wrong. please try again \033[0m | %style%
echo:
goto getVlcLocationManuallyRetry
)
::-------Step 2-------
::validate sub folder location --> 1-check the pre-determined path | 2-get path from user
:subLocation
set /p subPath=<%Database%subLocation.txt
if exist "%subPath%" (
echo \033[%fGreen% sub folder confirmed \033[0m | %style%
goto stream
) else (
if "%subPath%"=="no" goto stream else goto menu
)
::menu option for subtitle step if nothing is already determined --> 1-get path from user | 2-skip this step
:menu
echo:
echo:
echo 1 - Enter 1 to set subtitle folder location ^(like C:\Users\you\Desktop\Sub^)
echo 2 - Enter 2 if you don't have a subtitle folder
echo 3 - Soon...
::get input
:menuInput
echo:
set /p "M=Type 1 or 2 then press ENTER: "
for %%a in (1 2) do if "%M%"=="%%a" goto menuOptions else (
echo \033[%fRed% Something wrong^! try again. \033[0m | %style%
goto menuInput
)
::input analysis
:menuOptions
if "%M%"=="1" goto getSubLocationRetry
if "%M%"=="2" (
echo no>%Database%subLocation.txt
echo no sub folder
goto stream
)
::get subtitle folder path from user
:getSubLocationRetry
echo \033[%fYellow% %tab%----------------------------------- \033[0m | %style%
set /p "subPath=>%tab%Enter the subtitle folder location: "
echo \033[%fYellow% %tab%----------------------------------- \033[0m | %style%
::check it
:checkSubLocation
if exist "%subPath%" (
echo %subPath%>%Database%subLocation.txt
echo \033[%fGreen% sub folder confirmed \033[0m | %style%
goto stream
) else (
echo \033[%fRed% Something wrong^! try again. \033[0m | %style%
echo:
goto getSubLocationRetry
)
::-------Step 3-------
::get stream URL
:stream
echo:
echo:
echo \033[%fYellow% %tab%-------------------------------------------------------- \033[0m | %style%
set /p "stream=>%tab%Please enter your command, network URL or playlist path: "
echo \033[%fYellow% %tab%-------------------------------------------------------- \033[0m | %style%
if "%stream%"=="5" goto exit
if "%stream%"=="exit" goto exit
if "%stream%"=="bye" goto exit
if "%stream%"=="reset" goto resetAll
if "%stream%"=="0" goto resetSub
if "%stream%"=="reset sub" goto resetSub
if "%stream%"=="1" goto playlist
if "%stream%"=="play playlist" goto playlist
if "%stream%"=="2" goto resetPlaylist
if "%stream%"=="reset playlist" goto resetPlaylist
if "%stream%"=="3" goto resetVlc
if "%stream%"=="reset vlc" goto resetVlc
if "%stream%"=="-h" goto help
if "%stream%"=="-help" goto help
if "%stream%"=="/?" goto help
if "%stream%"=="ver" goto version
if "%stream%"=="vlc /?" goto helpVlc
if "%stream%"=="vlc -h" goto helpVlc
if "%stream%"=="sub /?" goto helpSub
if "%stream%"=="sub -h" goto helpSub
if "%stream%"=="commands /?" goto helpCommands
if "%stream%"=="commands -h" goto helpCommands
if "%stream%"=="url /?" goto helpUrl
if "%stream%"=="url -h" goto helpUrl
if "%stream%"=="playlist /?" goto helpPlaylist
if "%stream%"=="playlist -h" goto helpPlaylist
if "%stream%"=="error /?" goto helpError
if "%stream%"=="error -h" goto helpError
if "%stream:~-4%"==".txt" goto list else (
goto validateUrlHttps
)
:: list of URL ---> create a playlist
:list
:: check exist
if not exist "%stream%" (
echo \033[%fRed% The entered path is not valid^^!. try again \033[0m | %style%
goto stream
)
:: generate VLC playlist
if "%subPath%"=="no" (
start /wait /b /min "amoAR VLC CLI - Playlist Generator" playlist.exe "%stream%" "%Database%playlist.xspf" "%Commands%Pcommands.txt" ""
) else (
start /wait /b /min "amoAR VLC CLI - Playlist Generator" playlist.exe "%stream%" "%Database%playlist.xspf" "%Commands%Pcommands.txt" "%subPath%"
)
goto playlist
:: reset the subtitle location path by user
:resetSub
cls
echo \033[%fYellow% ----------------------------- \033[0m | %style%
echo | set /p="Reset subtitle location (Y/N)? "
for /f delims^= %%g in ('choice /c YN /n /t 20 /d Y') do if /i "%%g"=="N" (
set "change=no"
goto restart
)
set "change=yes"
echo Y
echo \033[%fYellow% ----------------------------- \033[0m | %style%
break>%Database%subLocation.txt
timeout 3 /nobreak >nul
goto restart
:: validate url inputed by user with https pattern
:validateUrlHttps
echo %stream% | findstr "^https://" >nul
if errorlevel 1 (
goto validateUrlHttp
) else (
goto sub
)
:: validate url inputed by user with http pattern
:validateUrlHttp
echo %stream% | findstr "^http://" >nul
if errorlevel 1 (
echo \033[%fRed% your URL is not valid^^! try again \033[0m | %style%
echo:
goto stream
) else (
goto sub
)
::-------Step 4-------
::find subtitle --> 1-get last part of URL | 2-remove part extension | 3-convert _ to . | 4-add .srt
:sub
::get last part of URL --> e.g fileName = The_Blacklist_S01E01_720p_BluRay_PaHe.mkv
for %%a in ("%stream%") do (
set url= %%~pa
set url=!url:~2!
set fileName=%%~nxa
)
::remove extension part --> e.g movieName = The_Blacklist_S01E01_720p_BluRay_PaHe
set "movieName=%fileName:~0,-4%"
::get backup of commands file
copy /y "%Commands%commands.txt" "%Commands%commands.bak">nul 2>&1||exit /b
::remove last line of commands file (contains the previous --sub-file option)
( set "line="
for /f "usebackq delims=" %%a in ("%Commands%commands.bak") do (
if defined line echo !line!
set "line=%%a"))>"%Commands%commands.txt"
:: get user subtitle folder location --> if its value is "no" skip | else find related sub
set /p subPath=<%Database%subLocation.txt
if "%subPath%"=="no" goto importNoSub else (
start /wait /b "amoAR VLC CLI - Subtitle Finder" subFinder.exe "%movieName%" "%subPath%"
goto subFinder
)
:: check if subFinder give error in log --> S = Success | F = Failed
:subFinder
:: get last line log
for /f "usebackq delims==" %%a in ("%Database%subFinder.log") do set "subFinderLog=%%a"
:: get status of log
set "sunFinderStatus=%subFinderLog:~21,1%"
if "%sunFinderStatus%"=="S" goto commands else (
echo \033[%fRed% failed to find subtitle^^! \033[0m | %style%
pause
cls
goto restart
)
::skip import sub
:importNoSub
echo --qt-updates-notif>>%Commands%commands.txt
::-------Step 5-------
::get VLC option commands --> get VLC option commands from commands file line by line
:commands
for /f "tokens=*" %%x in (%Commands%commands.txt) do call set "options=%%options%% %%x"
cls
echo:
echo:
echo:
echo \033[%fGreen% options confirmed \033[0m | %style%
echo:
::show VLC output info
echo \033[%fCyan% movie name: %fileName% \033[0m | %style%
echo \033[%fCyan% import sub: done \033[0m | %style%
echo:
echo \033[%fYellow% launching an instance of VLC ------- 100%% \033[0m | %style%
echo \033[%fYellow% set parameter arguments ------------ 100%% \033[0m | %style%
popd
::-------Step 6-------
::result --> open VLC by VLC.exe [options] [stream]
:play
echo:
echo ^*This console will close automatically after the movie ends, but you can close me now.
:: open VLC with paramters
pushd %vlcPath%
vlc%options% %stream%
popd
goto quit
:playlist
set /p playlist=<%Database%playlist.xspf
if not "%playlist%"=="<?xml version="1.0" encoding="UTF-8"?>" (
echo \033[%fRed% You have no playlists^^!, make one first. \033[0m | %style%
goto stream
)
cls
echo:
echo:
echo:
echo \033[%fGreen% playlist confirmed \033[0m | %style%
echo \033[%fGreen% options confirmed \033[0m | %style%
echo:
::show VLC output info
echo \033[%fCyan% movie name: playlist \033[0m | %style%
echo \033[%fCyan% import sub: done \033[0m | %style%
echo:
echo \033[%fYellow% launching an instance of VLC ------- 100%% \033[0m | %style%
echo \033[%fYellow% set parameter arguments ------------ 100%% \033[0m | %style%
echo:
echo ^*This console will close automatically after the movie ends, but you can close me now.
:: open VLC with paramters
start "" %Database%playlist.xspf
goto exit
:: reset current playlist by user
:resetPlaylist
cls
echo \033[%fYellow% --------------------- \033[0m | %style%
echo |set /p="Reset playlist (Y/N)? "
for /f delims^= %%g in ('choice /c YN /n /t 20 /d Y') do if /i "%%g"=="N" (
set "change=no"
goto restart
)
set "change=yes"
echo Y
echo \033[%fYellow% --------------------- \033[0m | %style%
break>%Database%playlist.xspf
timeout 3 /nobreak >nul
goto restart
:: reset vlc location path
:resetVlc
cls
echo \033[%fYellow% ------------------------- \033[0m | %style%
echo |set /p="Reset VLC location path (Y/N)? "
for /f delims^= %%g in ('choice /c YN /n /t 20 /d Y') do if /i "%%g"=="N" (
set "change=no"
goto restart
)
set "change=yes"
echo Y
echo \033[%fYellow% ------------------------- \033[0m | %style%
break>%Database%vlcLocation.txt
timeout 3 /nobreak >nul
goto restart
::exit --> goodbye, endlocal, terminate
:quit
pushd %~dp0
echo:
echo:
echo | set /p=">"
echo \033[%fCyan% I hope you enjoyed watching^^! \033[0m | %style%
timeout 2 /nobreak >nul
cls
goto restart
:: fix the detected problem
:fix
if "%change%"=="Commands" (
mkdir %change%
goto fixed
)
if "%change%"=="commands.txt" (
type nul > %Commands%%change%
(
echo --play-and-exit
echo --qt-continue=2
echo --no-stats
echo --clock-synchro=0
echo --role=video
echo --preferred-resolution=-1
echo --fps=144
echo --no-video-title-show
echo --qt-name-in-title
echo --swscale-mode=8
echo --directx-3buffering
echo --direct3d11-hw-blending
echo --avcodec-hw=d3d11va
echo --avcodec-skiploopfilter=4
echo --postproc-q=6
echo --sout-mp4-faststart
echo --sout-deinterlace-phosphor-chroma=4
echo --sout-x264-preset=ultrafast
echo --sout-x264-tune=film
echo --sout-x264-level=51
echo --sout-x264-profile=high444
echo --sout-x264-bluray-compat
echo --antiflicker-softening-size=31
echo --src-converter-type=0
echo --network-caching=1000
echo --mtu=1492
echo --aout=directsound
echo --directx-volume=1
echo --qt-max-volume=200
echo --no-audio-time-stretch
echo --force-dolby-surround=1
echo --stereo-mode=5
echo --sout-speex-mode=2
echo --sout-speex-quality=10
echo --speex-resampler-quality=10
echo --captions=708
echo --subsdec-encoding=UTF-8
echo --subsdec-autodetect-utf8
echo --no-sub-autodetect-file
echo --sub-file=._\
) > %Commands%%change%
goto fixed
)
if "%change%"=="Pcommands.txt" (
type nul > %Commands%%change%
(
echo ^<vlc:option^>playlist-autostart^</vlc:option^>
echo ^<vlc:option^>qt-continue=2^</vlc:option^>
echo ^<vlc:option^>no-stats^</vlc:option^>
echo ^<vlc:option^>clock-synchro=0^</vlc:option^>
echo ^<vlc:option^>role=video^</vlc:option^>
echo ^<vlc:option^>preferred-resolution=-1^</vlc:option^>
echo ^<vlc:option^>fps=144^</vlc:option^>
echo ^<vlc:option^>no-video-title-show^</vlc:option^>
echo ^<vlc:option^>qt-name-in-title^</vlc:option^>
echo ^<vlc:option^>swscale-mode=8^</vlc:option^>
echo ^<vlc:option^>directx-3buffering^</vlc:option^>
echo ^<vlc:option^>direct3d11-hw-blending^</vlc:option^>
echo ^<vlc:option^>avcodec-hw=d3d11va^</vlc:option^>
echo ^<vlc:option^>avcodec-skiploopfilter=4^</vlc:option^>
echo ^<vlc:option^>postproc-q=6^</vlc:option^>
echo ^<vlc:option^>sout-mp4-faststart^</vlc:option^>
echo ^<vlc:option^>sout-deinterlace-phosphor-chroma=4^</vlc:option^>
echo ^<vlc:option^>sout-x264-preset=ultrafast^</vlc:option^>
echo ^<vlc:option^>sout-x264-tune=film^</vlc:option^>
echo ^<vlc:option^>sout-x264-level=51^</vlc:option^>
echo ^<vlc:option^>sout-x264-profile=high444^</vlc:option^>
echo ^<vlc:option^>sout-x264-bluray-compat^</vlc:option^>
echo ^<vlc:option^>antiflicker-softening-size=31^</vlc:option^>
echo ^<vlc:option^>src-converter-type=0^</vlc:option^>
echo ^<vlc:option^>network-caching=1000^</vlc:option^>
echo ^<vlc:option^>mtu=1492^</vlc:option^>
echo ^<vlc:option^>aout=directsound^</vlc:option^>
echo ^<vlc:option^>directx-volume=1^</vlc:option^>
echo ^<vlc:option^>no-audio-time-stretch^</vlc:option^>
echo ^<vlc:option^>force-dolby-surround=1^</vlc:option^>
echo ^<vlc:option^>stereo-mode=5^</vlc:option^>
echo ^<vlc:option^>sout-speex-mode=2^</vlc:option^>
echo ^<vlc:option^>sout-speex-quality=10^</vlc:option^>
echo ^<vlc:option^>speex-resampler-quality=10^</vlc:option^>
echo ^<vlc:option^>captions=708^</vlc:option^>
echo ^<vlc:option^>subsdec-encoding=UTF-8^</vlc:option^>
echo ^<vlc:option^>subsdec-autodetect-utf8^</vlc:option^>
echo ^<vlc:option^>no-sub-autodetect-file^</vlc:option^>
) > %Commands%%change%
goto fixed
)
if "%change%"=="Database" (
mkdir %change%
goto fixed
)
if "%change%"=="vlcLocation.txt" (
type nul > %Database%%change%
(
echo C:\Program Files\VideoLAN\VLC
) > %Database%%change%
goto fixed
)
if "%change%"=="subLocation.txt" (
type nul > %Database%%change%
goto fixed
)
if "%change%"=="playlist.xspf" (
type nul > %Database%%change%
goto fixed
)
if "%change%"=="help.txt" (
type nul > %Help%%change%
(
echo Commands: Action:
echo:
echo ver find current version
echo -help, -h help for other help commands
echo exit, bye, 5 exit
echo reset reset app
echo reset sub, 0 reset subtitle setting
echo play playlist, 1 play last playlist
echo reset playlist, 2 clear playlist
echo:
echo vlc -h help about set vlc location path to run
echo sub -h help about subtitles
echo commands -h help about set VLC option commands
echo url -h help about valid URLs
echo playlist -h help about playlists
echo error -h help about errors
echo:
echo:
echo *You can also use /? instead of -h
) > %Help%%change%
goto fixed
)
:fixed
pushd %~dp0
echo | set /p="|"
echo \033[36m Fixed \033[0m | %style%
echo:
echo:
:restart
if "%change%"=="no" cls
if "%change%"=="yes" echo:
endlocal
goto start
:exit
echo:
echo:
echo | set /p=">"
echo \033[%fCyan% Bye, bye^^! \033[0m | %style%
timeout 2 /nobreak >nul
endlocal
exit /b 0
:: help
:help
cls
type %Help%help.txt
goto helpEnd
:: help about vlc
:helpVlc
cls
type %Help%vlc.txt
goto helpEnd
:: help about subtitle
:helpSub
cls
type %Help%subtitle.txt
goto helpEnd
:: help about VLC commands option
:helpCommands
cls
type %Help%commands.txt
goto helpEnd
:: help about valid URLs
:helpUrl
cls
type %Help%url.txt
goto helpEnd
:: help about playlists
:helpPlaylist
cls
type %Help%playlist.txt
goto helpEnd
:: help about errors
:helpError
cls
type %Help%error.txt
goto helpEnd
:: current version
:version
cls
echo amoAR VLC CLI - Stream HTTP URL sources in VLC
echo:
echo:
echo Version 1.2.5
echo (c) 2022 amoAR - All rights reserved.
goto helpEnd
:: end of help
:helpEnd
echo:
echo:
echo \033[%fYellow% --------------- \033[0m | %style%
echo | set /p="Exit guide? (Y) "
choice /c Y /n
cls
goto restart
:: reset all
:resetAll
cls
echo \033[%fYellow% ----------------------------------------------- \033[0m | %style%
echo | set /p="This will delete all your data. Reset app (Y/N)? "
for /f delims^= %%g in ('choice /c YN /n') do if /i "%%g"=="N" (
set "change=no"
goto restart
)
set "change=yes"
echo Y
echo \033[%fYellow% ----------------------------------------------- \033[0m | %style%
echo:
echo:
echo Do not close the program during the process^^!
echo ...
del /s /q %Commands%
del /s /q %Database%
del /q %Help%help.txt
echo Done.
echo Wait until the program restarts automatically and then files and folders are overwritten
timeout 7 /nobreak >nul
goto restart