• This repository has been archived on 07/Jul/2020
  • Stars
    star
    138
  • Rank 264,441 (Top 6 %)
  • Language
    TypeScript
  • Created almost 10 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A YouTube player for the desktop

Toby

NOTE: A rewrite of this project is underway using Blazor and can be found here

Toby is a simple YouTube player for the desktop.

Screenshots

Toby In Action:

Toby In Action

Toby Main UI:

Toby Main UI

Toby Video List:

Toby Video List

Toby Video List (Slim Grid)

Toby Video List (Slim Grid)

Toby Recently Played:

Toby Recently Played

Toby Manage Videos:

Toby Manage Videos

Toby Server Log:

Toby Server Log

Architecture

The old Toby architecture was geared towards an Electron deployment and I loaded all the code from the file system. The new architecture puts Toby behind an Express web application that is spawned from a regular Node process so that more deployment scenarios are possible.

Having Toby behind an Express app makes it fairly trivial to deploy to NW.js, Electron and support a regular web browser.

Toby is meant as a personal application running on a personal computer and it's web API is not password protected in any way and there has been no attempt to protect the data Toby collects. Toby only cares about a few things, namely YouTube video titles, YouTube video IDs and the groups you decide to store your favorite videos in.

Running The Latest Code

Clone the code using git and then add a folder named browsers with a copy of electron and/or nwjs. We'll use one of these to run Toby.

Dependencies

You Just Need One Of The Following:

Depending on what platform you want to run Toby in (Electron or NW.js) you'll need to make sure the main property in package.json is set accordingly:

NW.js
main: "./build/index.html"
Electron
main: "./build/electron.js"

In order to run Toby you'll need to download the dependencies and build the source code. Open a terminal to the source code repository and run the following commands.

Install Dependencies

npm install -g webpack webpack-cli typescript grunt bower
npm install
bower install

Building the Source Code

NOTE: You will need to supply your own YouTube API key. This needs to be placed in an environment variable called YOUTUBE_API_KEY. You will need a Google account to obtain one. Go [here (https://console.developers.google.com) to get an API key.

The server needs to be built using Grunt.

grunt

The front end needs to be build using Webpack.

webpack

Assuming all dependencies are downloaded and the source code has been compiled perform the following from a command line at the root of the Toby code repository:

NOTE: main will need to be updated in package.json to point to the correct starting point for your deployment scenario. If you are using Electron it will need to be set to build\electron.js or if you are using NW.js it'll need to be set to build\index.html. It should also be noted that the index.html contained in the root of the Toby repository will be copied to the build folder and used from there.

Running in NW.js

browsers\nwjs\nw.exe .

NOTE: You may want to replace the ffmpeg.dll that ships with NW.js with a more capable one from https://github.com/iteufel/nwjs-ffmpeg-prebuilt/releases. The ffmpeg.dll that ships with NW.js is crippled and won't play many of the YouTube videos you most likely will want to play.

Running in Electron

browsers\electron\electron .

Running in a Browser

Start the server up:

node.exe build\server.js

Then open a browser to http://127.0.0.1:62374

Running using the Toby Launcher

I've wrote a rudimentary launcher in C# .NET to assist with launching Toby easily. By default if you run the launcher without command line args it will run Toby using NW.js. There is only one command line option at this time.

After building the launcher copy the TobyLauncher.exe, NDesk.Options.dll and Newtonsoft.Json.dll files to the root of the Toby repository.

  • Command Line Options:
    • /p [nw, electron, web]

Examples:

Launching Toby in a web browser: TobyLauncher.exe /p web Launching Toby in Electron: TobyLauncher.exe /p electron

NOTE: The launcher is crude and there is not enough error checking yet. Things will likely go wrong if Toby is not set up correctly as stated above.

Usage

Important Key Combos:

F1 - Toggles server log F11 - Toggles fullscreen

In addition to keyboard shortcuts there are commands that can be typed into the search box that will perform various things.

Here is a list (there will be additional ones added soon):

  • [name hint] : Lists locally saved videos based on the [name hint]
  • [search term] : Searches YouTube for the [search term]
  • /local [search term] : Searches for locally saved videos
  • /g [group name] : Lists the videos for the [group name]
  • /list-all : List all videos contained in the database
  • /history : Lists the recently played videos
  • /rp or /recently-played : List last 30 recently played videos
  • /rps or /recently-played-search : Search recently played videos
  • /manage : Manage what groups videos are in and also provide ability to delete videos
  • /archive : Export the contents of the database to the data.txt file
  • /gv or /grid-view - Toggle slim grid view for search results
  • /dv or /default-view - Toggle default view for search results
  • /clear : Clears search results
  • /monochrome : (NW.js/Electron only) Short cut to set the monochrome video filter and thumbnails in search results
  • /saturate : (NW.js/Electron only) Short cut to set the saturated video filter and thumbnails in search results
  • /sepia : (NW.js/Electron only) Short cut to set the sepia video filter and thumbnails in search results
  • /normal : (NW.js/Electron only) Short cut to set the normal video filter and thumbnails in search results
  • /filter monochrome : (NW.js/Electron only) Short cut to set the monochrome video filter and thumbnails in search results
  • /filter saturate : (NW.js/Electron only) Short cut to set the saturated video filter and thumbnails in search results
  • /filter sepia : (NW.js/Electron only) Short cut to set the sepia video filter and thumbnails in search results

NOTE: You can refer to /src/toby-ui.tsx for the various short cuts available for these commands.

Wait, I used NW.js and some YouTube videos won't play

The FFMPEG library that ships with NW.js is less capable than the one that ships with Electron. The short answer is just copy the FFMPEG library from an Electron release replace the one that ships with NW.js. I've been doing this for a long time and it works well for me (on Windows).

The longer answer is you can compile your own FFMPEG library with the support you and there are a lot of resources already out there to handle this scenario.

NOTE: This technique does not work with NW.js 0.20.0-beta1 as the FFMPEG seems to be different than one that ships with Electron.

Looks like there are some alternate FFMPEG builds available which can take care of this: https://github.com/iteufel/nwjs-ffmpeg-prebuilt/releases

Features TODO

  • Usage info from within the app

Updating the data file

I've removed the ordinary data file as it was too cumbersome to get the parser correct. I've decided to just define some basic starting video data in the following code file /src/data.ts. If you are building from source feel free to edit this to your liking. If at anytime you edit this file and run Toby it will update your database importing any new videos you put there.

NOTE: Although it hasn't been done yet it'd be trivial to replace this with JSON data loaded from the filesystem.

Author(s)

Frank Hale <[email protected]> 24 November 2019

License

GNU GPL v3 - see LICENSE

More Repositories

1

electron-with-express

A simple app that demonstrates spawning an Express app from Electron
TypeScript
659
star
2

nwjs-edge-example1

An example using Edge in NW.js directly from the DOM
HTML
39
star
3

aewmpp

a small window manager for X11 based originally off aewm
C++
23
star
4

toby-blazor

A simple YouTube player written in C# / Blazor Server Side
C#
22
star
5

electron-inject-jquery-webview-example

Example of injecting jQuery into a webview via the preload script and then using it to manipulate the loaded page
JavaScript
18
star
6

Roguely

A simple Roguelike in SDL2/C++/Lua
C++
17
star
7

hello-atom-shell

A port of the atom-shell hello-app application to Clojurescript
JavaScript
12
star
8

xsharp

A wrapper around a subset of the Xlib C API for X11
C#
11
star
9

ruby-window-management

a small extension which allows you to write window managers for X11 in ruby
C
10
star
10

electron-with-nextjs

An Electron app that uses Next.js with a custom Express Server and a Material UI
JavaScript
9
star
11

godot-roguelike

Learning Godot by creating a Roguelike
GDScript
8
star
12

Aurora

An MVC web framework for .NET
C#
8
star
13

electron-webview-ipc-test

A test to demonstrate IPC in Electron with a webview
JavaScript
6
star
14

nwjs-edge-example2

An example using Edge in NW.js via a spawned regular Node process
JavaScript
5
star
15

electron-custom-titlebar-example

An example application for Electron that demonstrates a custom titlebar
TypeScript
5
star
16

mini

a stripped down leaner version of aewm++
C++
4
star
17

rwm

A window manager for X11 written in Ruby
Ruby
3
star
18

textworld

A text based role playing game engine
TypeScript
3
star
19

FSharpASPNETMVC

A port of the C# ASP.NET MVC 5 project template to F#
F#
3
star
20

Miranda

A tiny wiki built using Aurora
C#
2
star
21

simple-irc-client

A simple IRC client built on Electron
JavaScript
2
star
22

godot-websockets

A websocket example using Godot (client) and Deno (server)
TypeScript
2
star
23

docker-dotnet-angular

Dockerized .NET backend and Angular frontend
TypeScript
2
star
24

WikiAccessLayer

An F# based implementation of a data access layer for a rudimentary wiki using the SQL Type Provider
F#
2
star
25

BlazorRogueLike

An experiment in game making
HTML
2
star
26

fx

A port of Frehley to Atom-Shell
JavaScript
2
star
27

CouplesJournal

A simple journaling app for couples to share their messages of love. Meant to be deployed at home on Raspberry Pi.
C#
2
star
28

sapphirewm

yet another X11 window manager
C++
1
star
29

json-cpp-example

Playing around with json++
C++
1
star
30

frankhale

It's me!!!
1
star
31

ASPNETCoreAPIMassTransitTesting

Use WebApplicationFactory / Fake MassTransit Bus just enough to test simple message passing
C#
1
star
32

nwjs-react-devtools-webview-example

Demonstrate that React Devtools is working when React app is inside a Webview
HTML
1
star
33

deno-raspberrypi-build

Builds of Deno for Raspberry Pi 4
1
star
34

AStarPathFinder_CPP

A* path finding implementation in C++
C++
1
star
35

nyana

a small programmers text editor written in python
Python
1
star
36

WebApiHelloWorld

A little hello,world for learning ASP.NET Web API
F#
1
star
37

AspNetAdapter

An ASP.NET Adapter Library
C#
1
star
38

FSharpMVCLogonTest

A naive F# MVC example to demonstrate username / password logon
JavaScript
1
star
39

BlazorAuthWithUserService

Blazor Cookie Authentication with User Service
C#
1
star
40

cloak-of-darkness

A Cloak of Darkness implementation (a text adventure Hello, World)
JavaScript
1
star
41

xclock

A tiny clock for X11
C++
1
star
42

2048

A 2048 clone
JavaScript
1
star
43

AStarPathFinder

A* path finding implementation
C#
1
star
44

AuroraViewEngine

The view engine from the Aurora web framework
C#
1
star
45

ghosts-of-yarrow

An unfinished game idea
JavaScript
1
star
46

AspNetAdapterHelloWorld

A quick Hello,World demonstrating usage of AspNetAdapter
C#
1
star
47

FSharpHttpHandler

A basic F# IHttpHandler Hello, World
F#
1
star
48

express-hello-world-clojurescript

Express Hello, World written in Clojurescript
Clojure
1
star
49

ExamHelper

An test prep web application that helps you study multiple choice questions
C#
1
star
50

RabbitMQ_ASPNETCore

Using RabbitMQ to communicate between two ASPNET Core APIs
C#
1
star
51

AspNetAdapterMiddlewareSandbox

A sandbox for developing AspNetAdapter and Middleware ideas
C#
1
star
52

montauk

Montauk is a super tiny minimal web framework for .NET
C#
1
star
53

RoguelikeRoomGeneration

Working on algorithms to generate rooms for a roguelike game
C#
1
star
54

electron-with-blazor-server

A simple app that demonstrates spawning a Blazor Server app from Electron
C#
1
star
55

FSharpWebApi

A port of the C# Web API project to F#
F#
1
star
56

SandboxMQ

A sandbox which demonstrates a marriage between Aurora and ZeroMQ to bring the web framework totally off ASP.NET
1
star
57

Frehley

(Ace) Frehley is a toy text editor that uses NW.js and the Ace editor library
JavaScript
1
star