yuumi


Nameyuumi JSON
Version 0.3.2 PyPI version JSON
download
home_pageNone
SummaryDebrid Manager Python package
upload_time2024-10-29 18:35:42
maintainerNone
docs_urlNone
authorDreu LaVelle
requires_python<4.0,>=3.11
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Yuumi

Yuumi is a Python package that allows you to use multiple debrid services in your Python projects.

## Installation

```bash
poetry add Yuumi
```

or

```bash
pip install Yuumi
```

## Usage

```python
from Yuumi.debrid import RealDebridAPI

api = RealDebridAPI("your_access_token")

# Get user info
user_info = await api.get_user_info()
print(user_info)

# Check instant availability
instant_availability = await api.get_instant_availability("2f5a5ccb7dc32b7f7d7b150dd6efbce87d2fc371")
print(instant_availability)

# Download a file
download = await api.add_magnet("magnet:?xt=urn:btih:2f5a5ccb7dc32b7f7d7b150dd6efbce87d2fc371")
print(download)
```

## Download Example

```python
import asyncio
from yuumi.debrid import RealDebridAPI

async def main():
    api = RealDebridAPI("your_access_token")

    # Example: Downloading a cached torrent
    torrent_hash = "your_torrent_hash"
    availability = await api.get_instant_availability(torrent_hash)
    if availability:
        magnet_link = "your_magnet_link"
        torrent_info = await api.add_magnet(magnet_link)
        torrent_id = torrent_info["id"]
        await api.select_torrent_files(torrent_id, "all")
        print("Files selected and ready for download.")
    else:
        print("Torrent is not cached.")

    # Example: Downloading a non-cached torrent
    magnet_link = "your_magnet_link"
    torrent_info = await api.add_magnet(magnet_link)
    torrent_id = torrent_info["id"]
    print("Torrent added. Waiting for it to be cached...")

    # Timeout mechanism: Give up after 5 minutes (300 seconds)
    timeout = 300
    start_time = asyncio.get_event_loop().time()

    while True:
        torrent_status = await api.get_torrent_info(torrent_id)
        if torrent_status["status"] == "downloaded":
            await api.select_torrent_files(torrent_id, "all")
            print("Files selected and ready for download.")
            break
        if asyncio.get_event_loop().time() - start_time > timeout:
            print("Timeout reached. Torrent is not cached. Giving up.")
            break
        await asyncio.sleep(30)  # Wait for 30 seconds before checking again

# Run the main function
asyncio.run(main())
```

## CLI Usage

```bash
yuumi --token YOUR_ACCESS_TOKEN --user
```

More information can be found here:
```bash
yuumi --help
```

## Contributing

Contributions are welcome! Please open an issue or submit a pull request.
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "yuumi",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.11",
    "maintainer_email": null,
    "keywords": null,
    "author": "Dreu LaVelle",
    "author_email": "dreu.lavelle@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/de/ef/f065db719f2f5cc49890754b8a03a6d51e311fd0a6a37063fe0482849921/yuumi-0.3.2.tar.gz",
    "platform": null,
    "description": "# Yuumi\n\nYuumi is a Python package that allows you to use multiple debrid services in your Python projects.\n\n## Installation\n\n```bash\npoetry add Yuumi\n```\n\nor\n\n```bash\npip install Yuumi\n```\n\n## Usage\n\n```python\nfrom Yuumi.debrid import RealDebridAPI\n\napi = RealDebridAPI(\"your_access_token\")\n\n# Get user info\nuser_info = await api.get_user_info()\nprint(user_info)\n\n# Check instant availability\ninstant_availability = await api.get_instant_availability(\"2f5a5ccb7dc32b7f7d7b150dd6efbce87d2fc371\")\nprint(instant_availability)\n\n# Download a file\ndownload = await api.add_magnet(\"magnet:?xt=urn:btih:2f5a5ccb7dc32b7f7d7b150dd6efbce87d2fc371\")\nprint(download)\n```\n\n## Download Example\n\n```python\nimport asyncio\nfrom yuumi.debrid import RealDebridAPI\n\nasync def main():\n    api = RealDebridAPI(\"your_access_token\")\n\n    # Example: Downloading a cached torrent\n    torrent_hash = \"your_torrent_hash\"\n    availability = await api.get_instant_availability(torrent_hash)\n    if availability:\n        magnet_link = \"your_magnet_link\"\n        torrent_info = await api.add_magnet(magnet_link)\n        torrent_id = torrent_info[\"id\"]\n        await api.select_torrent_files(torrent_id, \"all\")\n        print(\"Files selected and ready for download.\")\n    else:\n        print(\"Torrent is not cached.\")\n\n    # Example: Downloading a non-cached torrent\n    magnet_link = \"your_magnet_link\"\n    torrent_info = await api.add_magnet(magnet_link)\n    torrent_id = torrent_info[\"id\"]\n    print(\"Torrent added. Waiting for it to be cached...\")\n\n    # Timeout mechanism: Give up after 5 minutes (300 seconds)\n    timeout = 300\n    start_time = asyncio.get_event_loop().time()\n\n    while True:\n        torrent_status = await api.get_torrent_info(torrent_id)\n        if torrent_status[\"status\"] == \"downloaded\":\n            await api.select_torrent_files(torrent_id, \"all\")\n            print(\"Files selected and ready for download.\")\n            break\n        if asyncio.get_event_loop().time() - start_time > timeout:\n            print(\"Timeout reached. Torrent is not cached. Giving up.\")\n            break\n        await asyncio.sleep(30)  # Wait for 30 seconds before checking again\n\n# Run the main function\nasyncio.run(main())\n```\n\n## CLI Usage\n\n```bash\nyuumi --token YOUR_ACCESS_TOKEN --user\n```\n\nMore information can be found here:\n```bash\nyuumi --help\n```\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request.",
    "bugtrack_url": null,
    "license": null,
    "summary": "Debrid Manager Python package",
    "version": "0.3.2",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2e64eb604a302443ef2ff71c6381202f98e52f36f90121b5b8fe8a554ad6df0d",
                "md5": "d513e568212cf7e5436188374399a432",
                "sha256": "7c0aef15e8c65445295b06d16b1ab13613ddcd563ca6bfc0e0147fca755098e7"
            },
            "downloads": -1,
            "filename": "yuumi-0.3.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d513e568212cf7e5436188374399a432",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.11",
            "size": 6745,
            "upload_time": "2024-10-29T18:35:39",
            "upload_time_iso_8601": "2024-10-29T18:35:39.652501Z",
            "url": "https://files.pythonhosted.org/packages/2e/64/eb604a302443ef2ff71c6381202f98e52f36f90121b5b8fe8a554ad6df0d/yuumi-0.3.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "deeff065db719f2f5cc49890754b8a03a6d51e311fd0a6a37063fe0482849921",
                "md5": "029173995be80f9391bc796f03b11362",
                "sha256": "e9a94996d46190f7670ac206f464b30f41ca3d34d198305371a4d538e668328d"
            },
            "downloads": -1,
            "filename": "yuumi-0.3.2.tar.gz",
            "has_sig": false,
            "md5_digest": "029173995be80f9391bc796f03b11362",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.11",
            "size": 5543,
            "upload_time": "2024-10-29T18:35:42",
            "upload_time_iso_8601": "2024-10-29T18:35:42.392572Z",
            "url": "https://files.pythonhosted.org/packages/de/ef/f065db719f2f5cc49890754b8a03a6d51e311fd0a6a37063fe0482849921/yuumi-0.3.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-29 18:35:42",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "yuumi"
}
        
Elapsed time: 0.37948s