Archive solution for Windows based Streams (no streamripper)

Events happening in the community are now at Drupal community events on www.drupal.org.
flabat's picture

First I want to thank you those who wrote the magnificent Station module. I was able to migrate a static web radio site to Drupal making the broadcasters very happy.

In this case, the radio is streaming their programs using the mms protocol and they are unable to rip the stream using stream ripper.
Though they are able to provide mp3 files with the program's recording, the software used to create these files can not save them with the UNIX time stamp file name, only with the standard format YYYYMMDDhhmm.mp3.

I created the following vbs script that rename the files to the correct UNIX format, upload them all to your FTP site, and delete them after. Our station is running this script daily.

renftp.vbs (main script)

strComputer = "."

difhoraria = -2
difhorariaseg = difhoraria*3600


Set objWMIService = GetObject("winmgmts:\" & strComputer & "\root\cimv2")

Set colFiles = objWMIService.ExecQuery _
    ("ASSOCIATORS OF {Win32_Directory.Name='C:\ParaWeb'} Where " _
        & "ResultClass = CIM_DataFile")

For Each objFile In colFiles
   filenametxt = Right(objFile.Name, 16)
  filenametxt = Left(filenametxt, 12)
    yeartxt = Left(filenametxt, 4)
filenametxt = Right(filenametxt, 8)
    monthtxt = Left(filenametxt, 2)
    filenametxt = Right(filenametxt, 6)
    daytxt = Left(filenametxt, 2)
  filenametxt = Right(filenametxt, 4)
    hourtxt = Left(filenametxt, 2)
filenametxt = Right(filenametxt, 2)
    minutetxt = Left(filenametxt, 2)
  
   datetxt = yeartxt & "-" & monthtxt & "-" & daytxt & " " & hourtxt & ":" & minutetxt
   
   newdatetxt = DateDiff("s", "01/01/1970 00:00:00", datetxt) + difhorariaseg

    strEnd = Right(objFile.Name, 4)
    strNewName = objFile.Drive & objFile.Path & newdatetxt & strEnd
    errResult = objFile.Rename(strNewName)

Next

Set objShell = CreateObject("WScript.Shell")
objShell.Run "c:\windows\system32\ftp.exe -s:sendfiles.txt", , True
objShell.Run "delete.cmd", , True
Set objShell = Nothing

sendfiles.txt

open ftp.yoursite.com
username
password
cd /files/archivo/
prompt
mput c:\ParaWeb*.mp3
quit

delete.cmd

del c:\paraweb*.mp3

Radio

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week