https://github.com/raisess/torrent-sniff
Magnet link scraper
https://github.com/raisess/torrent-sniff
magnet-link scraper torrent torrent-scraper torrent-search
Last synced: 15 days ago
JSON representation
Magnet link scraper
- Host: GitHub
- URL: https://github.com/raisess/torrent-sniff
- Owner: Raisess
- Created: 2023-09-08T13:18:35.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-20T13:48:28.000Z (over 1 year ago)
- Last Synced: 2024-02-20T14:58:21.600Z (over 1 year ago)
- Topics: magnet-link, scraper, torrent, torrent-scraper, torrent-search
- Language: Python
- Homepage:
- Size: 42 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Torrent Sniff
A website to search for magnet links from a list of providers.
### Setup
Installing locally:
```shell
python3 -m pip install -r ./requirements.txt
python3 ./src/main.py
```
Using podman/docker:
```shell
./container.sh
```
### Creating a new provider
The providers are just web scrapping classes who uses [BeautifulSoup](https://beautiful-soup-4.readthedocs.io/en/latest/),
follow the base example:
```python
# src/app/kernel/providers/my_provider.py
from app.kernel.provider import Provider
from app.models import TitleModel
class MyProvider(Provider):
def __init__(self):
super().__init__("https://HOST")
def search(self, term: str) -> list[str]:
beautiful_soup_of_the_page = self._fetch(f"path/{term}")
# Return a list of ids for the get method
def get(self, id: str) -> list[TitleModel]:
beautiful_soup_of_the_page = self._fetch(f"path/sub/{id}")
# Return a list of titles with magnet links (TitleModel)
```
Now you just need to add the provider to the `__providers` list on the `SearchController` (src/app/controllers/search.py).