Skip to content

Go library for turning torrents into cached HTTP streams via debrid services like RealDebrid, AllDebrid and Premiumize

License

Notifications You must be signed in to change notification settings

Deflix-tv/go-debrid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-debrid

Go Reference

Go library for the public APIs of debrid services like RealDebrid, AllDebrid and Premiumize

Features

  • Get user account info
  • Get instant availability (cache) info for a link / torrent
  • Add a link / torrent to a debrid service's downloads
  • Get status info about a link / torrent that the debrid service is downloading / has downloaded
  • Get the direct download link for a link / torrent after the debrid service has downloaded it
  • Delete the torrent that the debrid service is downloading / has downloaded

Usage

The library consists of a root-level package which contains a cache interface and example cache implementation, as well as subpackages for the specific debrid services. Each service-specific subpackage contains both a legacy client (the client from v0.1.0), and a low level client whose methods match the public API endpoints. In the future a common client will be added that has a generic interface and is backed by service-specific clients.

Godoc:

Example

package main

import (
    "context"
    "fmt"

    "github.com/deflix-tv/go-debrid/realdebrid"
)

func main() {
    // Create new client
    auth := realdebrid.Auth{KeyOrToken: "123"}
    rd := realdebrid.NewClient(realdebrid.DefaultClientOpts, auth, nil)

    // We're using some info hashes of "Night of the Living Dead" from 1968, which is in the public domain
    infoHashes := []string{
        "50B7DAFB7137CBECF045F78E8EFBE4AC1A90D139",
        "11EA02584FA6351956F35671962AB46354D99060",
    }
    availabilities, _ := rd.GetInstantAvailability(context.Background(), infoHashes...)

    // Iterate through the available torrents and print their details
    for hash, availability := range availabilities {
        fmt.Printf("Hash: %v\nAvailability: %+v\n", hash, availability)
    }
}

For more detailed examples see examples.