alldebrid

package module
v0.0.0-...-5afe2f8 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2019 License: MIT Imports: 3 Imported by: 0

README

alldebrid

Simple AllDebrid API client

Example of use

package main

import (
    "log"

    "github.com/chneau/alldebrid"
)

func main() {
    client := alldebrid.New()
    _ = client
    logs, err := client.Connect("username", "password")
    if err != nil {
        panic(err)
    }
    log.Println(logs)
    link, err := client.GetDownloadLink("https://mega-downloader.example/superweirdlink.mp4")
    if err != nil {
        panic(err)
    }
    log.Println(link)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Base       string
	Agent      string
	HTTPClient *http.Client
	Token      string
}

Client ...

func New

func New() *Client

New returns an instance of the client.

func (*Client) CheckPin

func (c *Client) CheckPin(pin *Pin) error

CheckPin ...

func (c *Client) GetDownloadLink(link string) (*LinkUnlock, error)

GetDownloadLink ...

func (*Client) GetPin

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

GetPin ...

type LinkUnlock

type LinkUnlock struct {
	Success bool `json:"success,omitempty"`
	Infos   struct {
		Link      string      `json:"link,omitempty"`
		Host      string      `json:"host,omitempty"`
		Filename  string      `json:"filename,omitempty"`
		Streaming interface{} `json:"streaming,omitempty"`
		Paws      bool        `json:"paws,omitempty"`
	} `json:"infos,omitempty"`
	Error *string `json:"error,omitempty"`
}

LinkUnlock ...

type Pin

type Pin struct {
	Success   bool    `json:"success,omitempty"`
	Pin       string  `json:"pin,omitempty"`
	ExpiredIn int64   `json:"expired_in,omitempty"`
	UserURL   string  `json:"user_url,omitempty"`
	BaseURL   string  `json:"base_url,omitempty"`
	CheckURL  string  `json:"check_url,omitempty"`
	Error     *string `json:"error,omitempty"`
}

Pin ...

Jump to

Keyboard shortcuts

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