-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
29 lines (22 loc) · 771 Bytes
/
test.py
File metadata and controls
29 lines (22 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from scraper import WTTSParser
from scraper import SpotifyEditor
from oauth2 import Oauth2
def test():
CLIENT_ID = "your_id_here"
CLIENT_SECRET = "your_secret_here"
POSTBACK_URI = "http://127.0.0.1:8000"
STATE = "test"
PLAYLIST_PERMISSION = "playlist-read-private playlist-modify-public playlist-modify-private"
parser = WTTSParser()
parser.parseArtistSongList()
records = parser.getRecords()
#begin authentication
oauth2 = Oauth2(CLIENT_ID, CLIENT_SECRET, PLAYLIST_PERMISSION, STATE)
token = oauth2.get_token()
token = oauth2.obtain_authorization(token)
sp = SpotifyEditor(token)
playlist = "WTTS Overeasy"
#sp.create_playlist(playlist)
sp.add_records_to_playlist(records, playlist)
if __name__ == "__main__":
test()