reddit

package
v1.39.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2021 License: OSL-3.0 Imports: 7 Imported by: 0

README

Reddit

v.redd.it/16cqbkev2ci51/HLSPlaylist.m3u8
v.redd.it/16cqbkev2ci51/HLS_540.m3u8
v.redd.it/16cqbkev2ci51/HLS_540.ts

https://www.reddit.com/dev/api

Documentation

Index

Constants

View Source
const Origin = "https://api.reddit.com"

Variables

This section is empty.

Functions

func Valid added in v1.33.2

func Valid(id string) bool

redd.it/ppbsh redd.it/pql06n

Types

type DASH added in v1.39.1

type DASH struct {
	Period struct {
		AdaptationSet []struct {
			// sometimes MimeType is here, for example `pqoz44`
			MimeType       string `xml:"mimeType,attr"`
			Representation []struct {
				BaseURL string
				Height  int `xml:"height,attr"`
				// sometimes MimeType is here, for example `fffrnw`
				MimeType string `xml:"mimeType,attr"`
			}
		}
	}
}
type Link struct {
	Media struct {
		Reddit_Video struct {
			DASH_URL string // v.redd.it/16cqbkev2ci51/DASHPlaylist.mpd
			HLS_URL  string // v.redd.it/16cqbkev2ci51/HLSPlaylist.m3u8
		}
	}
	Subreddit string
	Title     string
	URL       string // https://v.redd.it/pjn0j2z4v6o71
}

func (Link) DASH added in v1.39.1

func (l Link) DASH() (*DASH, error)

func (Link) HLS added in v1.39.1

func (l Link) HLS() (m3u.Playlist, error)

type Post

type Post struct {
	Data struct {
		Children []struct {
			Kind string
			Data json.RawMessage
		}
	}
}

func NewPost

func NewPost(id string) (*Post, error)
func (p Post) Link() (*Link, error)

Jump to

Keyboard shortcuts

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