本文整理汇总了Python中gmusicapi.Musicmanager.perform_oath方法的典型用法代码示例。如果您正苦于以下问题:Python Musicmanager.perform_oath方法的具体用法?Python Musicmanager.perform_oath怎么用?Python Musicmanager.perform_oath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gmusicapi.Musicmanager
的用法示例。
在下文中一共展示了Musicmanager.perform_oath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Musicmanager
# 需要导入模块: from gmusicapi import Musicmanager [as 别名]
# 或者: from gmusicapi.Musicmanager import perform_oath [as 别名]
original_sigint = signal.getsignal(signal.SIGINT)
signal.signal(signal.SIGINT, exit_cleanly)
parser = argparse.ArgumentParser(description="Google Music Player")
parser.add_argument('-l','--login', required=False, help='Create login credentials.', action="store_true")
parser.add_argument('-s','--shuffle', required=False, help='Play in random order.', action="store_true")
parser.add_argument('-r', '--refresh', required=False, help='Refresh Library.', action="store_true")
parser.add_argument('-d', '--display', required=False, help='Display playlist only.', action="store_true")
parser.add_argument('-t', '--artist', required=False, help='Artist Filter' )
args = parser.parse_args()
mm = Musicmanager()
if args.login:
mm.perform_oath()
sys.exit(0)
print "Logging In..."
mm.login()
if args.refresh:
print "Getting Songs"
library = mm.get_uploaded_songs()
with open('library.txt','w') as f:
pickle.dump( library, f)
print "Loading Library..."
with open('library.txt','r') as f:
library = pickle.load( f )