-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathupdate.py
More file actions
57 lines (51 loc) · 1.62 KB
/
update.py
File metadata and controls
57 lines (51 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env python3
import urllib.request
import os
import subprocess
import sys
import zipfile
from bs4 import BeautifulSoup
import ssl
url = "https://felis.kernelblog.org/tarih.txt"
url2 = "https://felis.kernelblog.org/felis/felis.zip"
context = ssl._create_unverified_context()
prefix=os.getenv("PREFIX","")
termux=len(prefix) > 2
if not termux:
prefix="/usr"
sudo="" if termux else "sudo "
os.system(sudo+"pip3 install beautifulsoup4 requests PrettyTable youtube_dl --upgrade")
try:
url_oku = urllib.request.urlopen(url)
except urllib.error.URLError as e:
print("\nLütfen İnternet Bağlantınızı Kontrol Ediniz!\n")
sys.exit(0)
soup = BeautifulSoup(url_oku, 'html.parser')
if str(soup) == "30/09/2019":
print("\nFelis Aracı Güncel.\n")
else:
veri = urllib.request.urlopen(url2, context = context)
f = open("felis.zip", 'wb')
f.write(veri.read())
f.close()
feliszip = zipfile.ZipFile("felis.zip","r")
feliszip.extractall(path=None, members=None)
os.system("rm felis.zip")
ls = os.popen("ls "+os.getcwd()+"/felis")
ls = list(ls)
for i in ls:
i = i.replace("\n","")
if i == "felis":
os.system(sudo+"rm "+prefix+"/bin/felis")
os.system(sudo+"mv "+os.getcwd()+"/felis/felis "+prefix+"/bin/")
os.system(sudo+"chmod 755 "+prefix+"/bin/felis")
elif i == "kur.sh":
pass
elif i == "ekstra.py":
os.system("python3 "+os.getcwd()+"/felis/ekstra.py")
else:
os.system(sudo+"rm "+prefix+"/share/felis/"+i)
os.system(sudo+"mv "+os.getcwd()+"/felis/"+i+" "+prefix+"/share/felis/")
os.system(sudo+"chmod 755 "+prefix+"/share/felis/"+i)
print("\nFelis Aracı Başarıyla Güncellendi.")
os.system("rm -r felis")