alldebrid

package module
v0.0.0-...-f46f01a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2020 License: MIT Imports: 5 Imported by: 0

README

Go DeepSource Go Report Card

Alldebrid Go Library

This is a Go wrapper for Alldebrid v4 APIs

Installation

go get -u github.com/shitpostingio/alldebrid

Usage

To get started import the library in your program and initialize a client

import	"github.com/shitpostingio/alldebrid"

func main() {
	client, _ := alldebrid.New("friji3r124rnwer", "MyAppName")

	m := []string{"magnet:?xt=urn:btih:f95c371d5609d15f6615139be84edbb5b94a79bc"}

	resp, err := client.UploadMagnet(m)
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(resp)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckPinResponse

type CheckPinResponse struct {
	Status string               `json:"status"`
	Data   checkPinResponseData `json:"data,omitempty"`
	Error  alldebridError       `json:"error,omitempty"`
}

CheckPinResponse contains data about the check pin request

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is the base AllDebrid client

func New

func New(key, appname string) (Client, error)

New returns a new alldebrid client and error if one ore more vars are missing

func (*Client) CheckPin

func (c *Client) CheckPin(check, authpin string) (CheckPinResponse, error)

CheckPin gives you an apikey after pin validating

func (c *Client) DelayedLink(delayedID string) (DelayedResponse, error)

DelayedLink returns a downloadable link for the given delayed id

func (*Client) DeleteMagnet

func (c *Client) DeleteMagnet(id string) (DeleteMagnetResponse, error)

DeleteMagnet removes a download from alldebrid

func (*Client) GetDomainsOnly

func (c *Client) GetDomainsOnly() (Domains, error)

GetDomainsOnly returns list of supported hosts domains and redirectors

func (*Client) GetPin

func (c *Client) GetPin() (GetPinResponse, error)

GetPin asks Alldebrid for a new pin

func (*Client) GetUserInfo

func (c *Client) GetUserInfo() (User, error)

GetUserInfo retrieves user infos from alldebrid

func (*Client) InstantAvailability

func (c *Client) InstantAvailability(magnets []string) (InstantAvailabilityResponse, error)

InstantAvailability sends magnet(s) to AllDebrid to know if thery are already available

func (*Client) RestartMagnet

func (c *Client) RestartMagnet(id string) (RestartMagnetResponse, error)

RestartMagnet will restart a failed torrent

func (*Client) SetAPIKey

func (c *Client) SetAPIKey(apikey string) error

SetAPIKey sets the client apikey (in case you obtained it via pin request)

func (*Client) StatusMagnet

func (c *Client) StatusMagnet(id string) (StatusMagnetResponse, error)

StatusMagnet returns the status of an Alldebrid download

func (c *Client) StreamingLink(stream, id string) (StreamingResponse, error)

StreamingLink returns a delayed id or the direct link

func (c *Client) UnlockLink(link string) (UnlockLinkResponse, error)

UnlockLink returns a downloadable link

func (*Client) UploadMagnet

func (c *Client) UploadMagnet(magnets []string) (MagnetsUploadResponse, error)

UploadMagnet sends magnet(s) to AllDebrid

type DelayedResponse

type DelayedResponse struct {
	Status string              `json:"status"`
	Data   delayedResponseData `json:"data,omitempty"`
	Error  alldebridError      `json:"error,omitempty"`
}

DelayedResponse is the response of the delayed call

type DeleteMagnetResponse

type DeleteMagnetResponse struct {
	Status string             `json:"status"`
	Data   magnetResponseData `json:"data,omitempty"`
	Error  alldebridError     `json:"error,omitempty"`
}

DeleteMagnetResponse is the response of the delete call

type Domains

type Domains struct {
	Status string         `json:"status"`
	Data   domainsData    `json:"data,omitempty"`
	Error  alldebridError `json:"error,omitempty"`
}

Domains is the domains response struct

type GetPinResponse

type GetPinResponse struct {
	Status string         `json:"status"`
	Data   getPinData     `json:"data,omitempty"`
	Error  alldebridError `json:"error,omitempty"`
}

GetPinResponse contains data about the get pin request

type InstantAvailabilityResponse

type InstantAvailabilityResponse struct {
	Status string                          `json:"status"`
	Data   instantAvailabilityResponseData `json:"data,omitempty"`
	Error  alldebridError                  `json:"error,omitempty"`
}

InstantAvailabilityResponse is the response of the instant availability call

type MagnetsUploadResponse

type MagnetsUploadResponse struct {
	Status string                    `json:"status"`
	Data   magnetsUploadResponseData `json:"data,omitempty"`
	Error  alldebridError            `json:"error,omitempty"`
}

MagnetsUploadResponse is the response of the upload call

type RestartMagnetResponse

type RestartMagnetResponse struct {
	Status string             `json:"status"`
	Data   magnetResponseData `json:"data,omitempty"`
	Error  alldebridError     `json:"error,omitempty"`
}

RestartMagnetResponse is the response of the restart call

type StatusMagnetResponse

type StatusMagnetResponse struct {
	Status string                   `json:"status"`
	Data   statusMagnetResponseData `json:"data,omitempty"`
	Error  alldebridError           `json:"error,omitempty"`
}

StatusMagnetResponse is the response of the status call

type StreamingResponse

type StreamingResponse struct {
	Status string                `json:"status"`
	Data   streamingResponseData `json:"data,omitempty"`
	Error  alldebridError        `json:"error,omitempty"`
}

StreamingResponse is the response of the streaming call

type UnlockLinkResponse

type UnlockLinkResponse struct {
	Status string                 `json:"status"`
	Data   unlockLinkResponseData `json:"data,omitempty"`
	Error  alldebridError         `json:"error,omitempty"`
}

UnlockLinkResponse is the response of the unlock link call

type User

type User struct {
	Status string         `json:"status"`
	Data   userData       `json:"data,omitempty"`
	Error  alldebridError `json:"error,omitempty"`
}

User is the user info struct

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL