Skip to content

Commit

Permalink
clean up from testing, disabling downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
williameast committed Jul 1, 2022
1 parent ed3c071 commit 1cf0de8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 26 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
config.yaml
.direnv
__pycache__
18 changes: 2 additions & 16 deletions functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ def checkIfFolder(path):
return is_Folder


print(checkIfFolder("/home/weast/Downloads/cover"))


def torrentIdentifier(directory):
torrents = []
with os.scandir(directory) as localdir:
Expand All @@ -45,11 +42,11 @@ def getDiffList(a, b):
return difflist


# Todo: handle file already exists
# TODO: handle file already exists
def moveManager(torrents, torrent_dir):
for torrent in torrents:
try:
shutil.move(torrent, torrent_dir)
shutil.move(torrent.path, torrent_dir)
except Exception as e:
raise Exception(e)

Expand Down Expand Up @@ -162,17 +159,6 @@ def download_ftp_tree(
overwrite=False,
guess_by_extension=True,
):
"""
Downloads an entire directory tree from an ftp server to the local destination
:param ftp_handle: an authenticated ftplib.FTP instance
:param path: the folder on the ftp server to download
:param destination: the local directory to store the copied folder
:param pattern: Python regex pattern, only files that match this pattern will be downloaded.
:param overwrite: set to True to force re-download of all files, even if they appear to exist already
:param guess_by_extension: It takes a while to explicitly check if every item is a directory or a file.
if this flag is set to True, it will assume any file ending with a three character extension ".???" is
a file and not a directory. Set to False if some folders may have a "." in their names -4th position.
"""
path = path.lstrip("/")
original_directory = (
os.getcwd()
Expand Down
15 changes: 6 additions & 9 deletions main.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
import functions
import connectionhandler

# from time import sleep


# handle argument parsing
parser = argparse.ArgumentParser(
description="This tool finds .torrent files in your download folder\
Expand Down Expand Up @@ -35,12 +32,12 @@
action="store_true",
help="move files in inbound folder to outbound torrent folder",
) # move torrent files locally
parser.add_argument(
"--download",
"-d",
action="store_true",
help="Download torrents from seedbox.io to the specified folder.",
) # download torrents
# parser.add_argument(
# "--download",
# "-d",
# action="store_true",
# help="Download torrents from seedbox.io to the specified folder.",
# ) # download torrents
args = parser.parse_args()


Expand Down
2 changes: 1 addition & 1 deletion shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ let
python-packages.libtorrent-rasterbar
];
my-python = python37.withPackages my-python-packages;
in mkShell { buildInputs = [ bashInteractive my-python ]; }
in mkShell { buildInputs = [ bashInteractive my-python libressl ]; }

0 comments on commit 1cf0de8

Please sign in to comment.