GithubHelp home page GithubHelp logo

lordforbes / thebatplayerserver Goto Github PK

View Code? Open in Web Editor NEW

This project forked from andrepadez/thebatplayerserver

0.0 0.0 0.0 10.75 MB

A NodeJS server-side application for providing metadata from a streaming internet radio source.

Home Page: http://thebatplayer.fm

Makefile 0.80% JavaScript 96.01% Shell 2.59% CSS 0.17% HTML 0.43%

thebatplayerserver's Introduction

The Bat Server

A NodeJS server-side application for providing metadata from a streaming internet radio source. Currently used for The Bat Player Roku internet radio client.

###Example Output

{
    "artist": "Phosgore",
    "song": "Club Domination (Stahlfrequenz Remix)",
    "album": {
        "name": "Domination",
        "image": "http://userserve-ak.last.fm/serve/300x300/35852607.jpg",
        "released": 2009,
    },
    "bio": {
        "text": "Founded in 2008, this one man project wants to bring electronic music where it belongs - to the dancefloor!   No romantic song texts, no multi - coloured - plastic - hair sporting singers, and no bats flying out of anyones ass... Just Industrial, Electro, and Hardstyle elements melted down into a substance which forces its consumers into a relentless dancing spree.        Read more about Phosgore on Last.fm.",
        "published": 2009
    },
    "image": {
        "url": "http://batserver.thebatplayer.fm/images/artist/http%3A%2F%2Fuserserve-ak.last.fm%2Fserve%2F500%2F29286573%2FPhosgore%2B2_1280.jpg/106/54/5",
        "color": {
            "rgb": {
                "red": 106,
                "green": 54,
                "blue": 5
            }
        },
        "backgroundurl": "http://batserver.thebatplayer.fm/images/background/http%3A%2F%2Fuserserve-ak.last.fm%2Fserve%2F500%2F29286573%2FPhosgore%2B2_1280.jpg/106/54/5"
    },
    "tags": [
        "powernoise",
        "industrial",
        "ebm",
        "hellectro",
        "tbm"
    ],
    "station": {
        "listeners": "71",
        "bitrate": "128",
    }
}

###Goals

  1. Centralize the logic required for taking an audio stream and determining the current song.
  • Shoutcast v1 csv metadata.
  • Shoutcast v2 xml metadata.
  • In-stream icy metadata.
  1. Taking a known artist name and track name and determine:
  • The most reasonable album that it came from by aggregating Discogs, Musicbrainz, and Last.FM results and making a logical guess.
  • An image representative of the artist.
  • An image representative of the album.
  • A bio for the artist.
  • Misc tags and/or genres that are useful.
  1. Create the dynamic images required for The Bat Player client:
  • A resized image for station selection.
  • An image for the artist during a song.
  • An image for the background during a song.
  • A header image with custom text.
  1. Pull color information from the artist image for the client to use in customizing each song.
  2. Caching this data centrally so multiple people listening to the same station won't create additional load and so it's quickly available later.

###Challanges

  1. There are many different internet radio streaming services out there. Usually the option of connecting to the actual stream and waiting for some metadata to arrive as a last ditch effort works, but for some services meatadata will just never be available.
  2. Finding the correct album for a artist/track combo is far more difficult than it sounds. The more popular a song, the more versions of the song is available under the same name. Live, remixes, karaoke, radio edit, extended version, compilations etc. The correct answer is usually "The oldest release that's not a Live, Single, EP or compilation release." But some albums don't have available release dates, either.
  3. Different metadata sources have different qualities and quantities of information. The current approach is to query them all and then try and make some sense out of the results.

###Running

  1. Copy Config-example.js to Config.js and add your respective keys.
  2. npm install
  3. make test to verify everything is working.
  4. Either install and run memcached or turn enableCache off in your Config.js.
  5. make dev to run.
  6. Make a request such as http://localhost:3000/metadata/http%3A%2F%2F205.164.41.34%3A6699

###Tests

  1. There are a handful of integration tests written.
  • Metadata fetching
  • Artist, background and header image generation.
  • Color detection
  • Current song fetching utilizing the different methods.

###Want to help?

  1. File a GitHub issue.
  2. Create a pull request for a feature or bug fix.
  3. Teach me something about Node development I don't know. This is my first Node app.
  4. Write a client on top of this service and let me know how it's working for you.
  5. Check out The Bat Player.

Video

thebatplayerserver's People

Contributors

gabek avatar

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.