schmidsven / TrackSearch

Library to search for tracks an get stream for YouTube, SoundCloud, ...

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TrackSearch


Contributions welcome GitHub release (latest by date)

What is it ?

TrackSearch is to search for track metadata on different sources, like Youtube and SoundCloud for now and to expose the URL of the underlying audio stream in the highest resolution. That offers the possibility to hand them over to other programs which are able to process them, like VLC, or Firefox which can display the audio directly for example.

Note: TrackSearch isn't using any API-Key, it uses the public Rest-API.

Supported sources

Since TrackSearch focuses on just exposing the audio streams and to search for music (I know YouTube offers more than music) I decided to add following providers first for now:

  • YouTube
  • SoundCloud

There could be more added if there is interesting content offered to go for.

Current features:

  • Search for keywords
  • Paging of results
  • Expose audio stream url
  • Interact with multiple clients asynchronous

How to use it ?

Dependency

For now using jitpack. GitHub packages does not allow to download without authentication through token.

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependency>
    <groupId>com.github.s-frei.TrackSearch</groupId>
    <artifactId>tracksearch</artifactId>
    <version>0.5.3</version>
</dependency>

Example usage

//Client to search on all available sources asynchronous
MultiTrackSearchClient searchClient = new MultiSearchClient();

//Client for explicit source
TrackSearchClient<SoundCloudTrack> explicitClient = new SoundCloudClient();

//Do the searching
TrackList<Track> tracksForSearch = searchClient.getTracksForSearch("your keywords")

//Get the audio stream
List<Track> tracks = tracksForSearch.getTracks();
String streamUrl = searchClient.getStreamUrl(tracks.get(any))

//Get next tracks
TrackList<Track> nextTracks = searchClient.getNext(tracksForSearch);

Why is this done ?

I haven't found anything which is capable of doing this kind of stuff, except it offered something similar and could be abused for this, or it wasn't written in Java.

Develop

Run following command in the root directory.

Build

mvnw clean install

Stuff to be added

  • Standalone web module offering a RESTful API and Frontend
  • Tests
  • More documentation
  • Playlist URL search
  • Direct audio stream URL resolving

About

Library to search for tracks an get stream for YouTube, SoundCloud, ...

License:Apache License 2.0


Languages

Language:Java 100.0%