IVY DOM


 

人生就像一副复杂拼图
每个人总有属於自己的记忆碎片
优质美国空间-老薛主机|IVY DOM|Flowline|

联系我

RSS




十二月 31, 2012

[开源]获取优酷/土豆片源下载地址

编译环境:Visual Studio 2010

使用本软件需要: .NET Framework 4.0

软件&源码下载链接:

http://pan.baidu.com/share/link?shareid=176132&uk=3574435742

原理:

xmlhttp获取网页源代码

字符串处理

P.S.做这个的初衷是用来下动漫的….

源代码(懒得写注释啦~自己debug能看懂的~):

Public Class Form1
    Const top0 = "<a href=" + Chr(34)
    Const feet0 = Chr(34) + " target=" + Chr(34) + "_blank" + Chr(34)
    Const enter0 = Chr(10) + Chr(13)
    Sub read()
        Dim re As String, i As Integer, urlv() As String, footer As String = "", laststr As String = ""
        re = XMLhttp("http://www.flvcd.com/parse.php?kw=" + TextBox1.Text)
        urlv = Split(re, "<BR>")
        footer += urlv(1) + enter0 + urlv(2) + enter0 + urlv(3) + enter0
        footer += Microsoft.VisualBasic.Left(urlv(4), 313)
        'Debug.Write("55" + footer)
        urlv = Split(footer, enter0)
        Debug.WriteLine(UBound(urlv))
        ListBox1.Items.Clear()
        For i = 0 To UBound(urlv)
            laststr = instrexa(urlv(i), top0, feet0) + enter0
            Debug.WriteLine(laststr)
            ListBox1.Items.Insert(i, laststr)
        Next
    End Sub
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Debug.Write(feet0)
    End Sub
    Public Function XMLhttp(ByVal url As String)
        On Error Resume Next
        Dim obj As Object
        obj = CreateObject("Microsoft.XMLHttp")
        obj.Open("GET", url, False)
        obj.Send()
        Dim r As String = obj.ResponseText.ToString
        obj = Nothing
        Return r
    End Function
    Function instrexa(ByVal fulltext As String, ByVal left As String, ByVal right As String) As String
        Dim lswz, length As Integer, lstr As String
        length = Len(fulltext)
        lswz = InStr(fulltext, left) + Len(left)
        lstr = Mid(fulltext, lswz, length)
        length = Len(lstr)
        lswz = InStr(lstr, right) - 1
        lstr = Mid(lstr, 1, lswz)
        Return lstr
    End Function
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        read()
    End Sub
    Private Sub ListBox1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.DoubleClick
        System.Diagnostics.Process.Start(ListBox1.Text)
    End Sub
End Class

图片浏览(在程序中双击链接列表即可下载哦~):

预览

热爱动漫的熊孩子们 不来一发吗

相关文章

返回
  1. 过来支持一下,坐个沙发。

    • Ben
    • 十二月 31st, 2012

    Mark了,哈哈。。其实我一般都用flvcd的

  2. 支持下咯。。。。。 另外要是下载优酷视频自动把几个小部分合并成一个文件会不会更加好呢?

  1. 暂无 Trackback

You must be logged in to post a comment.