View Single Post
  #5  
Old 12-16-2010, 01:32 AM
gxdata gxdata is offline
Western Wombat
 
Join Date: Feb 2009
Posts: 332
gxdata is on a distinguished road
Default

Re: How to use iView (ABC Australia) downloaders


Quote:
Originally Posted by ComStraker View Post
Erm looks like illegal characters problem in Iviewnapper getting a file with "s*d" in the comedy section...by the way am a programmer, I like these programs alot and could help if someone developing them wants contact me.
Yes, see the previous page in this forum to get the latest version of the batch downloader (15.81) until mce does the next fix of iViewNapper.

Code:
' This uses the full list of invalid characters - regex method (FASTEST)
'  aesthetics: poor 
    Function CleanInput(ByVal strIn As String) As String
        Dim sb = New StringBuilder()
        Dim invalids = System.IO.Path.GetInvalidPathChars().Union(System.IO.Path.GetInvalidFileNameChars())

        ' Build the regex
        sb.Append("[")
        For Each c In invalids
            sb.Append("\") 
            sb.Append(c)
        Next c
        sb.Append("]")

        ' this is our regex
        Dim re = New System.Text.RegularExpressions.Regex(sb.ToString())

          ' Underscore is safe enough - but ugly
        Return re.Replace(strIn, "_")

    End Function
Reply With Quote