10se1ucgo / pyjam

An open source, cross-platform audio player for Source and GoldSrc engine based games, written in Python
http://10se1ucgo.github.io/pyjam
GNU Lesser General Public License v3.0
31 stars 4 forks source link

Allow for searching of YouTube videos (+ in-game audio download) #6

Closed 10se1ucgo closed 8 years ago

10se1ucgo commented 8 years ago

Use the YouTube API to search and return a list of downloadable videos. This will likely come in handy when I attempt to implement in-game audio download and search.

https://developers.google.com/youtube/v3/docs/search/list#request

There may be a problem with API keys. Don't know if I should just put mine in or whatever

10se1ucgo commented 8 years ago

Problem solved. Created a small app engine server to handle API requests (caches results and enforces per-user quotas too).

https://pyjam-api.appspot.com/?app=pyjam&q=SEARCH+QUERY+HERE

Now to just implement this.

10se1ucgo commented 8 years ago

We now have audio search, now all I need to do is figure out how to make it work in game.

The best I can think of is to mimic how PikaDJ does it, dump the console to console.log (With the command con_log "console.log") and read it for input

An example of how the user could download a song:

  1. Open console
  2. Type echo "jam search: [SEARCH QUERY HERE]"
  3. pyjam reads console.log for that command
  4. pyjam searches for that song, and writes the results to a cfg called stdin.cfg
  5. User should then type exec stdin.cfg to get the results
  6. Then, user types: echo "jam download: [VIDEO ID/URL HERE]"
  7. pyjam begins to download and convert. Periodically, updates are sent to stdin.cfg, and the user can type exec stdin.cfg to get those updates if he wants.
  8. Once the conversion and download is complete, pyjam regenerates config files, and adds exec jam to the end of stdin.cfg so that pyjam is reloaded.
10se1ucgo commented 8 years ago

Nah, screw that

10se1ucgo commented 8 years ago

Implemented

10se1ucgo commented 8 years ago

Downloading implemented

All that's left is to now add conversion.

10se1ucgo commented 8 years ago

All done! GIFV Link