Rapid Share Fetish

31.07.2005

Okuyucu : 46.829
Günlük Okuyucu : 45,9

Simple class which allows you to get direct download links from RapidShare download URLs. Just for premium members. You have to provide username and password.

Also you have to replace FMHttp class with your own http class.
VS 2005, .NET 2.0

Kaynak Kodunu Download Edin (Download Source Code);

/opensource/source-code/RapidLover.txt

Kaynak Kod;

1 : <%
2 : Imports FM
3 : Imports FMLibrary.StringUtilities
4 : Imports System.ComponentModel

6 : ''' <summary>
7 : ''' Extract RapidShare Download Links
8 : ''' </summary>
9 : ''' <remarks></remarks>
10 : Public Class RapidLover

12 : Public Event LinkReady(ByVal sender As RapidLover, ByVal DownloadURL As String)

14 : Private _User As String
15 : Private _URL As String
16 : Private _Password As String
17 : Private _DownloadURL As String
18 : Private _FileName As String


21 : Public Sub New()

23 : End Sub

25 : Public Sub New(ByVal URL As String, ByVal User As String, ByVal Password As String)
26 : Me.URL = URL
27 : Me.User = User
28 : Me.Password = Password

30 : End Sub
31 : Public Property FileName() As String
32 : Get
33 : Return _FileName
34 : End Get
35 : Set(ByVal value As String)
36 : _FileName = value
37 : End Set
38 : End Property

40 : Public ReadOnly Property DownloadURL() As String
41 : Get
42 : Return _DownloadURL
43 : End Get
44 : End Property

46 : Public Property Password() As String
47 : Get
48 : Return _Password
49 : End Get
50 : Set(ByVal value As String)
51 : _Password = value
52 : End Set
53 : End Property

55 : Public Property User() As String
56 : Get
57 : Return _User
58 : End Get
59 : Set(ByVal value As String)
60 : _User = value
61 : End Set
62 : End Property

64 : Public Property URL() As String
65 : Get
66 : Return _URL
67 : End Get
68 : Set(ByVal value As String)
69 : _URL = value
70 : End Set
71 : End Property


74 : ''' <summary>
75 : ''' Grab RapidShare Link
76 : ''' </summary>
77 : ''' <returns>RapidShare Download Link (then use your fuckin' download manager, don't be a communist)</returns>
78 : ''' <remarks></remarks>
79 : Public Sub GetLink()

81 : Dim HTMLCode, DownloadURL As String

83 : Dim lURLLastIndexOf As Integer = URL.LastIndexOf("/")
84 : FileName = URL.Substring(lURLLastIndexOf + 1, URL.Length - lURLLastIndexOf - 1)

86 : 'Get Req (Sorry FMHTTP is not available it's big class with lots of bugs)
87 : Dim HTTPRapid As New HTTP(URL, HTTP.MethodList.POST)
88 : HTTPRapid.postData = "l=" & User & "&p=" & Password & "&hint=Service-Abuses+will+be+prosecuted%2C+80.237.244.61%21&downloadit=Download+" & FileName
89 : HTTPRapid.doRequest()
90 : HTMLCode = HTTPRapid.Code()

92 : 'Fix Link
93 : DownloadURL = ExtractText(HTMLCode, "unescape('", "')")
94 : DownloadURL = Web.HttpUtility.UrlDecode(DownloadURL)
95 : DownloadURL = ExtractText(DownloadURL, "a href=""h", """>")

97 : _DownloadURL = DownloadURL

99 : RaiseEvent LinkReady(Me, DownloadURL)
100 : End Sub


103 : End Class

105 : '// StringUtilities Module
106 : Namespace FMLibrary

108 : Public Module StringUtilities
109 :     Public Module StringUtilities
110 :      ''' <summary>
111 :      ''' Extract text from a string
112 :      ''' </summary>
113 :      ''' <returns></returns>
114 :      ''' <remarks></remarks>
115 :      Public Function ExtractText(ByVal Code As String, ByVal TagStart As String, ByVal TagEnd As String) As String

117 :         Dim posStartTag, posEndTag As Integer
118 :         posStartTag = Code.IndexOf(TagStart)

120 :         If posStartTag = -1 Then Return String.Empty

122 :         posEndTag = Code.IndexOf(TagEnd, posStartTag + 1)
123 :         If posEndTag = -1 Then Return String.Empty

125 :         Return Code.Substring(posStartTag + TagStart.Length - 1, posEndTag - posStartTag - TagStart.Length + 1)

127 :      End Function
128 :     End Module
129 : End Namespace
130 : %>
Source Script is modified version of HiLiter
Ferruh Mavituna
© 2002-2007, Ferruh Mavituna

Sabit IP Adresi : 81.22.99.133, SSL Erişimi, Hakkında