Advertisement
Guest User

Untitled

a guest
Oct 17th, 2010
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.23 KB | None | 0 0
  1. #!/usr/bin/python3
  2. import os, sys,urllib.request
  3.  
  4. def main():
  5.     if len(sys.argv) == 1:
  6.        Clear_CLI()
  7.        About()
  8.        Prompted_Exec()
  9.     else:
  10.        Clear_CLI()
  11.        About()
  12.        List_Exec(sys.argv[1])
  13.  
  14. def About():#Information about the script and Author.
  15.     print('#----------------------------------------------------------------------#')
  16.     print('# Script Name : Rapidshare Account Checker v0.1                        #')
  17.     print('# Author      : Kreshnik Hasanaj                                       #')
  18.     print('# Mail        : kresha7@hotmail.com                                    #')
  19.     print('# WebPage     : http://selftaughtgeek.wordpress.com                    #')
  20.     print('# Purpose     : rsc.py rchecklist.txt | or simply exec script          #')
  21.     print('# Usage       : At your own risk                                       #')
  22.     print('# List Format : username:password and new line                         #')
  23.     print('# Requirements: At your own risk                                       #')
  24.     print('# Distribution: You can freely use this code in your own               #')
  25.     print('#               applications, but you may not reproduce                #')
  26.     print('#               or publish this code on any web site,                  #')
  27.     print('#               online service, or distribute as source                #')
  28.     print('#               on any media without express permission.               #')
  29.     print('#----------------------------------------------------------------------#\n')
  30.  
  31. def Clear_CLI():#Checking what platform we're running on to perform CLI cleaning.
  32.     if sys.platform == ('win32' or 'win64'): os.system('cls')
  33.     elif sys.platform == ('linux' or 'linux2'): os.system('clear')
  34.  
  35. def Prompted_Exec():#Prompt User for Input to get Account Informations.
  36.     Username = input("Please enter your Username:")
  37.     Password = input("Please enter your Password:")
  38.     print('--------------------------------------')
  39.  
  40.     try:
  41.        if len(Username) and len(Password) != 0:
  42.           Response = urllib.request.urlopen("http://api.rapidshare.com/cgi-bin/rsapi.cgi?sub=getaccountdetails_v1&type=prem&login="+Username+"&password="+Password)
  43.           ResOut = Response.read()
  44.           Response.close()
  45.  
  46.           if len(ResOut) < 44:
  47.              print('Login failed.')
  48.           else:
  49.              List = ResOut
  50.              for Items in List.split():
  51.                  print(Items)
  52.              print('--------------------------------------')              
  53.              
  54.        else:
  55.           print ("You forgot to enter your Username or Password")
  56.           sys.exit(0)
  57.     except:
  58.           print('Error Accured!')
  59.        
  60. def List_Exec(FileName):#Check's a list with account's if there broken or still working.
  61.  
  62.     try:
  63.         CurrDir = os.getcwd() + '\\'
  64.         FileHwnd = open(CurrDir + FileName)
  65.    
  66.         for line in FileHwnd.readlines():
  67.             sBuffer = line
  68.             AccountInfo = sBuffer.split(':')
  69.             RsUsername = AccountInfo[0]
  70.             RsPassword = AccountInfo[1]
  71.             Response = urllib.request.urlopen("http://api.rapidshare.com/cgi-bin/rsapi.cgi?sub=getaccountdetails_v1&type=prem&login="+RsUsername+"&password="+RsPassword)
  72.             ResOut = Response.read()
  73.             Response.close()
  74.  
  75.             if len(ResOut) < 44:
  76.                print('Username:{} Password:{} is not working. :('.format(RsUsername,RsPassword))
  77.                print('------------------------------------------------------------------------')
  78.             else:
  79.                print('Username:{} Password:{} is working!'.format(RsUsername,RsPassword))
  80.                print('------------------------------------------------------------------------')
  81.  
  82.                #Open File and write/append all working account's in it.
  83.                File = open(CurrDir + 'Working Accounts.txt','a')
  84.                File.writelines(RsUsername + ':' + RsPassword + '\n')
  85.  
  86.         print("\nAll working account's have been saved in the file (Working Account's.txt)")
  87.         print("*************************************************************************")
  88.         print("For suggestion's found bugs and idea's mail me mi4night@hotmail.com")
  89.  
  90.     except:
  91.           print('Error Accured!')
  92.  
  93.    
  94. if __name__ == '__main__':main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement