Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9129659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:47:58+00:00 2026-06-17T07:47:58+00:00

I have some files uploaded at a filehoster which I want to download programmatically,

  • 0

I have some files uploaded at a filehoster which I want to download programmatically, using Delphi. They don’t require any captchas or the like, normally you simply press a button and you get the file. Let’s take this as an example.

Now I thought I could simply take the URL the Download Now – Button is pointing at, use an TIdHTTP.Get request and save it with a MemoryStream / Filestream / whatever. Copying the link address leads to this site, which, when entered into my browser pops up the download prompt.

var
  MemStream: TMemoryStream;
  code: string;       // added for solution
  number: integer;    // added for solution
begin
  with TIdHTTP.Create(nil) do
  try
    HandleRedirects := true;
    System.Delete(code,1,AnsiPos('var n =',code)+7);                  // added
    number := StrToInt(AnsiLeftStr(code,AnsiPos(' ',code)-1)) + 1;    // added
    MemStream := TMemoryStream.Create;
    try
      // Get('http://www56.zippyshare.com/d/5862319/604061/bgAvgTable.png', MemStream);
      Get(TIdURI.URLEncode('http://www56.zippyshare.com/d/5862319/' + IntToStr(number)
        + '/bgAvgTable.png'), MemStream);       // added for solution
      MemStream.SaveToFile('test.png');
    finally
      MemStream.Free;
    end;
  finally
    Free;
  end;
end;

However, using a checking tool I found that it contains a 302 redirect to the original site, thus when performing the GET-request I have to set HandleRedirects to avoid error messages and I get the HTML code of the original site rather than the file I had suspected.

So, I am kind of confused about how
1) I somehow get the file from my browser though the URL only contains a 302 redirect to the previous page and
2) I can achieve the same from within my code. Any chance someone of you might educate me a little there ? 😉

EDIT

Thanks to your input I could find the issue, turns out that the address I have to use gets generated using a random number, which is to be found in the original source. So posting a request to get the number first does the trick. I have edited the code accordingly.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:48:00+00:00Added an answer on June 17, 2026 at 7:48 am

    File hosting sites make different tricks to ensure you was not hotlinking and show you advertisement and perhaps counter. There can be

    • simple analysis of HTTP Referrer field in the request
    • setting and checking session-unique cookies
    • having HTTP Forms with hidden one-time values, and Download button would be not the link but the form’s Submit action.
    • generating one-time hashed URL, and encoding different parameters like your IP and your browser name into it
    • maybe more

    Tools like USDownloader and JDownloader makes a lot of attempts to circumvent it.

    While zippyshare seems to be more liberal, it still cannot afford hotlinking and should implement at least some measures of self-defense.
    When analysing traffic – start with absolutely fresh browser loading zippyshare page for the 1st time in its life and check it all.

    As i re-load the page few times i see that the number “604061” is different and link keep changing time and again after each reload. You probably have to load the page, parse the link, set the HTTP referer and only then download the file.

    You do not show the HTTP traffic logs so it is hard to tell for sure.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some files in ~Content/Documents folder which holds every uploaded file. In my
I have some exe files that I've uploaded into my database as I don't
I have a server which files get uploaded to, I want to be able
I have some files that I would like to rename using regex and powershell,
I have some files that are uuencoded, and I need to decode them, using
I have some CSV files that I need uploaded to a site I'm writing
I have a Media entity that has some basic fields for files uploaded by
I have couple of .swf games files uploaded to my server. I want to
In my project, I have to upload some video files to a folder which
I'm making a website on which administrators can upload some PDF files. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.