Advertisement
Yoloswagger

cyv

Jul 2nd, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.16 KB | None | 0 0
  1. #!/usr/env python
  2.  
  3. import urllib.request
  4. import filecmp
  5. import os
  6. import asyncio
  7. from ftplib import FTP
  8. import time
  9.  
  10. url = "https://raw.githubusercontent.com/SteamDatabase/SalienCheat/master/cheat.php"
  11. urllib.request.urlretrieve(url, 'cheat.txt')
  12. urllib.request.urlretrieve(url, 'cheat_last.php')
  13.  
  14. print("starting program")    
  15. def task():
  16.     same = filecmp.cmp('cheat.txt' , 'cheat_last.php')
  17.     if not same:
  18.         try:
  19.             def agent_Edit():
  20.                 string1 = "CURLOPT_USERAGENT      => 'SalienCheat (https://github.com/SteamDatabase/SalienCheat/)',"
  21.                 string2 = "CURLOPT_USERAGENT      => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3464.0 Safari/537.36)',"
  22.  
  23.                 f1 = open('cheat.txt', 'r')
  24.                 f2 = open('cheat.txt2', 'w')
  25.                 for line in f1:
  26.                     f2.write(line.replace(string1, string2))
  27.                 f1.close()
  28.                 f2.close()
  29.  
  30.            
  31.             def update_edit():
  32.                 string3 = "Msg( '-- {lightred}Script has been updated on GitHub since you started this script, please make sure to update.' );"
  33.                 string4 = "Msg( '-- {lightred}Le Script a une mise a jour, telecharge le avec check.bat' );"
  34.  
  35.                 f1 = open('cheat.txt2', 'r')
  36.                 f2 = open('cheat.txt3', 'w')
  37.                 for line in f1:
  38.                     f2.write(line.replace(string3, string4))
  39.                 f1.close()
  40.                 f2.close()
  41.  
  42.             def change_url():
  43.                 string5 = "CURLOPT_URL            => 'https://raw.githubusercontent.com/SteamDatabase/SalienCheat/master/cheat.php?_=' . $Time,"
  44.                 string6 = "CURLOPT_URL            => 'ftp://www.cyvaxapi.890m.com/saliens/cheat.cyv' . $Time,"
  45.                 f1 = open('cheat.txt2', 'r')
  46.                 f2 = open('cheat.cyv', 'w')
  47.                 for line in f1:
  48.                     f2.write(line.replace(string5, string6))
  49.                 f1.close()
  50.                 f2.close()
  51.  
  52.             def upload():
  53.                 user = "---------"
  54.                 password = "---------"
  55.                 with FTP('cyvaxapi.890m.com') as ftp:
  56.                     ftp.login(user, password)
  57.                     ftp.cwd('saliens')
  58.                    
  59.                     fichier = 'cheat.cyv'
  60.                     file = open('cheat.cyv', 'rb')
  61.                     ftp.storbinary('STOR '+fichier, file)
  62.                     file.close()
  63.  
  64.             def clearFile():
  65.                 if os.path.isfile("cheat.txt2"):
  66.                     os.remove("cheat.txt2")
  67.                 else:
  68.                     return
  69.  
  70.             agent_Edit()
  71.             print("agent edit done.")
  72.  
  73.             update_edit()
  74.             print("agent update done.")
  75.  
  76.             change_url()
  77.             print("url update done.")
  78.  
  79.             upload()
  80.             print("upload done.")
  81.  
  82.             clearFile()
  83.             print("Clear File.")
  84.            
  85.            
  86.         except ValueError:
  87.             print('error')
  88.     else:        
  89.         print("Nothing to do.")
  90.  
  91. while True:
  92.     task()
  93.     time.sleep(600)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement