functions

package
v0.0.0-...-a6843ac Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: GPL-3.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

View Source
const (
	YtVideoInfoURL = "https://www.youtube.com/get_video_info?video_id="
	YtFeedURL      = "https://www.youtube.com/feeds/videos.xml?channel_id="
	YtWatchPrefix  = "https://www.youtube.com/watch?v="
	YtChanPrefix   = "https://www.youtube.com/channel/"
	YtSearchPrefix = "https://www.youtube.com/results?search_query="
)

url constants

Variables

View Source
var Found = false
View Source
var S interface{} = ""

Functions

func CheckErr

func CheckErr(err error, msg string)

generic error notification instead of writing it 10000000 times

func Cleanfwatch

func Cleanfwatch(fwatch string) bool

func ConvertYMDtoUnix

func ConvertYMDtoUnix(ymd string) string

func DateConvert

func DateConvert(unixtime int) string

convert a unix date to a human readable date

func DateConvertToUnix

func DateConvertToUnix(d string) string

convert standard date to unix for database

func DateConvertTrim

func DateConvertTrim(unixtime int, limit int) string

convert a date and trim stuff we don't want to see

func Exists

func Exists(name string) bool

check if a file exists used for startup

func GetChanInfoFromYT

func GetChanInfoFromYT(chanid string) database.Channel

get channel information from youtube

func GetVideoInfo

func GetVideoInfo(videoid string) database.Video

get information about a specific video

func MkCrawljob

func MkCrawljob(dbname, fwatch, chanid, title, videoid, date string, updatedb int)

create a crawljob for jdownloader

func MysqlRealEscapeString

func MysqlRealEscapeString(value string) string

func Openbrowser

func Openbrowser(url, defbrowser string)

open your favorite web browser

func UpdateChan

func UpdateChan(dbname, fwatch, chanid string, dl bool, msg bool) int

update channel video counts and stuff

Types

type Entry

type Entry struct {
	XMLName   xml.Name   `xml:"entry"`
	ID        string     `xml:"id"`
	VideoId   string     `xml:"videoId"`
	Chanid    string     `xml:"channelId"`
	Title     string     `xml:"title"`
	Published string     `xml:"published"`
	MGroup    MediaGroup `xml:"group"`
}

youtube feed entry struct

type Feed

type Feed struct {
	XMLName xml.Name `xml:"feed"`
	Title   string   `xml:"title"`
	Entries []Entry  `xml:"entry"`
}

youtube feed struct

type MediaGroup

type MediaGroup struct {
	XMLName     xml.Name `xml:"group"`
	Description string   `xml:"description"`
}

youtube media group struct

Jump to

Keyboard shortcuts

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