truelink


Nametruelink JSON
Version 1.1.0 PyPI version JSON
download
home_pageNone
SummaryExtract direct download links from various URL formats
upload_time2025-07-15 08:16:35
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT
keywords direct-link download extractor link url
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # TrueLink

A Python library for resolving media URLs to direct download links from various file hosting services.

## Features

- **Asynchronous**: Built with async/await for efficient handling of multiple requests
- **Easy to use**: Simple API with intuitive method names
- **Extensible**: Support for multiple file hosting platforms
- **Error handling**: Robust error handling for various edge cases
- **URL validation**: Built-in URL validation before processing

## Installation

```bash
pip install truelink
```

## Quick Start

```python
import asyncio
from truelink import TrueLinkResolver

async def main():
    resolver = TrueLinkResolver()
    url = "https://buzzheavier.com/rnk4ut0lci9y"

    try:    
        if resolver.is_supported(url):    
            result = await resolver.resolve(url)    
            print(type(result))    
            print(result)    
        else:    
            print(f"URL not supported: {url}")    
    except Exception as e:    
        print(f"Error processing {url}: {e}")

asyncio.run(main())
```

## Advanced Usage

### Batch Processing

```python
import asyncio
from truelink import TrueLinkResolver

async def process_multiple_urls():
    resolver = TrueLinkResolver()
    urls = [
        "https://buzzheavier.com/rnk4ut0lci9y",
        "https://mediafire.com/file/example",
        "https://gofile.io/d/example"
    ]
    
    tasks = []
    for url in urls:
        if resolver.is_supported(url):
            tasks.append(resolver.resolve(url))
    
    results = await asyncio.gather(*tasks, return_exceptions=True)
    return results

# Run batch processing
results = asyncio.run(process_multiple_urls())
```

## API Reference

### TrueLinkResolver

#### Methods

- `is_supported(url: str) -> bool`: Check if a URL is supported
- `resolve(url: str) -> dict`: Resolve URL to direct download link
- `get_supported_domains() -> list`: Get list of supported domains

#### Return Format

The `resolve()` method returns one of two result types:

**LinkResult** (for single files):
```python
{
    "url": "direct_download_url",
    "filename": "original_filename",
    "mime_type": "video/mp4",
    "size": 1234567,  # Size in bytes (optional)
    "headers": {"Authorization": "Bearer token"}  # Custom headers if needed (optional)
}
```

**FolderResult** (for folders/multi-file links):
```python
{
    "title": "Folder Name",
    "contents": [
        {
            "url": "direct_download_url_1",
            "filename": "file1.pdf",
            "mime_type": "application/pdf",
            "size": 1234567,
            "path": "subfolder/file1.pdf"
        },
        {
            "url": "direct_download_url_2",
            "filename": "file2.jpg",
            "mime_type": "image/jpeg",
            "size": 987654,
            "path": "file2.jpg"
        }
    ],
    "total_size": 2222221,  # Total size of all files
    "headers": {"Authorization": "Bearer token"}  # Custom headers if needed (optional)
}
```

## Supported Sites

### ✅ Working
- [x] buzzheavier
- [x] 1fichier
- [x] fuckingfast
- [x] gofile
- [x] linkbox
- [x] lulacloud
- [x] mediafile (size parsing left)
- [x] mediafire
- [x] pixeldrain
- [x] streamtape
- [x] terabox
- [x] tmpsend
- [x] uploadee
- [x] yandexlink
- [x] ranoz
- [ ] swisstransfer
- [ ] onedrive
- [ ] pcloud

### ⏳ Not Working
- [ ] devuploads (todo)
- [ ] doodstream
- [ ] filepress (todo)
- [ ] krakenfiles
- [ ] uploadhaven (different)
- [ ] wetransfer

## Error Handling

The library provides comprehensive error handling:

```python
from truelink import TrueLinkResolver, TrueLinkException

async def handle_errors():
    resolver = TrueLinkResolver()
    
    try:
        result = await resolver.resolve(url)
    except TrueLinkException as e:
        print(f"TrueLink specific error: {e}")
    except Exception as e:
        print(f"General error: {e}")
```

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

### Adding Support for New Sites

1. Fork the repository
2. Create a new resolver module for your site
3. Add the site to the supported sites list
4. Submit a pull request

## Requirements

- Python 3.7+
- aiohttp
- beautifulsoup4
- requests

## License

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

## Disclaimer

This project is intended for educational and personal use only.

Downloading content using this tool must comply with the terms of service of the respective websites. The developer is not responsible for any misuse or illegal activity involving this software.

Use at your own risk.

## Support

If you encounter any issues or have questions:

1. Check the [Issues](https://github.com/5hojib/truelink/issues) page
2. Create a new issue with detailed information
3. Include error messages and the URL you're trying to process

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "truelink",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "5hojib <yesiamshojib@gmail.com>",
    "keywords": "direct-link, download, extractor, link, url",
    "author": null,
    "author_email": "5hojib <yesiamshojib@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/c9/33/46fe6532d7b0a5079bc297d5bca65d970a175e9fd6d851a973d010d84ba3/truelink-1.1.0.tar.gz",
    "platform": null,
    "description": "# TrueLink\n\nA Python library for resolving media URLs to direct download links from various file hosting services.\n\n## Features\n\n- **Asynchronous**: Built with async/await for efficient handling of multiple requests\n- **Easy to use**: Simple API with intuitive method names\n- **Extensible**: Support for multiple file hosting platforms\n- **Error handling**: Robust error handling for various edge cases\n- **URL validation**: Built-in URL validation before processing\n\n## Installation\n\n```bash\npip install truelink\n```\n\n## Quick Start\n\n```python\nimport asyncio\nfrom truelink import TrueLinkResolver\n\nasync def main():\n    resolver = TrueLinkResolver()\n    url = \"https://buzzheavier.com/rnk4ut0lci9y\"\n\n    try:    \n        if resolver.is_supported(url):    \n            result = await resolver.resolve(url)    \n            print(type(result))    \n            print(result)    \n        else:    \n            print(f\"URL not supported: {url}\")    \n    except Exception as e:    \n        print(f\"Error processing {url}: {e}\")\n\nasyncio.run(main())\n```\n\n## Advanced Usage\n\n### Batch Processing\n\n```python\nimport asyncio\nfrom truelink import TrueLinkResolver\n\nasync def process_multiple_urls():\n    resolver = TrueLinkResolver()\n    urls = [\n        \"https://buzzheavier.com/rnk4ut0lci9y\",\n        \"https://mediafire.com/file/example\",\n        \"https://gofile.io/d/example\"\n    ]\n    \n    tasks = []\n    for url in urls:\n        if resolver.is_supported(url):\n            tasks.append(resolver.resolve(url))\n    \n    results = await asyncio.gather(*tasks, return_exceptions=True)\n    return results\n\n# Run batch processing\nresults = asyncio.run(process_multiple_urls())\n```\n\n## API Reference\n\n### TrueLinkResolver\n\n#### Methods\n\n- `is_supported(url: str) -> bool`: Check if a URL is supported\n- `resolve(url: str) -> dict`: Resolve URL to direct download link\n- `get_supported_domains() -> list`: Get list of supported domains\n\n#### Return Format\n\nThe `resolve()` method returns one of two result types:\n\n**LinkResult** (for single files):\n```python\n{\n    \"url\": \"direct_download_url\",\n    \"filename\": \"original_filename\",\n    \"mime_type\": \"video/mp4\",\n    \"size\": 1234567,  # Size in bytes (optional)\n    \"headers\": {\"Authorization\": \"Bearer token\"}  # Custom headers if needed (optional)\n}\n```\n\n**FolderResult** (for folders/multi-file links):\n```python\n{\n    \"title\": \"Folder Name\",\n    \"contents\": [\n        {\n            \"url\": \"direct_download_url_1\",\n            \"filename\": \"file1.pdf\",\n            \"mime_type\": \"application/pdf\",\n            \"size\": 1234567,\n            \"path\": \"subfolder/file1.pdf\"\n        },\n        {\n            \"url\": \"direct_download_url_2\",\n            \"filename\": \"file2.jpg\",\n            \"mime_type\": \"image/jpeg\",\n            \"size\": 987654,\n            \"path\": \"file2.jpg\"\n        }\n    ],\n    \"total_size\": 2222221,  # Total size of all files\n    \"headers\": {\"Authorization\": \"Bearer token\"}  # Custom headers if needed (optional)\n}\n```\n\n## Supported Sites\n\n### \u2705 Working\n- [x] buzzheavier\n- [x] 1fichier\n- [x] fuckingfast\n- [x] gofile\n- [x] linkbox\n- [x] lulacloud\n- [x] mediafile (size parsing left)\n- [x] mediafire\n- [x] pixeldrain\n- [x] streamtape\n- [x] terabox\n- [x] tmpsend\n- [x] uploadee\n- [x] yandexlink\n- [x] ranoz\n- [ ] swisstransfer\n- [ ] onedrive\n- [ ] pcloud\n\n### \u23f3 Not Working\n- [ ] devuploads (todo)\n- [ ] doodstream\n- [ ] filepress (todo)\n- [ ] krakenfiles\n- [ ] uploadhaven (different)\n- [ ] wetransfer\n\n## Error Handling\n\nThe library provides comprehensive error handling:\n\n```python\nfrom truelink import TrueLinkResolver, TrueLinkException\n\nasync def handle_errors():\n    resolver = TrueLinkResolver()\n    \n    try:\n        result = await resolver.resolve(url)\n    except TrueLinkException as e:\n        print(f\"TrueLink specific error: {e}\")\n    except Exception as e:\n        print(f\"General error: {e}\")\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n### Adding Support for New Sites\n\n1. Fork the repository\n2. Create a new resolver module for your site\n3. Add the site to the supported sites list\n4. Submit a pull request\n\n## Requirements\n\n- Python 3.7+\n- aiohttp\n- beautifulsoup4\n- requests\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Disclaimer\n\nThis project is intended for educational and personal use only.\n\nDownloading content using this tool must comply with the terms of service of the respective websites. The developer is not responsible for any misuse or illegal activity involving this software.\n\nUse at your own risk.\n\n## Support\n\nIf you encounter any issues or have questions:\n\n1. Check the [Issues](https://github.com/5hojib/truelink/issues) page\n2. Create a new issue with detailed information\n3. Include error messages and the URL you're trying to process\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Extract direct download links from various URL formats",
    "version": "1.1.0",
    "project_urls": {
        "Changelog": "https://github.com/5hojib/truelink/releases",
        "Documentation": "https://github.com/5hojib/truelink#readme",
        "Homepage": "https://github.com/5hojib/truelink",
        "Issues": "https://github.com/5hojib/truelink/issues",
        "Repository": "https://github.com/5hojib/truelink"
    },
    "split_keywords": [
        "direct-link",
        " download",
        " extractor",
        " link",
        " url"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "8665c02e9684d495448dc2dc3f8eb175d9f22fbd490fe2e8504f82fd2dca100e",
                "md5": "9033eb5c27430e9e641ab7e39a8abd39",
                "sha256": "de8cb0a6d66d9b29439f5310340756c42c01a8a987e1391e483b9d6353e06410"
            },
            "downloads": -1,
            "filename": "truelink-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9033eb5c27430e9e641ab7e39a8abd39",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 45651,
            "upload_time": "2025-07-15T08:16:34",
            "upload_time_iso_8601": "2025-07-15T08:16:34.823769Z",
            "url": "https://files.pythonhosted.org/packages/86/65/c02e9684d495448dc2dc3f8eb175d9f22fbd490fe2e8504f82fd2dca100e/truelink-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c93346fe6532d7b0a5079bc297d5bca65d970a175e9fd6d851a973d010d84ba3",
                "md5": "0b804c08d46f97fbcc0cc8dfdf0d1eb7",
                "sha256": "fd00560a45e24c5d5fc85ff422cd671cccfed44daa4b95f10fc300dc6bafe531"
            },
            "downloads": -1,
            "filename": "truelink-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "0b804c08d46f97fbcc0cc8dfdf0d1eb7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 29677,
            "upload_time": "2025-07-15T08:16:35",
            "upload_time_iso_8601": "2025-07-15T08:16:35.835733Z",
            "url": "https://files.pythonhosted.org/packages/c9/33/46fe6532d7b0a5079bc297d5bca65d970a175e9fd6d851a973d010d84ba3/truelink-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-15 08:16:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "5hojib",
    "github_project": "truelink",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "truelink"
}
        
Elapsed time: 1.80697s