Skip to content

Multitool to connect to remote FTP, download files, uncompress, rename & upload

Notifications You must be signed in to change notification settings

kahache/multitool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

FTP Downloader - Unzipper - Renamer - Uploader

License

This is a Python script that facilitates the process of downloading files from an FTP server, extracting them from zip archives, renaming the files based on TV channel names, and uploading them to another location. It is designed to automate the workflow for TV content processing.

The story behind this, it was a bash tool I did some years ago (and which is kept in the folder), so this is just an exercise on adapting it 100% to Python and add some unit testing.

Features

  • Downloads files from an FTP server using the lftp command-line tool.
  • Extracts files from zip archives.
  • Renames files according to TV channel names and adds a configurable delay.
  • Moves the renamed files to an "uploading" folder.
  • Supports configurable timeouts for waiting for downloaded files.

Installation

Just clone the repository:

git clone https://github.com/your-username/ftp-downloader.git

Usage

Configure the FTP connection and download settings in download.config. Run the script with the desired command-line arguments:

python Multitool_full.py -k TV1 -i /path/to/folder -o /path/to/download -d download.config -t 60 -r 2
-k/--tv_name: The TV name for the platform (required).
-i/--folder: The folder where the files are downloaded (required).
-o/--download_folder: The main folder of the downloader (required).
-d/--download_config: The downloading configuration for the lftp tool (required).
-t/--timeout: Timeout (in seconds) for waiting for downloaded files (required).
-r/--delay: Hours delayed in the final file name (required).

Unit Tests

The project includes a comprehensive set of unit tests to ensure the correctness of the functionality. To run the unit tests, execute the following command:

python -m unittest discover

Contributing

Contributions are welcome! If you have any suggestions, bug reports, or feature requests, please open an issue or submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Feel free to customize the content as per your project's specific details and requirements.

About

Multitool to connect to remote FTP, download files, uncompress, rename & upload

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published