searchtube

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

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

Go to latest
Published: May 21, 2022 License: MIT Imports: 8 Imported by: 1

README

SEARCHTUBE

Search youtube, but not using the API.

youtube's way smarter than me, so don't expect this to bypass it's rate limit

How to Use

Install it: go get -u github.com/Pauloo27/searchtube

package main

import (
  "github.com/Pauloo27/searchtube"
  "fmt"
)

func main() {
  searchTerm := "Tutorial limpar casa"
  maxResults := 5
  results, err := searchtube.Search(searchTerm, maxResults)

  if err != nil {
    panic(err)
  }

  for i, result := range results {
    rank := i+1
    fmt.Printf(" #%d - %s by %s\n", rank, result.Title, result.Uploader)
  }
}

License

This project is licensed under the MIT license.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SearchResult

type SearchResult struct {
	Title, Uploader, URL, RawDuration, ID, Thumbnail string
	Live                                             bool
	// contains filtered or unexported fields
}
func Search(searchTerm string, limit int) (results []*SearchResult, err error)

func (*SearchResult) GetDuration

func (s *SearchResult) GetDuration() (duration time.Duration, err error)

Jump to

Keyboard shortcuts

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