Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/env python
- import urllib.request
- import filecmp
- import os
- import asyncio
- from ftplib import FTP
- import time
- url = "https://raw.githubusercontent.com/SteamDatabase/SalienCheat/master/cheat.php"
- urllib.request.urlretrieve(url, 'cheat.txt')
- urllib.request.urlretrieve(url, 'cheat_last.php')
- print("starting program")
- def task():
- same = filecmp.cmp('cheat.txt' , 'cheat_last.php')
- if not same:
- try:
- def agent_Edit():
- string1 = "CURLOPT_USERAGENT => 'SalienCheat (https://github.com/SteamDatabase/SalienCheat/)',"
- 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)',"
- f1 = open('cheat.txt', 'r')
- f2 = open('cheat.txt2', 'w')
- for line in f1:
- f2.write(line.replace(string1, string2))
- f1.close()
- f2.close()
- def update_edit():
- string3 = "Msg( '-- {lightred}Script has been updated on GitHub since you started this script, please make sure to update.' );"
- string4 = "Msg( '-- {lightred}Le Script a une mise a jour, telecharge le avec check.bat' );"
- f1 = open('cheat.txt2', 'r')
- f2 = open('cheat.txt3', 'w')
- for line in f1:
- f2.write(line.replace(string3, string4))
- f1.close()
- f2.close()
- def change_url():
- string5 = "CURLOPT_URL => 'https://raw.githubusercontent.com/SteamDatabase/SalienCheat/master/cheat.php?_=' . $Time,"
- string6 = "CURLOPT_URL => 'ftp://www.cyvaxapi.890m.com/saliens/cheat.cyv' . $Time,"
- f1 = open('cheat.txt2', 'r')
- f2 = open('cheat.cyv', 'w')
- for line in f1:
- f2.write(line.replace(string5, string6))
- f1.close()
- f2.close()
- def upload():
- user = "---------"
- password = "---------"
- with FTP('cyvaxapi.890m.com') as ftp:
- ftp.login(user, password)
- ftp.cwd('saliens')
- fichier = 'cheat.cyv'
- file = open('cheat.cyv', 'rb')
- ftp.storbinary('STOR '+fichier, file)
- file.close()
- def clearFile():
- if os.path.isfile("cheat.txt2"):
- os.remove("cheat.txt2")
- else:
- return
- agent_Edit()
- print("agent edit done.")
- update_edit()
- print("agent update done.")
- change_url()
- print("url update done.")
- upload()
- print("upload done.")
- clearFile()
- print("Clear File.")
- except ValueError:
- print('error')
- else:
- print("Nothing to do.")
- while True:
- task()
- time.sleep(600)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement