Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F186367
generate_tracklist.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
624 B
Referenced Files
None
Subscribers
None
generate_tracklist.py
View Options
#!/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
Details
Attached
Mime Type
text/x-python
Expires
Thu, Jan 23, 5:28 PM (1 d, 5 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
131174
Default Alt Text
generate_tracklist.py (624 B)
Attached To
Mode
rPYMUSICLEAGUE PyMusicLeague
Attached
Detach File
Event Timeline
Log In to Comment