Im trying to make a little Batch script to navigate to different Chromecasts around my place, and for a place to copy pasta the URL to stream more conveniently.
Normally you can open VLC, play a video, go Render > select the named device.
I found a CMD line that works for this:
vlc "https://www.youtube.com/watch?v=YoUrVidEoHerE" --sout "#chromecast" --sout-chromecast-ip=192.168.0.00 --demux-filter=demux_chromecast
So naturally I wanted to automate it.
Here is where I'm at:
@echo off
setlocal enableextensions enabledelayedexpansion
:: Below, set DEBUG to 1 to enable displaying more messages for diagnosis
SET DEBUG=0
SET DBG=REM
IF "%DEBUG%"=="1" (SET DBG=ECHO ** DEBUG : )
GOTO start
:ascii_art
for /f "delims=: tokens=*" %%A in ('findstr /b ::: "%~f0"') do echo(%%A
:::
::: @@@@@@@@@@@@@@@@@@@@@@@@@@@
::: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
::: @@@@@@@@@@@Chromecast Streamer@@@@@@@@@@@
::: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
::: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
::: @@@@@@@@@@@@@@ '.@@@@@@@@@@@@@@@@@.--.@@@@@@@@@
::: @@@@@@@@\ @@ @@ @@@@@@@@@@@ '@@ ___..@@@@@@
::: @@@@@@@@| @ .'@@@@@@@@@@
::: @@@@@@\ /@@@@@@@@
::: \ /
::: | .--'|__|'--. |
::: | /.--'/ \'--.\ |
::: __ ___ / /____\ \ ___
::: _( )( )_ | .' .''. '. | _( )__ __ __
::: ( )_| |__/ \__| |_( )( )_ (
::: / \__ )_(_
::: _______.---./ .' COPY \_.--._ ___________
::: --''' _/ __ PASTA '--..
::: '' .' THE URL AND PRESS ENTER BELOW!!!
GOTO :eof
:start
cls
call :ascii_art
ECHO.
ECHO 1 - Kitchen
ECHO 2 - Living Room
ECHO 3 - My Room
ECHO 4 - EXIT
:: the choice command
set pass=
choice /c 1234 /n /m ""
set pass=%errorlevel%
:: Setting default input message and IP Address parameter, then changing them if needed,
:: depending on the user's choice
SET Param=
SET MSG=PASTE URL HERE:
IF "%pass%"=="1" SET Param=192.168.0.01
IF "%pass%"=="2" SET Param=-192.168.0.02
IF "%pass%"=="3" SET Param=192.168.0.03
IF "%pass%"=="4" GOTO exit
goto do_it
:do_it
cls
call :ascii_art
ECHO.
%DBG% User choice was : %pass%
SET URL=
set /p URL=%MSG%
IF [%URL%]==[] GOTO start
SET VLCstr="%URL%" --sout "#chromecast" --sout-chromecast-ip=%Param% --demux-filter=demux_chromecast
SET Command="X:\Software\Applications\win64\VLC\vlc.exe" %VLCstr%
%DBG% Running command : %Command%
%Command%
cls
call :ascii_art
ECHO.
ECHO Your stream has been vanquished.
pause
goto start
:exit
ENDLOCAL
Currently If you replace the %URL%
in the line with VLCstr=
with an actual URL, it works perfectly fine.
Theres something up with how I'm asking for the last input, and how its being put into the string.
I would like it to keep it where it accepts Weburls, and local files too.
Is there something simple I'm missing?