Skip to content
readme.md 5.15 KiB
Newer Older
Jonny Rimkus's avatar
Jonny Rimkus committed
Author | Jonny Rimkus <jonny@rimkus.it>
Jonny Rimkus's avatar
Jonny Rimkus committed
------ | ---------------------------
Jonny Rimkus's avatar
Jonny Rimkus committed
Website | https://www.rimkus.it
Jonny Rimkus's avatar
Jonny Rimkus committed
License | http://www.wtfpl.net/
Jonny Rimkus's avatar
Jonny Rimkus committed
Demo | https://lastfm.rimkus.it
Jonny Rimkus's avatar
Jonny Rimkus committed

Jonny Rimkus's avatar
Jonny Rimkus committed
# Requirements
Jonny Rimkus's avatar
Jonny Rimkus committed
* PHP >= 5.6 (last test with 7.3)
Jonny Rimkus's avatar
Jonny Rimkus committed
* PHP PDO SQLite tested (any PDO DB should work, but untested)
Jonny Rimkus's avatar
Jonny Rimkus committed
* Composer (See `composer.json`)
Jonny Rimkus's avatar
Jonny Rimkus committed
* [Lastf.fm](https://last.fm) Account with [API Support](https://www.last.fm/api/)
* [Youtube](https://youtube.com) Account with [API Supprt](https://developers.google.com/youtube/v3/)
Jonny Rimkus's avatar
Jonny Rimkus committed

# Installation
1. Place this folder somewhere under your document Root e.g.: http://example.com/lfmtube
Jonny Rimkus's avatar
Jonny Rimkus committed
2. run `composer install`
3. copy the file `conf/example.settings.json` to `conf/settings.json`
4. create a [Last.fm User](https://www.last.fm/user/ravermeister) with a [Developer API](https://www.last.fm/api/) key
5. create a [Youtube User](https://www.youtube.com) with a [Developer API](https://developers.google.com/youtube/v3) Key
Jonny Rimkus's avatar
Jonny Rimkus committed
6. enter the API keys in the `settings.json`
Jonny Rimkus's avatar
Jonny Rimkus committed
7. open http://example.com/lfmtube and enjoy

Jonny Rimkus's avatar
Jonny Rimkus committed
# About
Jonny Rimkus's avatar
Jonny Rimkus committed
The [Last.fm Youtube Radio](https://lastfm.rimkus.it) searches and plays the listened tracks of a given [Last.fm User](https://www.last.fm/user/ravermeister)  on [YouTube](https://youtube.com). It is possible to search for alternative Youtube Videos or enter a video url directly. The Tracks which have a fixed Video Id will have a **'*'** prefixed. You can create your own playlist via menu 'add to playlist'. Additionally there is a Chart list which will be updated each time a song is heared. The Chart Counter works as follows:
Jonny Rimkus's avatar
Jonny Rimkus committed

  * get the length of the Song divided by 2. 
  if it is greater than 2 minutes use 2 minutes as timeout, 
  otherwise use calculated length. 
Jonny Rimkus's avatar
Jonny Rimkus committed
  * when the Timeout is reached, increase playcount for Song.
Jonny Rimkus's avatar
Jonny Rimkus committed

Jonny Rimkus's avatar
Jonny Rimkus committed
The Timer is designed to stop when player is paused, and will continue when the player continues to play. 
Jonny Rimkus's avatar
Jonny Rimkus committed

Jonny Rimkus's avatar
Jonny Rimkus committed
## Hotkeys
Jonny Rimkus's avatar
Jonny Rimkus committed
The following global Shortcut keys are supported:

Jonny Rimkus's avatar
Jonny Rimkus committed
Key binding | Command | Control |   | Key binding | Command | Control  
Jonny Rimkus's avatar
.  
Jonny Rimkus committed
----------- | ------- | ------- | - | ----------- | ------- | -----   
ctrl+1 | Player Window | Page Navigation |        | enter | Play/Pause | Player
ctrl+2 | Last.fm Playlist | Page Navigation |     | space | Play/Pause | Player
ctrl+3 | Custom User Playlist | Page Navigation | | left | *Rewind Track | Player
ctrl+4 | Topsongs Playlist | Page Navigation |    | right | *Fast Forward Track | Player
Jonny Rimkus's avatar
Jonny Rimkus committed
ctrl+5 | Last.fm Users | Page Navigation |        | up | Volume Up | Player
 | |  |  |  | down | Volume Down | Player
 | |  |  |  | ctrl+right | Next Track | Player
Jonny Rimkus's avatar
.  
Jonny Rimkus committed
 | |  |  |  | ctrl+left | Previous Track | Player
Jonny Rimkus's avatar
 
Jonny Rimkus committed
 
Jonny Rimkus's avatar
Jonny Rimkus committed
*The forward/rewind amount of time is increased when the functions is called fast in a row, and resetted to default afterwards.
Jonny Rimkus's avatar
Jonny Rimkus committed

Jonny Rimkus's avatar
Jonny Rimkus committed
## Personal Songlist
Jonny Rimkus's avatar
Jonny Rimkus committed
You can send any Title to your personal song list (will be stored in browser cache), which is saved during a browser restart.
Jonny Rimkus's avatar
Jonny Rimkus committed

## Listen to other Last.fm User's Song Timeline
Jonny Rimkus's avatar
Jonny Rimkus committed
You can sarch any [Last.fm User](https://www.last.fm/user/ravermeister) and listen to the Song Timeline.
Jonny Rimkus's avatar
Jonny Rimkus committed

Jonny Rimkus's avatar
Jonny Rimkus committed
## Admin interface
There is an admin php cli Interface for Importing the replacement.csv Files and generating the sitemap.xml file.  
Call `php admin.php` inside the lastfmtube Folder for more info.

Jonny Rimkus's avatar
Jonny Rimkus committed
## replacements.csv
Jonny Rimkus's avatar
Jonny Rimkus committed
You can use [Regular Expressions](https://www.php.net/manual/de/function.preg-match.php) for Replacing Artist and Title information if the Song information is messy, sothat the search string that is send to youtube can be corrected in an efficient way. The csv is stored in the database after importing through the admin cli Interface. New- and Changed Files can be (re-)Imported with the admin interface at any time. See the `init.replacement.example.csv` for more details.
Jonny Rimkus's avatar
Jonny Rimkus committed

Jonny Rimkus's avatar
Jonny Rimkus committed
# Directory Structure:
Jonny Rimkus's avatar
Jonny Rimkus committed
  - __conf__ Configuration Files and [SQLite Database](https://sqlite.org)
  - __conf/settings.json__ copy from `settings.example.json`, here you have to adjust the Youtube/Last.fm settings for the player.
Jonny Rimkus's avatar
Jonny Rimkus committed
  - __conf/init.replacements_example.csv__ This is  an example file for the Track correction CSV files which you can import via the Admin-cli interface. Regular Expression Groups can be used to define replacements for a specific part of a track to e.g. remove *[unnknown]* from the Song Titles, extract the artist name from the title etc.
Jonny Rimkus's avatar
Jonny Rimkus committed
  - __conf/lasttube.db__ this is the sqlite Database (will be created automatically)
  - __themes__ place new themes into this directory. (theming is untested)
Jonny Rimkus's avatar
Jonny Rimkus committed
simply copy an existing theme directory and rename it to your new theme name (and adjust `settings.json` as needed)
Jonny Rimkus's avatar
Jonny Rimkus committed
  - __locale__ here you can localize the Strings. currently supported langs: english and german
Jonny Rimkus's avatar
Jonny Rimkus committed
to create a new language, copy an existing language file and rename it to the country specific code, e.g. `locale_nl.json` for netherland. 
Jonny Rimkus's avatar
Jonny Rimkus committed
  - __js__ all js Controller (player,page,playlist)  
Jonny Rimkus's avatar
Jonny Rimkus committed
  - __js/lib__ all required js dependecies e.g [JQuery](https://jquery.com/)/[Vuejs](https://vuejs.org/) files
  - __js/lib/libvue__ all [Vuejs](https://vuejs.org/) instances
  - __php/json__ all required php json handler
Jonny Rimkus's avatar
Jonny Rimkus committed
  - __php/api__ all API handlers (youtube/last.fm API)
Jonny Rimkus's avatar
Jonny Rimkus committed
  - __php/util__ all other php libs
Jonny Rimkus's avatar
Jonny Rimkus committed
  - __tmp__ temp folder for generated templates