An unofficial API wrapper for seedr.cc. This library provides a simple and convenient way to interact with the Seedr API from your Python applications.
You can install the package using pip:
pip install seedrFirst, you need to create an instance of the SeedrAPI class. You can authenticate using your email and password, or by providing an existing access token.
from seedr import SeedrAPI
# Authenticate with email and password
seedr = SeedrAPI(email='your_email@example.com', password='your_password')
# Or, authenticate with an access token
# seedr = SeedrAPI(token='your_access_token')To get information about your account, including space usage and root folders:
drive_info = seedr.get_drive()
print(drive_info)To get the contents of a specific folder:
folder_contents = seedr.get_folder('folder_id')
print(folder_contents)To get information about a specific file, including a download link:
file_info = seedr.get_file('file_id')
print(file_info)To add a torrent to your account using a magnet link or a direct link to a .torrent file:
torrent_info = seedr.add_torrent('magnet:?xt=urn:btih:...')
print(torrent_info)To delete a folder from your account:
seedr.delete_folder('folder_id')To delete a file from your account:
seedr.delete_file('file_id')The library raises specific exceptions for different types of errors:
InvalidLogin: Raised for incorrect username or password.InvalidToken: Raised for an invalid or expired access token.LoginRequired: Raised when no authentication credentials are provided.
You can handle these exceptions using a try...except block:
from seedr.errors import InvalidLogin
try:
seedr = SeedrAPI(email='wrong@example.com', password='wrong_password')
except InvalidLogin:
print("Invalid login credentials.")Contributions are welcome! If you find a bug or have a feature request, please open an issue on the GitHub repository.
If you'd like to contribute code, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them with a descriptive message.
- Push your changes to your fork.
- Open a pull request to the main repository.