-
-
Save ciel/00c65e37f9e0894e39a808b8de42d77b to your computer and use it in GitHub Desktop.
Revisions
-
TexasGamer revised this gist
Feb 2, 2015 . 1 changed file with 7 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ from gmusicapi import Webclient from gmusicapi import Mobileclient import vlc import urllib # Use Google account credintials. If two factor is enabled, use application specific password. email = '[email protected]' @@ -18,6 +19,8 @@ web_client = Webclient() mobile_client = Mobileclient() p = vlc.MediaPlayer() print "Logging in..." logged_in = web_client.login(email, password) @@ -43,9 +46,12 @@ song_name = song['track']['title'] song_artist = song['track']['artist'] stream_url = mobile_client.get_stream_url(song_id, device_id) # Uncomment to save most recent song # urllib.urlretrieve (stream_url, "mp3.mp3") print "Now Playing " + song_name + " by " + song_artist p.set_mrl(stream_url) p.play() else: print "Invalid login credintials" -
TexasGamer revised this gist
Feb 2, 2015 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,6 @@ from gmusicapi import Webclient from gmusicapi import Mobileclient import vlc # Use Google account credintials. If two factor is enabled, use application specific password. email = '[email protected]' -
TexasGamer revised this gist
Feb 2, 2015 . 1 changed file with 9 additions and 11 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,17 +26,16 @@ # logged_in is True if login was successful if logged_in == True: print "Successfully logged in" if device_id == '': devices = web_client.get_registered_devices() valid = [device['id'][2:] + " (" + device['model'] + ")" for device in devices if device['type'] == 'PHONE'] print valid id_index = int(raw_input("Device ID: ")) device_id = valid[id_index].split(' ', 1)[0] while True: song_name = raw_input("Song title: ") results = mobile_client.search_all_access(song_name, 1) @@ -49,6 +48,5 @@ print "Now Playing " + song_name + " by " + song_artist p = vlc.MediaPlayer(stream_url) p.play() else: print "Invalid login credintials" -
TexasGamer revised this gist
Feb 2, 2015 . 1 changed file with 25 additions and 23 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ from gmusicapi import Webclient from gmusicapi import Mobileclient import vlc import time # Use Google account credintials. If two factor is enabled, use application specific password. email = '[email protected]' @@ -26,27 +26,29 @@ # logged_in is True if login was successful if logged_in == True: while True: print "Successfully logged in" if device_id == '': devices = web_client.get_registered_devices() valid = [device['id'][2:] + " (" + device['model'] + ")" for device in devices if device['type'] == 'PHONE'] print valid id_index = int(raw_input("Device ID: ")) device_id = valid[id_index].split(' ', 1)[0] song_name = raw_input("Song title: ") results = mobile_client.search_all_access(song_name, 1) song = results['song_hits'][0] song_id = song['track']['nid'] song_name = song['track']['title'] song_artist = song['track']['artist'] stream_url = mobile_client.get_stream_url(song_id, device_id) print "Now Playing " + song_name + " by " + song_artist p = vlc.MediaPlayer(stream_url) p.play() print p.get_state() else: print "Invalid login credintials" -
TexasGamer created this gist
Jan 30, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,52 @@ from gmusicapi import Webclient from gmusicapi import Mobileclient import os import subprocess # Use Google account credintials. If two factor is enabled, use application specific password. email = '[email protected]' password = 'password' # Device ID for API queries. Leave blank if unknown. device_id = '' if email == '': email = raw_input("Email: ") if password == '': password = raw_input("Password: ") web_client = Webclient() mobile_client = Mobileclient() print "Logging in..." logged_in = web_client.login(email, password) logged_in = mobile_client.login(email, password) # logged_in is True if login was successful if logged_in == True: print "Successfully logged in" if device_id == '': devices = web_client.get_registered_devices() valid = [device['id'][2:] + " (" + device['model'] + ")" for device in devices if device['type'] == 'PHONE'] print valid id_index = int(raw_input("Device ID: ")) device_id = valid[id_index].split(' ', 1)[0] song_name = raw_input("Song title: ") results = mobile_client.search_all_access(song_name, 1) song = results['song_hits'][0] song_id = song['track']['nid'] song_name = song['track']['title'] song_artist = song['track']['artist'] stream_url = mobile_client.get_stream_url(song_id, device_id) print "Now Playing " + song_name + " by " + song_artist subprocess.Popen(['open', '-a', "/Applications/VLC.app", stream_url]) else: print "Invalid login credintials"