Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to intercept Rapidshare file download in WebBrowser control?

How to intercept Rapidshare file download in WebBrowser control?

Scheduled Pinned Locked Moved C#
regexcsharpcomhelptutorial
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anindya Chatterjee
    wrote on last edited by
    #1

    I am developing a C# app which will download Rapidshare files for Free users. The program would work as follows: 1. Rapidshare webpage would open in WebBrowser control. 2. Captcha would be input in the webpage 3. File download will occur using the download manager of the app, instead of the default download manager. I have designed the download section in the following way. private void rapidWebBrowser_Navigating(object sender, WebBrowserNavigatingEventArgs e) { string filename = @"C:\test.rar"; Regex pattern = new Regex(@"http://([0-9a-zA-Z]+)\.rapidshare\.(com|de)/files/([0-9]+)/([0-9]+)/([^\r\n]+)", RegexOptions.IgnoreCase); string match = e.Url.AbsoluteUri; if (pattern.IsMatch(match)) { e.Cancel = true; WebClient client = new WebClient(); Uri uri = new Uri(match); client.DownloadFileAsync(uri, filename); } } While running, the app downloads a 10KB file instead of the real one. If I use the followsing code: private void rapidWebBrowser_FileDownload(object sender, EventArgs e) { Regex pattern = new Regex(@"http://([0-9a-zA-Z]+)\.rapidshare\.(com|de)/files/([0-9]+)/([0-9]+)/([^\r\n]+)", RegexOptions.IgnoreCase); if (pattern.IsMatch(match)) // match is assigned to the required navigating url { WebClient client = new WebClient(); Uri uri = new Uri(match); client.DownloadFileAsync(uri, filename); } } the app downloads a 10KB file and pops up IE's default download manager. How to solve the problem? I want to intercept the original file download by WebBrowser control, and pass the url to my app's custom downloader suppressing the IE's downloader. How to do this? I am eagerly waiting for the solution. Thank you in advance.

    Anindya Chatterjee

    V 1 Reply Last reply
    0
    • A Anindya Chatterjee

      I am developing a C# app which will download Rapidshare files for Free users. The program would work as follows: 1. Rapidshare webpage would open in WebBrowser control. 2. Captcha would be input in the webpage 3. File download will occur using the download manager of the app, instead of the default download manager. I have designed the download section in the following way. private void rapidWebBrowser_Navigating(object sender, WebBrowserNavigatingEventArgs e) { string filename = @"C:\test.rar"; Regex pattern = new Regex(@"http://([0-9a-zA-Z]+)\.rapidshare\.(com|de)/files/([0-9]+)/([0-9]+)/([^\r\n]+)", RegexOptions.IgnoreCase); string match = e.Url.AbsoluteUri; if (pattern.IsMatch(match)) { e.Cancel = true; WebClient client = new WebClient(); Uri uri = new Uri(match); client.DownloadFileAsync(uri, filename); } } While running, the app downloads a 10KB file instead of the real one. If I use the followsing code: private void rapidWebBrowser_FileDownload(object sender, EventArgs e) { Regex pattern = new Regex(@"http://([0-9a-zA-Z]+)\.rapidshare\.(com|de)/files/([0-9]+)/([0-9]+)/([^\r\n]+)", RegexOptions.IgnoreCase); if (pattern.IsMatch(match)) // match is assigned to the required navigating url { WebClient client = new WebClient(); Uri uri = new Uri(match); client.DownloadFileAsync(uri, filename); } } the app downloads a 10KB file and pops up IE's default download manager. How to solve the problem? I want to intercept the original file download by WebBrowser control, and pass the url to my app's custom downloader suppressing the IE's downloader. How to do this? I am eagerly waiting for the solution. Thank you in advance.

      Anindya Chatterjee

      V Offline
      V Offline
      Vikram A Punathambekar
      wrote on last edited by
      #2

      Have you tried renaming the small file you get and opening it in IE? I believe Rapidshare blocks download accelerators.

      Cheers, Vikram.


      The hands that help are holier than the lips that pray.

      A 1 Reply Last reply
      0
      • V Vikram A Punathambekar

        Have you tried renaming the small file you get and opening it in IE? I believe Rapidshare blocks download accelerators.

        Cheers, Vikram.


        The hands that help are holier than the lips that pray.

        A Offline
        A Offline
        Anindya Chatterjee
        wrote on last edited by
        #3

        I am not at all using any accelerator. I am just using mere WebClient to download. Basically I know that using Http POST Rapidshare transfer files. But how to embed it in my app to intercept the default download manager, I don't know. That is I am searching for.

        Anindya Chatterjee

        V 1 Reply Last reply
        0
        • A Anindya Chatterjee

          I am not at all using any accelerator. I am just using mere WebClient to download. Basically I know that using Http POST Rapidshare transfer files. But how to embed it in my app to intercept the default download manager, I don't know. That is I am searching for.

          Anindya Chatterjee

          V Offline
          V Offline
          Vikram A Punathambekar
          wrote on last edited by
          #4

          Apologies, I misread your post. I had tried using a download accelerator once and it failed. Have you tried downloading the full file and comparing its contents with those of the one your app downloads? I still think it might be useful to rename the file you get to .HTML and open it in your browser.

          Cheers, Vikram.


          The hands that help are holier than the lips that pray.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups