tvdb

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tvdb implements metadata.Provider against TheTVDB's v4 REST API.

Index

Constants

View Source
const (
	// DefaultBaseURL is TheTVDB's v4 API root.
	DefaultBaseURL = "https://api4.thetvdb.com/v4"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a TheTVDB v4 API client. It logs in lazily on the first lookup and reuses the resulting bearer token for tokenTTL.

func New

func New(cfg Config) (*Client, error)

New creates a TheTVDB client. It performs no network call: the only way it fails is an empty API key.

func (*Client) LookupShow

func (c *Client) LookupShow(ctx context.Context, title string, year int) (*metadata.ShowMetadata, error)

LookupShow resolves a show against TheTVDB in two authenticated requests: GET /search to find it, then GET /series/{id}/extended, which is the only v4 route returning genres, certifications and cross-references together.

func (*Client) Name

func (c *Client) Name() string

Name returns "tvdb".

type Config

type Config struct {
	// APIKey is the TheTVDB v4 API key. The caller supplies it -- this
	// package never reads the environment.
	APIKey string

	// PIN is the subscriber PIN a user-supported key requires. Leave it
	// empty for a project API key.
	PIN string

	// BaseURL overrides DefaultBaseURL. Tests point it at an httptest
	// server.
	BaseURL string
}

Config configures a TheTVDB client.

Jump to

Keyboard shortcuts

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