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
Do you want me to try each set code in notepad and save as .bat file and test? I tried each code and I get errors. I am new to all this and have no coding experience. – jp0213x – 2016-01-01T15:04:09.060
Here is an example of the url, I ripped from website and inserted into the vlc. http://208.46.117.156:80/7/648/72151/v1/interactive.akacast.akamaistream.net/wzak-fm
– jp0213x – 2016-01-01T18:19:31.830I am using a windows 7 machine " Errors from vlc are "input can't be opened" "File reading failed" – jp0213x – 2016-01-01T18:55:04.123
I am having no luck with the code above. – jp0213x – 2016-01-01T19:46:54.360
YES!!! that bottom code worked, I got an error at first but noticed that the drive letter was different and changed it back. Thanks! So I should be able to use this a template for the rest of my batch files. – jp0213x – 2016-01-01T23:13:42.820
I will edit each bat file I am currently using with your code to reflect the date stamp. Not sure about the array, I am clueless when it comes to coding. I am surprised I got this far. I wouldn't have figured this out without your help. I really appreciate it Happy New Year!! – jp0213x – 2016-01-01T23:30:34.643
This script has been working great for the past several months but I am having problems with this code. – jp0213x – 2016-10-07T13:23:12.990