Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
183c8a7
added badge (#36)
Logan1x Oct 16, 2017
d702b36
Update README.md (#37)
Logan1x Oct 16, 2017
30c1e2f
image to vector data (#35)
apuayush Oct 17, 2017
0992c26
Develop (#38)
Logan1x Oct 17, 2017
3418ea0
add offline dictionary (#45)
SuryaThiru Oct 18, 2017
07feb30
Sort scripts alphabetically (#48)
szepnapot Oct 19, 2017
e73e017
Set theme jekyll-theme-minimal
Logan1x Oct 20, 2017
a3fc020
Set theme jekyll-theme-architect
Logan1x Oct 20, 2017
c2099a6
Updated readme.md
Logan1x Oct 20, 2017
95940a3
Update README.md
Logan1x Oct 20, 2017
fd7fd85
Update README.md
Logan1x Oct 20, 2017
780965c
Added a python script to download high quality videos and audio using…
Oct 21, 2017
aef61fa
Feature/ftp download (#51)
ehnydeel Oct 23, 2017
4c9f7e4
added URL shortener (#55)
abhinavralhan Oct 24, 2017
e32313e
desciption of the Twitter_retweet_bot script (#54)
iyanuashiri Oct 24, 2017
d21c81e
added script to download formatted tweets from a specific user (#50)
pr0me Oct 24, 2017
8f36229
Meme density correction (#56)
Harshvardhan58 Oct 25, 2017
4275734
added cloud script (#57)
shivamp123 Oct 25, 2017
784ecbd
Update README.md (#59)
iyanuashiri Oct 26, 2017
a1cccde
Twitter retweet bot (#44)
iyanuashiri Oct 26, 2017
6131267
updated readme (#60)
Logan1x Oct 26, 2017
c59952c
Updated README.md (#61)
khushboopaddiyar Oct 26, 2017
90edb4c
Update README.md (#62)
ahadali Oct 26, 2017
f8675d9
Sentiment Analysis of Twitter Feeds (#64)
niharikakrishnan Oct 28, 2017
e8cc152
README.md (#72)
chiraag-jain Oct 28, 2017
01bf840
Edited the readme and arranged alphabetically (#75)
Logan1x Oct 31, 2017
e09e23b
Lost Robot script is added (#63)
dgupta777 Oct 31, 2017
bf8189e
Add new Feature getExternalIp.py (#53)
ehnydeel Oct 31, 2017
161cac8
Add fetch_html script (#52)
zinuzoid Oct 31, 2017
0f9e174
arranged root file directory
Logan1x Nov 7, 2017
91b0352
Added : readme.md (#78)
Logan1x Nov 7, 2017
8b5d00e
Added : Readme.md (#79)
Logan1x Nov 7, 2017
061adda
Merge branch 'develop' into master
Logan1x Nov 7, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Feature/ftp download (#51)
* add ftp_download_file.py

* Add help to README.md

* Add ehnydeel to README.md as contributer

* Change order of FTP-Download in README.md
  • Loading branch information
ehnydeel authored and Logan1x committed Oct 23, 2017
commit aef61fa8912b6fe29893d7fb6f69c3a92f7b7282
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,17 @@ Useful for phones which might hide files in FileExplorer, but allow use as flash
Directly prints results if run directly.
May also be imported, yielding results one by one.

* ### FTP Download File
A simple application to download a file via FTP with the given remote and local path
Parameters:
* -hh hostname
* -u username
* -p password
* -rd remote directory
* -ld local directory
```bash
python ftp_download_file.py
```

* ### Handy offline dictionary
A tiny offline dictionary app based on nltk wordnet and pyqt5
Expand Down Expand Up @@ -192,7 +203,6 @@ python client.py
python server.py
```


* ### Video-downloader v1.1

### About
Expand Down Expand Up @@ -304,5 +314,6 @@ The following people helped in creating the above content.
* <a href="https://github.com/apuayush" target="_blank">Apurva Nitanjay</a>
* <a href="https://github.com/SuryaThiru" target="_blank">Surya K</a>
* <a href="https://github.com/szepnapot" target="_blank">Peter L.</a>
* <a href="https://github.com/ehnydeel" target="_blank">Andreas K.</a>

### If you like the project give a star [<img src="Selection_008.png" alt="Star button" align="top">](https://github.com/Logan1x/Python-Scripts/stargazers)
49 changes: 49 additions & 0 deletions bin/ftp_download_file.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import argparse
import os
from ftplib import FTP

def parse_args():
''' parse and check command line arguments '''
ap = argparse.ArgumentParser(description="FTP Utility")
ap.add_argument('-hh', dest='host', help="Host name")
ap.add_argument('-u', dest='username', help="user name")
ap.add_argument('-p', dest='password', help="user password")
ap.add_argument('-rd', dest='remote_dir', help="Path to remote directory")
ap.add_argument('-ld', dest='local_dir', help="Path to local directory")
ap.add_argument(dest='files', help="File names", nargs='+')
return ap.parse_args()

def is_empty(file):
file_size = os.stat(file).st_size
if file_size == 0:
print('The file {} is empty'.format(file))
return True
return False


args=parse_args()

host = args.host
username = args.username
password = args.password
remote_dir = args.remote_dir
local_dir = args.local_dir
files = args.files

ftp = FTP(host)
ftp.login(username, password)
ftp.cwd(remote_dir)

for file in files:
try:
local_filename = os.path.join(local_dir, file)
print('Getting filename: ' + file)
ftp.retrbinary('RETR %s' % file, open(local_filename, 'wb').write)
print('Saving at %s' % local_filename)
except Exception as err:
print(err)
if (is_empty(local_filename)):
os.remove(local_filename)
continue

ftp.quit()