Skip to content
This repository has been archived by the owner on Nov 21, 2022. It is now read-only.

Commit

Permalink
Preliminary compilation fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyah Check committed Aug 2, 2017
1 parent 4be596d commit c2ad922
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 6 deletions.
7 changes: 7 additions & 0 deletions api/apiconv.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Copyright 2017 YTD Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.

// apiconv: Converts downloaded flv file to mp3.

package api
7 changes: 7 additions & 0 deletions api/apiconv_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Copyright 2017 YTD Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.

// apiconv_test: Tests apiconv.go

package api
23 changes: 19 additions & 4 deletions api/apidata.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// Copyright 2017 YTD Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// Download Youtube video data as mp3

package ytdata
// apidata: Processes requests to Youtube API, downloads video streams

package api

import (
"flag"
Expand All @@ -12,11 +13,11 @@ import (
"os"
"strings"

"code.google.com/p/google-api-go-client/youtube/v3"
"google.golang.org/api/youtube/v3"
)

//Youtube Downloader Data file.
type Ytdd struct {
type ApiData struct {
FileName string
Title string
description string
Expand All @@ -35,6 +36,20 @@ var (
privacy = flag.String("privacy", "unlisted", "Video privacy status")
)


//Searches and returns channel lists by username.
func channelsListByUsername(service *youtube.Service, part string, forUsername string) {
call := service.Channels.List(part)
call = call.ForUsername(forUsername)
response, err := call.Do()
handleError(err, "")
fmt.Println(fmt.Sprintf("This channel's ID is %s. Its title is '%s', "+
"and it has %d views.",
response.Items[0].Id,
response.Items[0].Snippet.Title,
response.Items[0].Statistics.ViewCount))
}

func main() {
flag.Parse()

Expand Down
7 changes: 7 additions & 0 deletions api/apidata_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Copyright 2017 YTD Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.

// apidata_test: Tests apidata

package api
5 changes: 3 additions & 2 deletions api/apisearch.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// Copyright 2017 YTD Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// Search Youtube API for Video Data

package ytdata
// apisearch: Performs search queries on Youtube and returns results.

package api

import (
"flag"
Expand Down
8 changes: 8 additions & 0 deletions api/apisearch_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright 2017 YTD Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.

// apisearch_test: Tests api_search

package api

0 comments on commit c2ad922

Please sign in to comment.