Activity Stream
48,167 MEMBERS
61561 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 7 of 7
  1.     
    #1
    Member

    Default PHP how to get filehost file size without matching?

    Hello, is there anyway to get a file's file size that is hosted on hosts such as RS, HF, MU, NL, etc? I have been trying many different things and can't think of a surefire way beside matching it, which wouldn't be too reliable.
    c0rrup Reviewed by c0rrup on . PHP how to get filehost file size without matching? Hello, is there anyway to get a file's file size that is hosted on hosts such as RS, HF, MU, NL, etc? I have been trying many different things and can't think of a surefire way beside matching it, which wouldn't be too reliable. Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    I think the only way to do this is to create a regex for each host

  4.     
    #3
    Respected Developer
    Website's:
    wrzc.org
    It's easy for Rapidshare. You can use their API system.

    Code: 
    subroutine=checkfiles_v1
    Description:	Gets status details about a list of given files. (files parameter limited to 3000 bytes. filenames parameter limited to 30000 bytes.)
    Parameters:	files=comma separated list of file ids
    		filenames=comma separated list of the respective filename. Example: files=50444381,50444382 filenames=test1.rar,test2.rar
    		incmd5=if set to 1, field 7 is the hex-md5 of the file. This will double your points! If not given, all md5 values will be 0
    Reply fields:	1:File ID
    		2:Filename
    		3:Size (in bytes. If size is 0, this file does not exist.)
    		4:Server ID
    		5:Status integer, which can have the following numeric values:
    			0=File not found
    			1=File OK (Anonymous downloading)
    			3=Server down
    			4=File marked as illegal
    			5=Anonymous file locked, because it has more than 10 downloads already
    			50+n=File OK (TrafficShare direct download type "n" without any logging.)
    			100+n=File OK (TrafficShare direct download type "n" with logging. Read our privacy policy to see what is logged.)
    		6:Short host (Use the short host to get the best download mirror: http://rs$serverid$shorthost.rapidshare.com/files/$fileid/$filename)
    		7:md5 (See parameter incmd5 in parameter description above.)
    Reply format:	integer,string,integer,integer,integer,string,string
    What this basically is is the info of the file you want to get.

    Using this random file from Katz as an example

    Code: 
    http://rapidshare.com/files/411931722/qbqbspbdiujnfgpsboojijmbujpogou.rar
    You have two id parts. The file number which is 411931722 and the file name which is qbqbspbdiujnfgpsboojijmbujpogou.rar

    Adding the file number, name and the sub above you'll get a string like this:

    Code: 
    http://api.rapidshare.com/cgi-bin/rsapi.cgi?sub=checkfiles_v1&files=411931722&filenames=qbqbspbdiujnfgpsboojijmbujpogou.rar
    This returns lots of info about the file including it's size. You can use something like file_get_contents to get the data and exploxe the , (commas) and easily get the $match[2]

    For other file hosts (with the exception of SendSpace who also have an api system) you'll have to cURL the page and get the size using regex with is a bit of a balls, a lot slower and way less accurate.


    Noobs guide:

    Click this link and it returns funny stuff:
    http://api.rapidshare.com/cgi-bin/rs...jmbujpogou.rar
    Tutorial How to SEO your Warez Site a guide to help you increase your organic traffic

    Huge list of Warez Sites and free Multiposter Templates

  5.     
    #4
    Member
    Website's:
    csoffensive.com fagbag.me
    lolololololololo ok u have to use ff and get add on grasemonkey then go to userscripts and install rapidshare links checker and cavern links checker then it makes the links clickable so when u pass ur mous over it u see the size it also tells u wheter the links are alive or not

  6.     
    #5
    Member
    Website's:
    intelligen2009.com
    i made a very small tool for this, but seems you more interested in how to do this; well i've published some delphi snippets how to do this in another forum.

    Netload.in:


    Code: 
    {*******************************************************}
    {                                                       }
    {       Netload.in Delphi API                           }
    {       Version 1.0.0.0                                 }
    {       Copyright (c) 2010 Sebastian Klatte             }
    {                                                       }
    {*******************************************************}
    unit uNetloadIn;
    
    interface
    
    uses
      SysUtils, Classes, Math, HTTPApp, IdHTTP,
    
      RegExpr,
    
      uPlugInFileHosterClass,
    
      uPathUtils;
    
    type
      TNetloadIn = class(TFileHosterPlugIn)
      public
        function GetName: WideString; override; safecall;
        function CheckSize(AFiles: WideString): Extended; override;
      end;
    
    implementation
    
    { TNetloadIn }
    
    function TNetloadIn.GetName: WideString;
    begin
      Result := 'Netload.in';
    end;
    
    function TNetloadIn.CheckSize(AFiles: WideString): Extended;
    
      function GetDownloadlinkID(ALink: string): string;
      begin
        with TRegExpr.Create do
          try
            InputString := ALink;
            Expression := '\/datei([a-zA-Z0-9]+)';
    
            if Exec(InputString) then
              Result := Match[1];
          finally
            Free;
          end;
        if (Result = '') then
          with TRegExpr.Create do
            try
              InputString := ALink;
              Expression := 'file_id=([a-zA-Z0-9]+)';
    
              if Exec(InputString) then
                Result := Match[1];
            finally
              Free;
            end;
        if (Result = '') then
          with TRegExpr.Create do
            try
              InputString := ALink;
              Expression := 'netload\.in\/([a-zA-Z0-9]+)\/';
    
              if Exec(InputString) then
                Result := Match[1];
            finally
              Free;
            end;
      end;
    
      function GetSizeinBytes(ALinkResult: string): Integer;
      begin
        with TRegExpr.Create do
          try
            InputString := ALinkResult;
            Expression := '(.*?);(.*?);(\d+);(.*?);([0-9a-fA-F]+)';
    
            if Exec(InputString) then
              Result := StrToIntDef(Match[3], 0);
          finally
            Free;
          end;
      end;
    
    var
      I: Integer;
      s: string;
      _params, _postreply: TStringStream;
      _size: Int64;
    begin
      _size := 0;
      with TIdHTTP.Create(nil) do
        try
          with TStringList.Create do
            try
              Text := AFiles;
    
              _params := TStringStream.Create('');
              _postreply := TStringStream.Create('');
              try
                _params.WriteString('auth=BVm96BWDSoB4WkfbEhn42HgnjIe1ilMt&bz=1&md5=1&file_id=');
                s := '';
                for I := 0 to Count - 1 do
                begin
                  if (I > 0) then
                    _params.WriteString(';');
                  _params.WriteString(GetDownloadlinkID(Strings[I]));
    
                  if (I > 0) and (I mod 100 = 0) or (I = Count - 1) then
                  begin
                    Request.ContentType := 'application/x-www-form-urlencoded';
                    Post('http://api.netload.in/info.php', _params, _postreply);
                    s := s + _postreply.DataString;
                    _params.Clear;
                    _params.WriteString('auth=BVm96BWDSoB4WkfbEhn42HgnjIe1ilMt&bz=1&md5=1&file_id=');
                    _postreply.Clear;
                  end;
                end;
              finally
                _postreply.Free;
                _params.Free;
              end;
    
              // c8Dig5OG2L;Board Detector.rar;469412;online;9f6787473902087256d5d25006104e8c
    
              Text := s;
    
              for I := 0 to Count - 1 do
                _size := _size + GetSizeinBytes(Strings[I]);
    
              Result := RoundTo((_size / 1048576), -2);
            finally
              Free;
            end;
        finally
          Free;
        end;
    end;
    
    end.


    Megaupload.com:


    Code: 
    {*******************************************************}
    {                                                       }
    {       Megaupload.com Delphi API                       }
    {       Version 1.0.0.0                                 }
    {       Copyright (c) 2010 Sebastian Klatte             }
    {                                                       }
    {*******************************************************}
    unit uMegauploadCom;
    
    interface
    
    uses
      Windows, SysUtils, Classes, Math, HTTPApp, IdHTTP,
    
      RegExpr,
    
      uPlugInFileHosterClass,
    
      uPathUtils;
    
    type
      TMegauploadCom = class(TFileHosterPlugIn)
      public
        function GetName: WideString; override; safecall;
        function CheckSize(AFiles: WideString): Extended; override;
      end;
    
    implementation
    
    { TMegauploadCom }
    
    function TMegauploadCom.GetName: WideString;
    begin
      result := 'Megaupload.com';
    end;
    
    function TMegauploadCom.CheckSize(AFiles: WideString): Extended;
    
      function GetDownloadlinkID(ALink: string): string;
      begin
        with TRegExpr.Create do
          try
            InputString := ALink;
            Expression := 'd=([a-zA-Z0-9]+)';
    
            if Exec(InputString) then
              result := Match[1];
          finally
            Free;
          end;
      end;
    
      function GetSizeinMegaBytes(ALinkResult: string): Extended;
      begin
        result := 0;
    
        with TRegExpr.Create do
          try
            InputString := ALinkResult;
            Expression := 's=(\d+)&';
    
            if Exec(InputString) then
            begin
              repeat
                result := result + (StrToIntDef(Match[1], 0) / 1048576);
              until not ExecNext;
            end;
          finally
            Free;
          end;
      end;
    
    var
      I: Integer;
      _params, _postreply: TStringStream;
    begin
      with TIdHTTP.Create(nil) do
        try
          with TStringList.Create do
            try
              Text := AFiles;
    
              _params := TStringStream.Create('');
              _postreply := TStringStream.Create('');
              try
                for I := 0 to Count - 1 do
                  _params.WriteString('id' + IntToStr(I) + '=' + GetDownloadlinkID(Strings[I]) + '&');
    
                Request.ContentType := 'application/x-www-form-urlencoded';
                Post('http://megaupload.com/mgr_linkcheck.php', _params, _postreply);
    
                Text := _postreply.DataString;
              finally
                _postreply.Free;
                _params.Free;
              end;
    
              result := RoundTo(GetSizeinMegaBytes(Text), -2);
            finally
              Free;
            end;
        finally
          Free;
        end;
    end;
    
    end.


    Uploaded.to:


    Code: 
    {*******************************************************}
    {                                                       }
    {       Uploaded.to Delphi API                          }
    {       Version 1.0.0.0                                 }
    {       Copyright (c) 2010 Sebastian Klatte             }
    {                                                       }
    {*******************************************************}
    unit uUploadedTo;
    
    interface
    
    uses
      SysUtils, Classes, Math, HTTPApp, IdHTTP,
    
      RegExpr,
    
      uPlugInFileHosterClass,
    
      uPathUtils;
    
    type
      TUploadedTo = class(TFileHosterPlugIn)
      public
        function GetName: WideString; override; safecall;
        function CheckSize(AFiles: WideString): Extended; override;
      end;
    
    implementation
    
    { TRapidshareCom }
    
    function TUploadedTo.GetName: WideString;
    begin
      Result := 'Uploaded.to';
    end;
    
    function TUploadedTo.CheckSize(AFiles: WideString): Extended;
    
      function IncludeTrailingSlash(const S: string): string;
    
        function IsPathDelimiter(const S: string; index: Integer): Boolean;
        begin
          Result := (index > 0) and (index <= Length(S)) and (S[index] = '/') and (ByteType(S, index) = mbSingleByte);
        end;
    
      begin
        Result := S;
        if not IsPathDelimiter(Result, Length(Result)) then
          Result := Result + '/';
      end;
    
      function GetDownloadlinkID(ALink: string): string;
      begin
        ALink := StringReplace(ALink, 'ul.to/', 'uploaded.to/file/', [rfReplaceAll, rfIgnoreCase]);
        ALink := StringReplace(ALink, '/?id=', '/file/', [rfReplaceAll, rfIgnoreCase]);
        ALink := StringReplace(ALink, '?id=', 'file/', [rfReplaceAll, rfIgnoreCase]);
    
        with TRegExpr.Create do
          try
            InputString := IncludeTrailingSlash(ALink);
            Expression := 'uploaded.to/file/(.*?)/';
    
            if Exec(InputString) then
              Result := Match[1];
          finally
            Free;
          end;
      end;
    
    var
      I: Integer;
      _postreply: TStringList;
      _size: Int64;
    begin
      _size := 0;
      with TIdHTTP.Create(nil) do
        try
          with TStringList.Create do
            try
              Text := AFiles;
    
              for I := 0 to Count - 1 do
              begin
                _postreply := TStringList.Create;
                try
                  _postreply.Text := Get('http://uploaded.to/api/file?id=' + GetDownloadlinkID(Strings[I]));
    
                  if _postreply.Count > 0 then
                    _size := _size + StrToIntDef(_postreply.Strings[1], 0);
                finally
                  _postreply.Free;
                end;
    
                (*
                  Board Detector.rar
                  469412
                  2e91fe5831a1002b4b1cf6aabf54f8227bd9479c
                  *)
                if (Count > 10) and (I > 0) then
                begin
                  Sleep(2000);
    
                  if (I mod 10 = 0) then
                    Sleep(3000);
                end;
              end;
    
              Result := RoundTo((_size / 1048576), -2);
            finally
              Free;
            end;
        finally
          Free;
        end;
    end;
    
    end.


    you just need to convert it to php ...

  7.     
    #6
    Member
    @Mr Happy, my current script is adding a few thousand files per day, I think rapidshare API would limit me very quickly.

    Looks like I will have to custom match with regex for each site!

  8.     
    #7
    Respected Developer
    Website's:
    wrzc.org
    Quote Originally Posted by c0rrup View Post
    @Mr Happy, my current script is adding a few thousand files per day, I think rapidshare API would limit me very quickly.

    Looks like I will have to custom match with regex for each site!
    Nope they won't as you can request a few hundred links at a time and a few thousand requests a day. I managed to check upto a million before my server started to get dizzy. Rapidshare was still going strong.

    get like this

    http://api.rapidshare.com/cgi-bin/rs...jmbujpogou.rar

    Used the same link 20 times so I didn't have to go looking for other links but hopefully it will give you the idea.

    @ geskill, that's a nice script you have their.
    Tutorial How to SEO your Warez Site a guide to help you increase your organic traffic

    Huge list of Warez Sites and free Multiposter Templates

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 2nd Nov 2012, 11:58 AM
  2. Rar a file and size
    By zoug100 in forum General Discussion
    Replies: 1
    Last Post: 10th Dec 2011, 04:21 PM
  3. uploaded.to file size?
    By vladavina in forum File Host Discussion
    Replies: 4
    Last Post: 23rd Oct 2011, 12:40 AM
  4. Hotfile File Size?
    By _brazzO in forum General Discussion
    Replies: 4
    Last Post: 9th Dec 2010, 01:36 PM
  5. Replies: 2
    Last Post: 28th Jul 2010, 06:54 PM

Tags for this Thread

BE SOCIAL