Skip to content

An open source nodeJS backend that retrieves and parses Youtube data via the Google Youtube APIs

License

Notifications You must be signed in to change notification settings

nxbyte/Players-Cloud

Repository files navigation

image

GitHub license

Players-Cloud is a nodeJS backend to access and parse youtube video metadata. This works in conjunction with the iOS front-end called Players-iOS (specifically 2.x).

Purpose

Introduction

I love watching videos in my spare time. Whether its watching TV shows on my TiVo or online via Youtube/Twitch. When I got my iPod Touch in 2009, I religiously used the built in Youtube app to watch Gaming Let's Plays and other content. When Apple removed the Youtube app in iOS 6, I tried to find alternatives, however, as time went on these Youtube-app-alternatives got bloated and I eventually got frustrated. I spent more time closing the built in popup ads and "Rate me!" dialogues than actually enjoying the purpose of the app; watching my favorite youtube channels.

I was just so fed up with other apps that I took it upon myself to make something to satisfy my hunger of watching great content on Youtube.

Development Requirements

I made a list of things I wanted in this REST API:

  • nodeJS 10+: A simple lightweight server environment to quickly get up and running

  • express: To build some webpages and the REST API part of the service

  • async: Performance win for .each(...) & .parallel(...)

  • timsort: Performance win using a battle-tested fast sorting algorithm

  • node-ytdl-core: An abstraction over Youtube to access metadata for YouTube information

Roadmap

I started working on this in 2014 and I've been slowly working on it to improve its performance and reliability on both the front/back-end. With the front-end, I had to update the source to conform to the changes to the Swift language. With the back-end, I had to try different packages and Javascript techniques to shave milliseconds off the processing/response time.

In 2017, the cloud service was updated with a REST API that conforms to REST API conventions and supports JSON responses.

Setup

Option 1: Local Server
  1. Download the source: git clone https://github.com/nextseto/Players-Cloud

  2. Get the packages needed to run the app: npm install

  3. Go into the folder: cd Players-Cloud

  4. Run the app: YOUTUBE_API_KEY=<Insert Youtube API Key Here> node CORE.js

Option 2: Heroku

Deploy

REST API

All APIs return JSON Strings with specific objects per API

/channel/:ID - Get the most recent videos for a given array of channel IDs (separated by commas)

/video/detail/:ID/:format - Get some details for a given youtube video ID

/video/:ID/:format - Get all the details for a given youtube video ID

/search/:query/:nextToken/:options - Get a list of videos for a given query, page token, and filter option

/channel/detail/:ID - Get channel metadata for a given channel ID

Everything else - Redirects to this GitHub page

To learn more about the API...

  • Look into the playgrounds file in the repository to have a more interactive way of experimenting with the REST APIs.

  • Look at the examples folder for sample json responses.

  • Alternately, CORE.js contains JSDoc documentation for the response and return requests payloads for each endpoint.

License

All source code in Players-Cloud is released under the MIT license. See LICENSE for details.

About

An open source nodeJS backend that retrieves and parses Youtube data via the Google Youtube APIs

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published