Git Product home page Git Product logo

youtubeengine's Introduction

Build Status

YoutubeEngine

Library with ReactiveCocoa api for Youtube. Allows easy access required parts of videos and channels in one call.

Screenshots

YoutubeEngine

Example

To run the example project, clone the repo, and run carthage checkout.

let engine = Engine(authorization: .key(YOUR_API_KEY))
let request: SearchRequest = .search(withTerm: "VEVO",
                                     requiredVideoParts: [.statistics, .contentDetails],
                                     requiredChannelParts: [.statistics],
                                     requiredPlaylistParts: [.snippet],
                                     limit: 20)

engine.search(request)
    .startWithResult { result in
        guard case .success(let page) = result else {
            return
        }
        let formattedItems = page.items.enumerated().map { "[\($0)] = \($1)" }
        print("VEVO:\n\(formattedItems.joined(separator: "\n"))")
    }

Requirements

Supports Swift 5

Installation

Cocoapods

pod "YoutubeEngine", :git => 'https://github.com/Igor-Palaguta/YoutubeEngine', :tag => '0.7.0'

Carthage

github "Igor-Palaguta/YoutubeEngine" ~> 0.7.0

SPM

.package(url: "https://github.com/Igor-Palaguta/YoutubeEngine", .upToNextMinor(from: "0.7.0"))

Implemented API

  1. search list by keyword, videos from channel, related videos

  2. channels list by identifiers or my

  3. videos list by identifiers or popular

  4. playlistItems list by identifiers or from playlist

Author

Igor Palaguta, [email protected]

License

YoutubeEngine is available under the MIT license. See the LICENSE file for more info.

youtubeengine's People

Contributors

igor-palaguta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

youtubeengine's Issues

Swift 3.0 unavailable

Hey, thank for your library.
I have a problem with installation pod on swift 3

Terminal shows

Pre-downloading: `YoutubeEngine` from `https://github.com/Igor-Palaguta/YoutubeEngine.git`, branch `swift-3`
[!] Unable to find a specification for `ReactiveSwift` depended upon by `YoutubeEngine`

What I should do?

Channels snippets are nil

let engine = โ€ฆ
let channelIds = ...
engine.channels(Channels.init(Channels.Filter.byIds(channelIds), parts: [.snippet]))

Channel's snippet is nil.

Playlist support

You should add playlist support. ๐Ÿ‘ I would appreciate it too much!

Results not available even though video Id exists

When the youtube ID contains dashes "-", the search results return nothing even though the youtube video id exists.

Works correctly for youtubeIds without dashes

Example id: gL-WVjvzu34

If you go to youtube: https://www.youtube.com/watch?v=gL-WVjvzu34, the video exists

But when I search using:

    let engine = Engine(.key(YOUTUBE_API_KEY))
    let youtubeId: String = "gL-WVjvzu34"
    let limit = 5
 
    engine.logEnabled = false
    let request: Search = Search(.term(youtubeId, [.video: [.snippet, .contentDetails]]),
                                 limit: limit)
    engine.search(request).startWithResult {
        result in
    
        if let page = result.value {
            //page here has no results 
        }
    }

I get no results

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.