Multi Hoster Uploader serves as both a command-line tool and a Python package for uploading files to multiple file hosting services. It enables easy and efficient file uploads to various hosting services by trying them in a predefined or random order. If one hoster fails for any reason, the next hoster in the list is tried.
- Hoster Status
- Installation
- Usage
- Using MultiHosterManager in Your Own Script
- Developing Custom Hoster Classes
- Acknowledgments
- License
Hoster | Status |
---|---|
FileIo | |
GoFile | |
KeepSh |
- Clone this repository:
git clone https://github.com/c-kr/multi_hoster_uploader.git
- Change into the project directory:
cd multi_hoster_uploader
- Install the required packages:
pip install -r requirements.txt
- Optionally symlink the CLI Tool to your PATH
ln -s /path/to/multi_hoster_uploader/multi_hoster_uploader ~/.local/bin/multi_hoster_uploader
Upload a file using the default hosters and order:
multi_hoster_uploader --file /path/to/your/file.txt
Upload a file using a random hoster order:
multi_hoster_uploader --file /path/to/your/file.txt --random-hoster
To modify the default hoster sequence, adjust the HOSTERS variable within the multi_hoster_uploader file.
To use the MultiHosterManager
class in your own script, follow these steps:
- Import the
MultiHosterManager
class and the hoster classes you want to use:
from hoster import MultiHosterManager
from hoster.hosters import FileIoHoster, GofileHoster, KeepShHoster
Instantiate the MultiHosterManager class with the list of hoster classes and, optionally, a flag to randomize the hoster order:
manager = MultiHosterManager([FileIoHoster, GofileHoster, KeepShHoster], random_hoster=True)
Call the upload method of the MultiHosterManager instance, providing the file path as an argument:
download_url = manager.upload('/path/to/your/file.txt')
To develop custom hoster classes, follow these steps:
- Create a new Python file for your custom hoster class in the
hoster/hosters
directory. - Import the
Hoster
base class fromhoster.base_hoster
. - Create a new class that inherits from
Hoster
and implement the required methods, such asupload
andprocess_response
. - Add your custom hoster class to the
HOSTERS
list in themulti_hoster_uploader
script. - Extend Unittest, Github Workflow and README.md
- Open a Github Pull Request if you want to share your hoster class
For more information on creating custom hoster classes, refer to the existing hoster classes in the hoster/hosters
directory.
I would like to acknowledge the contribution of GPT-4 by OpenAI in the development of various parts of the Multi Hoster Uploader.