<commit_before>playIT-python
=============
This is a playback queue system that lets users of chalmers.it vote on which media from Spotify, YouTube and SoundCloud to play on a running client. 

The system is built on three parts:

### Backend

Responsible for handling the contact between the different parts. Maintains integrity of the voting and queue system.

E.g. tells the playback client that a new item is to be played.

### Frontend

Responsible for showing the queue to the user as well as sending upvote and downvote information to the backend.

### Playback client

Retrieves information about the next item in the queue and plays the item.


This is a rewrite of the [old playIT implemented in grails](https://github.com/cthit/playIT-grails)<commit_msg>Update readme, howto setup playbackClient<commit_after>playIT-python
=============
This is a playback queue system that lets users of chalmers.it vote on which media from Spotify, YouTube and SoundCloud to play on a running client. 

The system is built on three parts:

### Backend

Responsible for handling the contact between the different parts. Maintains integrity of the voting and queue system.

E.g. tells the playback client that a new item is to be played.

### Frontend

Responsible for showing the queue to the user as well as sending upvote and downvote information to the backend.

### Playback client

Retrieves information about the next item in the queue and plays the item.

####Install python requirements by running:
```bash
pip3 install -r playbackClient/requirements.txt
```

####Install mopidy, mpv and youtube-dl'
#####Archlinux
```
pacman -S mopidy mpv youtubedl
```
#####Debian, ubuntu / mint
```
sudo apt-get install mopidy mpv youtube-dl
```

####Configure mopidy for spotify and soundcloud:
Add this to your ~/.config/mopidy/mopidy.conf file. (create it if it doesn't exist)

```
[spotify]
username = *username*
password = *password*

[soundcloud]
auth_token = *token*
explore_songs = 25
```


####Start mopidy service:
#####Archlinux:
```
sudo systemctl start mopidy
```
#####Debian: Ubuntu / mint
```
sudo service start mopidy
```

####Example usage
```
playbackClient/playbackClient.py -s hostname:8888
```
{'fraction_non_alphanumeric': 0.09668633681343622, 'fraction_numerical': 0.0031774852473899226, 'mean_word_length': 4.6368286445012785, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1931238', 'n_tokens_mistral': 670, 'n_tokens_neox': 614, 'n_words': 292}