Giter Club home page Giter Club logo

annatar's Introduction

Annatar - Lord of Gifts

Annatar is free as in beer. If you are feeling generous I accept donations at Ko-fi.


The fastest just-in-time torrent/debrid search add-on for Stremio providing results in under 2-3s.

Annatar searches torrent and debrid sites for cached content to provide instantly available content for Stremio. Results from Annatar typically arrive in 3s or less. Annatar achieves its speed by using several fanout queries and map-reduce functions to gather the fastest and most accurate results using Jackett APIs.

I created this plugin because I wanted a self-hosted alternative to Torrentio.

The Fastest

There are other plugins that are similar to Annatar, but my experience with them has been not great. Results typically take over 10s which is far from ideal. Annatar is fast enough that the short delay does not bother me. Content is cached using redislite. This includes debrid links, Torrent metadata, and Jackett search results.

Cache is built based on user-requests. Each new imdb id will be cold requested from Jackett, Cinemeta, and Debrid. Subsequent requests will retrieve cache (given some TTLs depending on arbitrary logic).

FREE Community Edition

Although I wrote Annatar to be self-hosted it is also available as a Community Edition thanks to sponsorship from https://elfhosted.com. If you want to customize Annatar but you can't self-host you can easily get your own instance with just a few clicks.

Running Locally

⚠️ IMPORTANT NOTE ABOUT REAL DEBRID: If you are using RD you should be aware of their IP restrictions. If you stream from more than one IP at a time you will receive a warning and then a ban. The IP address tied to the stream depends on how you configure Annatar. By default Annatar will not forward the client IP address. This means that in your RD Downloads page you will see the public IP address of the Annatar server and not the client streaming the content. If you would like to forward the client IP (your phone or TV) then set the environment variable FORWARD_ORIGIN_IP: "true". If you are behind a reverse proxy make sure the proxy is setting x-real-ip or x-forwarded-for headers to the origin IP address. If you want to send a static IP address you can set OVERRIDE_ORIGIN_IP: "<some IP>" and that will take precedence.


Annatar must be accessible by Stremio via HTTPS. Run it on a desktop, VM, or server somewhere that your Stremio apps can reach it. You will need HTTPS otherwise Stremio will not install the plugin. See #1 for comments.

Annatar does not import certificates. You will likely need a reverse proxy such as nginx or Caddy. See #1 comments for an nginx example.

If You Already Have Jackett

docker run -d -p 8000:8000 -v ./annatar-data:/app/data --name annatar \
	-e JACKETT_URL=<your jackett URL> \
	-e JACKETT_API_KEY=<your jackett api key> \
	-e JACKETT_INDEXERS=eztv,kickasstorrents-ws,thepiratebay,therarbg,torrentgalaxy,yts,badasstorrents,limetorrents,bitsearch \
	registry.gitlab.com/stremio-add-ons/annatar:latest

If you don't already have Jackett

# create a working directory
mkdir -p annatar
cd annatar
# Download the docker-compose
curl -LJO https://gitlab.com/stremio-add-ons/annatar/-/raw/master/docker-compose.yaml
docker-compose up -d jackett

Open http://localhost:9117 and add some indexers.

Edit docker-compose.yaml and paste your API key under annatar -> env -> JACKETT_API_KEY

Run Annatar. docker-compose up -d

Install the add-on to Stremio:

  1. Open http://<host>:8000/configure on a machine that has Stremio installed

  2. Type in your details and click Install

  3. This will launch the plugin the Stremio app.

FAQ

  • Q: Annatar is slow
    • A: It's possible you are using slow indexers. Open Jackett directly and search individual indexers and see which one returns slowly. Disable that indexer if it is slow or be patient and wait for the cache to build
  • Q: Can you add support for <debrid provider>
    • A: Yes. Vote for an existing issue or create a new one to request it. I'll do what I can
  • Q: What is Annatar
    • A: Annatar - Lord of Gifts was the guise that Sauron assumed during the Second Age of Middle Earth.
  • Q: Can you add support for download-to-debrid links
    • A: No. Annatar is exclusively for instantly available content found on supported debrid services.
  • Q: Can you add support for torrent streaming?
    • A: No. Annatar is exclusively for instantly available content found on supported debrid services.

Contributing/Development

This plugin is implemented in python using the Stremio protocol definition.


DISCLAIMER: This software does not interact with torrent protocols, nor does it download or stream any content whatsoever. It is a Stremio plugin that provides only metadata and links by searching torrent indexers for content and searching Debrid services. Interacting with torrent indexers may be illegal in your country.

annatar's People

Contributors

g0ldyy avatar sphykik avatar davidemarcoli avatar

Stargazers

JL avatar  avatar  avatar Dani Walter avatar  avatar Goutham Krishna avatar Nirodha Suchinthana avatar Kasun Vithanage avatar Elijah Wright avatar  avatar  avatar  avatar  avatar Adam avatar  avatar Jake Alstad avatar  avatar Andres avatar  avatar  avatar Faheem Pervez avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

annatar's Issues

Spanish servers

How can I add spanish torrent servers? Would be nice to be able to do that. Because if I use the configuration from stremio addon website it only shows english torrents.

Dockerfile no longer builds

The Dockerfile no longer builds successfully, output below:

<snip>
 => [final 1/9] FROM docker.io/library/python:3.11-slim@sha256:80bcf8d243a0d763a7759d6b99e5bf89af1869135546698be4bf7ff6c3f98a59                                                       3.8s
 => => resolve docker.io/library/python:3.11-slim@sha256:80bcf8d243a0d763a7759d6b99e5bf89af1869135546698be4bf7ff6c3f98a59                                                             0.0s
 => => sha256:26f13e32d8cd0dd6045ae8e76baa59b01457fb37cef4627f2e033eba1d883a6f 3.33MB / 3.33MB                                                                                        0.4s
 => => sha256:e569c3fca5036d44efc4705a7872b1e2809842656dd5fc500a76fcb111793164 12.84MB / 12.84MB                                                                                      0.9s
 => => sha256:80bcf8d243a0d763a7759d6b99e5bf89af1869135546698be4bf7ff6c3f98a59 9.12kB / 9.12kB                                                                                        0.0s
 => => sha256:db15753186463f41baadcc8778f82a2a8cdbab9bfff3f47865f3ffbcf3ac834f 1.95kB / 1.95kB                                                                                        0.0s
 => => sha256:f453e5d6725fa2d638c1403ec08e15ef08ce4f13e4a62272fa41a9f200e77662 6.92kB / 6.92kB                                                                                        0.0s
 => => sha256:ea235d1ccf77ca07a545b448996766dc3eca4b971b04ba39d50af69660b25751 29.16MB / 29.16MB                                                                                      1.5s
 => => sha256:8cae6dc67aef5a47b5b325c7833ee6d5b033f9e00a71fe24898b94af44755600 232B / 232B                                                                                            0.7s
 => => sha256:153915d34d13d5974f6a37491429961ddf70d6dd0fc6bf3eed9142745394d4f7 3.21MB / 3.21MB                                                                                        1.1s
 => => extracting sha256:ea235d1ccf77ca07a545b448996766dc3eca4b971b04ba39d50af69660b25751                                                                                             1.3s
 => => extracting sha256:26f13e32d8cd0dd6045ae8e76baa59b01457fb37cef4627f2e033eba1d883a6f                                                                                             0.1s
 => => extracting sha256:e569c3fca5036d44efc4705a7872b1e2809842656dd5fc500a76fcb111793164                                                                                             0.4s
 => => extracting sha256:8cae6dc67aef5a47b5b325c7833ee6d5b033f9e00a71fe24898b94af44755600                                                                                             0.0s
 => => extracting sha256:153915d34d13d5974f6a37491429961ddf70d6dd0fc6bf3eed9142745394d4f7                                                                                             0.2s
 => [builder 2/7] RUN pip install "poetry==1.7.1"                                                                                                                                    14.2s
 => [final 2/9] WORKDIR /app                                                                                                                                                          0.3s
 => [builder 3/7] WORKDIR /app                                                                                                                                                        0.0s
 => [builder 4/7] COPY pyproject.toml poetry.lock* /app/                                                                                                                              0.0s
 => ERROR [builder 5/7] RUN poetry config virtualenvs.create false     && poetry install --no-dev --no-root --no-interaction --no-ansi     && poetry export -f requirements.txt --ou  1.4s
------
 > [builder 5/7] RUN poetry config virtualenvs.create false     && poetry install --no-dev --no-root --no-interaction --no-ansi     && poetry export -f requirements.txt --output requirements.txt --without-hashes     && pip wheel --no-cache-dir --no-deps --wheel-dir /tmp/wheels -r requirements.txt:
1.170 Skipping virtualenv creation, as specified in config file.
1.255 The `--no-dev` option is deprecated, use the `--only main` notation instead.
1.255 Installing dependencies from lock file
1.312 Warning: poetry.lock is not consistent with pyproject.toml. You may be getting improper dependencies. Run `poetry lock [--no-update]` to fix it.
1.320
1.320 Because annatar depends on bencodepy (^0.9.5) which doesn't match any versions, version solving failed.
------
Dockerfile:19
--------------------
  18 |     # Install runtime dependencies using Poetry and create wheels for them
  19 | >>> RUN poetry config virtualenvs.create false \
  20 | >>>     && poetry install --no-dev --no-root --no-interaction --no-ansi \
  21 | >>>     && poetry export -f requirements.txt --output requirements.txt --without-hashes \
  22 | >>>     && pip wheel --no-cache-dir --no-deps --wheel-dir /tmp/wheels -r requirements.txt
  23 |
--------------------
ERROR: failed to solve: process "/bin/sh -c poetry config virtualenvs.create false     && poetry install --no-dev --no-root --no-interaction --no-ansi     && poetry export -f requirements.txt --output requirements.txt --without-hashes     && pip wheel --no-cache-dir --no-deps --wheel-dir /tmp/wheels -r requirements.txt" did not complete successfully: exit code: 1
~/tmp/annatar master ❯

FORWARD_ORIGIN_IP when running Annatar via elfhosted

There is a warning on the site when running Annatar locally, that you need to use FORWARD_ORIGIN_IP: true so you don't use 2 ips (which is against RD policies). But what happens if you run Annatar via elfhosted?

Can I somehow give it my ip address so that I can use Stremio+torrentio by default in my household, then stremio+annatar when I need to find a movie that I don't find on torrentio and to keep myself from being banned?

Annatar broken since RD API changes

I think Annatar is currently broken due to the RD API changes. The public instance is logging lots of this:

AttributeError: 'list' object has no attribute 'items'
Task exception was never retrieved
future: <Task finished name='Task-4814485' coro=<get_stream_link() done, defined at /usr/local/lib/python3.11/site-packages/annatar/debrid/rd.py:216> exception=AttributeError("'list' object has no attribute 'items'")>
AttributeError: 'list' object has no attribute 'items'
Task exception was never retrieved
future: <Task finished name='Task-6368402' coro=<get_stream_link() done, defined at /usr/local/lib/python3.11/site-packages/annatar/debrid/rd.py:216> exception=AttributeError("'list' object has no attribute 'items'")>
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/annatar/debrid/rd.py", line 223, in get_stream_link
    async for cached_files in api.get_instant_availability(
  File "/usr/local/lib/python3.11/site-packages/annatar/debrid/real_debrid_api.py", line 99, in get_instant_availability
    for hash, obj in res.items():

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.