Page MenuHomePhorge

generate_tracklist.py
No OneTemporary

generate_tracklist.py

#!/usr/bin/env python3
import csv
import json
import sys
import tekore as tk
import pyml_config as config
import libmusicleague as lml
from pprint import pprint
# Set up Spotify connection using client token
conf = (config.client_id, config.client_secret)
token = tk.request_client_token(*conf)
spotify = tk.Spotify(token)
# Get URI or URL from first argument
ur = str(sys.argv[1])
urt = lml.ur_type(ur)
st = lml.spotify_type(ur)
if st == "playlist":
if urt == "url":
uri = tk.from_url(ur)[1]
pl = lml.play_list(uri)
lml.print_playlist(pl)
elif urt == "uri":
pl = lml.play_list(urt)
lml.print_playlist(pl)

File Metadata

Mime Type
text/x-python
Expires
Thu, Jan 23, 5:28 PM (1 d, 8 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
131174
Default Alt Text
generate_tracklist.py (624 B)

Event Timeline