Play music files on Google Drive
Project description
gdriveaudio
Play audio files in the google drive.
Requirments
- Python3
- MPlayer and FFmpeg
- Google account, access to the google cloud platform
Set up with Google cloud
Enable google drive API
- Log in to the google cloud console and create or choose the project to use.
- Go to Google Drive API page and enable it.
Create a service account to access google drive
- Log in to the google cloud console and create or choose the project to use.
- Go to IAM & 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 folder
- Open Google 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 account
- Log in to the google cloud console and choose the project to use.
- Open IAM & 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.json
and move to a folder to use for this tool.
Install
# from pypi
$ pip3 install gdriveaudio
# from github
$ git clone --depth=1 https://github.com/kota7/gdriveaudio.git
$ pip3 install -U ./gdriveaudio
Start playing
Run the commands in the folder that has the "_credentials.json":
# Initialize data
# Delete pre-fetched data
# Create SQLite database file '_gdriveaudio.db'
$ gdriveaudio init
# Update data
# -U for updating file list
# -F for updating folder structure information
# -M for updating audio metadata (this can take hours)
$ gdriveaudio update -UF
# or
$ gdriveaudio update -UFM
# Play all files
$ gdriveaudio play
# Play files with some condition
# -q: takes 'WHERE' condition for SQLite
$ gdriveaudio play -q "lower(prefix) like '%beethoven%'"
# Show data
$ gdriveaudio data -n 5 -q "lower(prefix) like '%jason%'"
The audio player can be controled by key strokes (See full description at man mplayer
):
<- or -> seek backward/forward 10 seconds
down or up seek backward/forward 1 minute
pgdown or pgup seek backward/forward 10 minutes
< or > step backward/forward in playlist
p or SPACE pause movie (press any key to continue)
q or ESC stop playing and quit program
+ or - adjust audio delay by +/- 0.1 second
o cycle OSD mode: none / seekbar / seekbar + timer
* or / increase or decrease PCM volume
x or z adjust subtitle delay by +/- 0.1 second
r or t adjust subtitle position up/down, also see -vf expand
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gdriveaudio-0.1.4.tar.gz
(7.9 kB
view hashes)
Built Distribution
Close
Hashes for gdriveaudio-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 861374c62ea501db36e88137f0b9e7acde618694840f19fa12b370fd5ba4413b |
|
MD5 | a0df3a7e2d87e1dfa3b110126983d619 |
|
BLAKE2b-256 | a04df0b37b72e297ddf24a2ee80951611a922e733b0f8cece3bcafa5db290f2e |