Spaces:
Running
Running
Hashir Kashif
commited on
Commit
·
56aaf7d
1
Parent(s):
a632adb
editing99999990999asasdasd
Browse files- app.py +25 -2
- ftp_test.py +29 -0
app.py
CHANGED
@@ -13,6 +13,7 @@ from threading import Thread
|
|
13 |
import time
|
14 |
import json
|
15 |
from urllib.parse import unquote
|
|
|
16 |
os.remove("./cookies/test.txt")
|
17 |
|
18 |
class Unbuffered(object):
|
@@ -141,9 +142,17 @@ def getNetflixInfo(cookiefile):
|
|
141 |
S = 3
|
142 |
ran = ''.join(
|
143 |
random.choices(string.ascii_uppercase + string.digits, k=S))
|
|
|
144 |
shutil.move(
|
145 |
-
cookiefile,
|
146 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
|
148 |
except Exception as e:
|
149 |
print(e)
|
@@ -177,6 +186,20 @@ def testTask():
|
|
177 |
os.chdir("../")
|
178 |
|
179 |
def backupTask(location,filename):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
archived = shutil.make_archive('./'+filename, 'zip', location)
|
181 |
header = {
|
182 |
'authorization': os.environ['DISCORD_CODE'],
|
|
|
13 |
import time
|
14 |
import json
|
15 |
from urllib.parse import unquote
|
16 |
+
import ftplib
|
17 |
os.remove("./cookies/test.txt")
|
18 |
|
19 |
class Unbuffered(object):
|
|
|
142 |
S = 3
|
143 |
ran = ''.join(
|
144 |
random.choices(string.ascii_uppercase + string.digits, k=S))
|
145 |
+
newCookiefile = "../Membership/" + billingDate + " " + planName + " " + lang + " (" + str(ran) + ").txt"
|
146 |
shutil.move(
|
147 |
+
cookiefile, newCookiefile)
|
148 |
+
session = ftplib.FTP('hashir672.serv00.net','f6857_hashir_serv00','Hashirisbest@1122')
|
149 |
+
|
150 |
+
file = open(newCookiefile,'rb') # file to send
|
151 |
+
session.storbinary('STOR ./public_html/Membership/'+newCookiefile, file) # send the file
|
152 |
+
file.close() # close file and FTP
|
153 |
+
session.quit()
|
154 |
+
os.remove(newCookiefile)
|
155 |
+
|
156 |
|
157 |
except Exception as e:
|
158 |
print(e)
|
|
|
186 |
os.chdir("../")
|
187 |
|
188 |
def backupTask(location,filename):
|
189 |
+
for file in glob.glob("./Membership/*.txt"):
|
190 |
+
os.remove(file)
|
191 |
+
|
192 |
+
session = ftplib.FTP('hashir672.serv00.net','f6857_hashir_serv00','Hashirisbest@1122')
|
193 |
+
session.cwd('./public_html/Membership')
|
194 |
+
files = session.nlst()
|
195 |
+
files.remove(".")
|
196 |
+
files.remove("..")
|
197 |
+
for file in files:
|
198 |
+
# print(file)
|
199 |
+
r = requests.get("https://hashir672.serv00.net/Membership/"+file)
|
200 |
+
open("./Membership/"+file,"wb").write(r.content)
|
201 |
+
session.quit()
|
202 |
+
|
203 |
archived = shutil.make_archive('./'+filename, 'zip', location)
|
204 |
header = {
|
205 |
'authorization': os.environ['DISCORD_CODE'],
|
ftp_test.py
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import ftplib
|
2 |
+
import requests
|
3 |
+
import time
|
4 |
+
import os
|
5 |
+
import glob
|
6 |
+
for fileName in glob.glob("./testMembership/*.txt"):
|
7 |
+
os.remove(fileName)
|
8 |
+
|
9 |
+
session = ftplib.FTP('hashir672.serv00.net','f6857_hashir_serv00','Hashirisbest@1122')
|
10 |
+
|
11 |
+
# file = open('./cookies.txt','rb') # file to send
|
12 |
+
# session.storbinary('STOR ./public_html/Membership/cookies.txt', file) # send the file
|
13 |
+
# file.close() # close file and FTP
|
14 |
+
session.cwd('./public_html/Membership')
|
15 |
+
|
16 |
+
files = session.nlst()
|
17 |
+
files.remove(".")
|
18 |
+
files.remove("..")
|
19 |
+
for file in files:
|
20 |
+
print(file)
|
21 |
+
r = requests.get("https://hashir672.serv00.net/Membership/"+file)
|
22 |
+
open("./testMembership/"+file,"wb").write(r.content)
|
23 |
+
session.quit()
|
24 |
+
|
25 |
+
# time.sleep(4)
|
26 |
+
# for file in files:
|
27 |
+
# os.remove("./testMembership/"+file)
|
28 |
+
|
29 |
+
|