Usando Rapidshare API para verificar links de download e lista de arquivos em PHP

Eu estava procurando hoje por alguma forma de procurar por arquivos postados em serviços populares de compartilhamento de arquivo como Rapidshare e Megaupload… 

Eu rapidamente encontrei um monte de lixo, terrível codificação, documentação e APIs pobres mal concebido.

Aqui estava um artigo que pode ajudar com a forma de verificar os links são válidos ou não:

using-rapidshare-api-to-check-if-a-file-is-downloadable

Foi difícil encontrar, então eu postei uma versão aqui. Eu supor que eu poderia procurar com a API para arquivos públicos listados no Rapidshare (RapidShare AG, Cham, Switzerland), mas a menos que eu perdi alguma coisa nos docs – parece que pensei que você só pode procurar seus arquivos pessoais (usando Rapidshare função API listfiles)?

Incluído é um segundo script usando listfiles, essa função requer autenticação através de seu nome de usuário e senha.

Bem, eu não encontrei o que eu estava à procura de sua API, por isso estou passando para FilesTube API. Eles permitem que mais flexablity e os resultados na formatação XML agradável.

Rapidshare Exemplos em PHP

1) Rapidshare API function – checkfiles

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)
2=File OK (TrafficShare direct download without any logging)
3=Server down
4=File marked as illegal
5=Anonymous file locked, because it has more than 10 downloads already
6=File OK (TrafficShare direct download with enabled 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

Baixar código PHP:
(rapidshare-check_file_downloadable.function.php.txt)

2) Rapidshare API function – listfiles

sub=listfiles
Description:	Lists all files in a given format in a given RealFolder or in all RealFolders. While there is no limit how many files an account can save, this routine will
		return max. 3000 files. If you get exactly 3000 files, you do not know if some files were skipped. The user is heavily encouraged to use sub folders now.
Parameters:	login=ID or username
		password=password of the login
		realfolder=ID of the real folder to list files from. 0=root all=All folders (max. 3000 entries will be returned!)
		filename=Optional. Give a filename to get only results where filename=$filename. Search for %foo% to find any filename containing foo.
		fileids=Optional. Give a comma-separated list of file IDs to get only results with the corresponding file IDs. fileids=1545615,1345154,215143
		fields=A comma separated list of database columns you want to receive. You will always receive the fileid.
			Example: fields=downloads,size will reply many lines in the format "$fileid,$downloads,$size\n"
			The following columns are available: downloads,lastdownload,filename,size,killcode,serverid,type,x,y,realfolder,bodtype,killdeadline,licids,uploadtime
			Format: Everything is human readable except timestamps, which are unix timestamps (integers).
		order=Reply will be ordered by this column. All file columns are valid. (optional. Avoid this parameter to reduce CPU load.)
		desc=0 or 1. 1 means, the result will be ordered descending. (optional)
Reply fields:	1:fileid
		2:dynamically adjusted
		OR
		"NONE" (if no results, it returns "NONE")
Reply format:	integer,fields (provided fields depend on your request)

Baixar código PHP:
(rapidshare-listfiles.function.php.txt)

Rapid Share Documentação da API:
http://images.rapidshare.com/apidoc.txt

Share
Tags: , , , , , , , , , ,

Deixe uma resposta

O seu endereço de email não será publicado Campos obrigatórios são marcados *

*

Você pode usar estas tags e atributos de HTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">