Adding date stamp to vlc recorded streams
I have few bat files created to record my favorite audio streams but I
would like to include the dates in the output file.
Is there a way to include the date in the name of the output file for
the code below? For the example I would like the file to show a format
similar to this "wzakfrimix-Jan 01 2016.mp3"
See if one of the below will get this done as expected assuming your favorite stream URLs can be plugged in as an array on separate lines and tabbed as mentioned in the script notes below as well as the [first] topmost example.
The topmost script iterates your favorite URL stream paths (the array as big or as little as you need it) in a loop. Otherwise (maybe how you do it now with multiple batch files) you could just hard code the Month Name, Month Day Number, and Year variables into the destination file name manually (example below).
Again, two variations below which may suffice for your need but I did set some of the script logig variables up top of each example.
SCRIPT NOTES
These are setup for run as batch scripts and not manually from command line with copy and paste; otherwise, I'd need to add examples for doing it that was as well.
The below image is the top script example where each http://~
path needs to be valid and supposedly different per line. Take lines out that are not needed or add others as needed but all need to have valid paths to download the file you are about to stream record into MP3 files.
Batch Script Examples
With a List of URLs for your Streams (as a batch script)
@ECHO ON
SET VLC=C:\Program Files (x86)\VideoLAN\VLC\vlc.exe
SET MM=%DATE:~4,2%
SET YYYY=%DATE:~10,4%
SET DD=%DATE:~7,2%
:VBSDynamicBuild
SET TempVBSFile=%tmp%\~tmpMnthTemp.vbs
IF EXIST "%TempVBSFile%" DEL /F /Q "%TempVBSFile%"
ECHO WScript.Echo(MonthName(%MM%,True))>>"%TempVBSFile%"
FOR /F %%A IN ('CSCRIPT //nologo "%TempVBSFile%"') DO SET Mmm=%%~A
:VLCStreamURLs
FOR %%B IN (
"http://208.46.117.156/7/648/72151/v1/interactive.akacast.akamaistream.net/wzak-fm"
"<http://ValidPath2/~>"
"<http://ValidPath3/~>"
"<http://ValidPath4/~>
"<http://ValidPath5/~>"
"<http://ValidPath6/~>"
"<http://ValidPath7/~>"
) DO (
"%VLC%" "%%~B" :sout=#transcode{vcodec=none,acodec=mp3,ab=128,channels=2,samplerate=44100}::file{dst="X:\%%~NB-%Mmm% %DD% %YYYY%%%~XB",no-overwrite} :sout-keep
)
GOTO EOF
Single URL per Batch Script (may be similiar to how you do this now)
@ECHO ON
SET VLC=C:\Program Files (x86)\VideoLAN\VLC\vlc.exe
SET MM=%DATE:~4,2%
SET YYYY=%DATE:~10,4%
SET DD=%DATE:~7,2%
:VBSDynamicBuild
SET TempVBSFile=%tmp%\~tmpMnthTemp.vbs
IF EXIST "%TempVBSFile%" DEL /F /Q "%TempVBSFile%"
ECHO WScript.Echo(MonthName(%MM%,True))>>"%TempVBSFile%"
FOR /F %%A IN ('CSCRIPT //nologo "%TempVBSFile%"') DO SET Mmm=%%~A
:VLCStreamURL
"%VLC%" "http://208.46.117.156/7/648/72151/v1/interactive.akacast.akamaistream.net/wzak-fm" :sout=#transcode{vcodec=none,acodec=mp3,ab=128,channels=2,samplerate=44100}::file{dst="D:\wzakfrimix-%Mmm% %DD% %YYYY%.mp3",no-overwrite} :sout-keep
GOTO EOF