Metadata-Version: 2.1
Name: PirateBayAPI
Version: 1.0.1
Summary: A PirateBay API wrapper
Author-email: x93bd0 <x93bd0@gmail.com>
License: MIT License
        
        Copyright (c) 2022 Boris (x93)
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/x93bd0/PirateBay.py
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests

# PirateBay.py
This project is intended to be an API wrapper for [apibay](https://apibay.org/q.php?q=Example) & [ThePirateBay (only the 'main.js' file for the trackers)](https://thepiratebay.org/static/main.js)

# How does it works?
The functionality of this project is very easy to understand, as it's composed by a set of methods that point directly to the PirateBay API ([apibay](https://apibay.org/q.php?q=Example)) with the sole purpose of parsing the response for the coder to then use it.

# Installation
You can install this project by running the following commands:
```bash
pip install PirateBayAPI
# OR
pip install .
```

## A very simple example that searchs "The Tomorrow War" in the Video.Movies category and prints results
```python
import PirateBayAPI
import typing

# Static Typing isn't required (but recomended)
results: typing.List[PirateBayAPI.SearchElement] = PirateBayAPI.Search(
    "The Tomorrow War", PirateBayAPI.VideoType.Movies)

for result in results:
    print("File: {} {}.Mb (id:{})".format(
        result.name, round(result.size/1024/1024, 2), result.id))
```

## Another example, in this case, we get the magnet link (necessary to download) of the first result of the search
```python
import PirateBayAPI
import typing

# Static Typing isn't required (but recomended)
results: typing.List[PirateBayAPI.SearchElement] = PirateBayAPI.Search(
    "The Tomorrow War", PirateBayAPI.VideoType.Movies)

print("Download Link: {} (size:{}.Mb)".format(
    PirateBayAPI.Download(results[0].id), round(results[0].size/1024/1024, 2)))
```
