anniejw6 / textmsg_jukebox

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Virtual Environment - Python

Actually, this runs in 3.4. Annie just needs to update.

virtualenv -p python2.7 rpi
source rpi/bin/activate

pip install --upgrade pip
pip install --upgrade setuptools
pip install -r requirements.txt 

# pip freeze >> requirements.txt

Twilio Code

Follow these docs serve_twilio.py tries to listen for texts

What's Going On

  • Server listening in for texts (serve_twilio.py)
    • Write to list of incoming texts
    • If text is NEXT_CODE, gets written to playlist.txt directly (skips next part)
  • In a loop on a separate script (search_youtube_dl.py)
    • Read in texts
    • Search on youtube for URL
    • Download m4a
    • youtube-dl -f 140 https://www.youtube.com/watch?v=iRYvuS9OxdA
    • Add list to playlist.txt
  • Every two seconds, a python script (music_play.py) reads in playlist.txt and adds the next song to the queue
    • TODO: Every ten songs, delete the files of those songs

TODO

  • Figure out order in which scripts should be run and who erases what files.
  • Stop hard-coding file path
  • Celery async

About


Languages

Language:Python 97.4%Language:Shell 2.6%