Python-red-gen-space / ftp_test.py
Hashir Kashif
editing99999990999asasdasd
56aaf7d
raw
history blame
825 Bytes
import ftplib
import requests
import time
import os
import glob
for fileName in glob.glob("./testMembership/*.txt"):
os.remove(fileName)
session = ftplib.FTP('hashir672.serv00.net','f6857_hashir_serv00','Hashirisbest@1122')
# file = open('./cookies.txt','rb') # file to send
# session.storbinary('STOR ./public_html/Membership/cookies.txt', file) # send the file
# file.close() # close file and FTP
session.cwd('./public_html/Membership')
files = session.nlst()
files.remove(".")
files.remove("..")
for file in files:
print(file)
r = requests.get("https://hashir672.serv00.net/Membership/"+file)
open("./testMembership/"+file,"wb").write(r.content)
session.quit()
# time.sleep(4)
# for file in files:
# os.remove("./testMembership/"+file)