Closed 10se1ucgo closed 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.
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:
echo "jam search: [SEARCH QUERY HERE]"
console.log
for that commandstdin.cfg
exec stdin.cfg
to get the resultsecho "jam download: [VIDEO ID/URL HERE]"
stdin.cfg
, and the user can type exec stdin.cfg
to get those updates if he wants.exec jam
to the end of stdin.cfg
so that pyjam is reloaded.Nah, screw that
bind = "search: SEARCH QUERY HERE"
jam_cmd
jam_stdin
or stdin
, which echos the search outputbind = "download: VIDEO ID HERE"
jam_cmd
jam_stdin
or stdin
to get updatesexec jam
is written to the end of stdin.cfg (So that everything is reloaded on completion.).Implemented
Downloading implemented
All that's left is to now add conversion.
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