Package: gdriveaudio
gdriveaudioPlay audio files in the google drive.RequirmentsPython3MPlayer and FFmpegUbuntu:sudo apt install mplayer ffmpegMacOSX:brew install mplayer ffmpegWindows: Follow official instructionatMPlayerandFFmpegGoogle account, access to the google cloud platformSet up with Google cloudEnable google drive APILog in to the google cloud console and create or choose the project to use.Go toGoogle Drive APIpage and enable it.Create a service account to access google driveLog in to the google cloud console and create or choose the project to use.Go toIAM & Admin > Service Accounts.Click "CREATE SERVICE ACCOUNT".Type in an arbitrary service account name (e.g.gdriveaudio-sa).Click "DONE".Note the email address of the service account name (e.g.gdriveaudio-sa@gdriveaudio-project.iam.gserviceaccount.com).Give the service account the access to the music folderOpenGoogle Drive.Open the folder that contains music files.Click the folder name and choose "Share".Paste the email address of the service account noted in the previous step.Click "Done".Create the credentials file of the service accountLog in to the google cloud console and choose the project to use.OpenIAM & Admin > Service Accounts.Click the service account created above.Click "KEYS" in the top menu.Click "ADD KEY" and then "Create new key"Choose "JSON" key type and click "CREATE".Rename the downloaded file as_credentials.jsonand move to a folder to use for this tool.Install# from pypi$pip3installgdriveaudio# from github$gitclone--depth=1https://github.com/kota7/gdriveaudio.git
$pip3install-U./gdriveaudioStart playingFor the program to locate the credential file, eitherRun the commands in the folder that has the "_credentials.json"SetGDRIVEAUDIO_DIRECTORYenvironment variable as the directory containing "_credentials.json", orRun the commands with--workdir={directory}option to specify the directory containing "_credentials.json"# Initialize data#   Delete pre-fetched data#   Create SQLite database file '_gdriveaudio.db'$gdriveaudioinit# Update data#   -U for updating file list#   -F for updating folder structure information#   -M for updating audio metadata (this can take hours)$gdriveaudioupdate-UF# or$gdriveaudioupdate-UFM# Play all files$gdriveaudioplay# Play files with some condition#   -k: case-insensitive keywords to search#   -K: case-sensitive keywords to search#   -q: Query inside 'WHERE' condition (follow SQLite dialect)$gdriveaudioplay-k"beethoven"$gdriveaudioplay-K"Michael J"# case sensitive search$gdriveaudioplay-k"name:lucky"# search only inside 'name' field$gdriveaudioplay-q"duration > 600"# 10+ min only# Show data# -k, -K, -q filters also work$gdriveaudiodata-n5$gdriveaudiodata-n10-k"beethoven"# See full command options$gdriveaudio-h
$gdriveaudio{init,update,play,data}-hThe audio player can be controled by key strokes (See full description atman mplayer):<-or->seekbackward/forward10secondsdownorupseekbackward/forward1minutepgdownorpgupseekbackward/forward10minutes<or>stepbackward/forwardinplaylistporSPACEpausemovie(pressanykeytocontinue)qorESCstopplayingandquitprogram+or-adjustaudiodelayby+/-0.1secondocycleOSDmode:none/seekbar/seekbar+timer*or/increaseordecreasePCMvolumexorzadjustsubtitledelayby+/-0.1secondrortadjustsubtitlepositionup/down,alsosee-vfexpand