Efabien / hack-a-song

cli tool for converting youtube video to mp3, save it locally and share it among devices

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hack-a-song

Description

This week-end project is a cli tool for converting YouTube video to MP3, downloading it and making it available for sharing to devices connected on the same network by generating a downloadable link. The generated link is shared via telegram by using a telegram bot

Telegram integration

First you need to create a telegram bot. Create a telegram account if you don't have on yet and dm @BotFather. Follow the instruction and at the end of the process he will provide you a secret token, used for interacting with the telegram APIs. To obtain your chat ID, dm your bot and check out your console.

Configuration

Edit the file config/index so as to provide the following configuration values :

  • outputPath // Output file location (default: the home directory)
  • ENCRYPTION_KEY //for encrypting the dowloadable link
  • PORT // port of the sharing server
  • TELEGRAM_TOKEN // token required for using telegram API
  • TELEGRAM_CHAT_ID // telegram chat id where to receive notifications

Go to the project folder and install it globally :

npm install -g

Make sure to run the server :

node server.js

A better approache is to run the server as a service

Usage

For converting and downloading a video from youtube :

yds -u <youtube-url>

For generating a downloadable link of an already stored mp3 file, so as to share it with a device on the same network :

yds -g <part-of-the-file-name>

For getting the list of available songs

yds -l

About

cli tool for converting youtube video to mp3, save it locally and share it among devices


Languages

Language:JavaScript 100.0%