diff --git a/SaveMyPlaylist.py b/SaveMyPlaylist.py index c827b9d84bd8dbc3b0f5d72ae8f61edaecd6207a..d7a6e80b138b99fab63ff30e1b93647f2770e82b 100644 --- a/SaveMyPlaylist.py +++ b/SaveMyPlaylist.py @@ -1,5 +1,6 @@ from __future__ import unicode_literals +import json import os import sys @@ -133,10 +134,8 @@ class SaveMyPlaylist: if __name__ == '__main__': - API_KEY = 'AIzaSyD1cQOPzYDRe5pylXEFsQw6u-MaBSOX09Y' - PLAYLIST_ID = 'PL7F-5FkCMt0HRvF40L2704WhjJZf9G6SB' - DESTINATION_FOLDER = 'C:/Users/ROGO2/Desktop/123' - SKIP_DOWNLOAD = True + with open("settings.json", "r") as f: + SETTINGS = json.load(f) - saveMyPlaylist = SaveMyPlaylist(API_KEY, PLAYLIST_ID) - saveMyPlaylist.download_items(DESTINATION_FOLDER, SKIP_DOWNLOAD) + saveMyPlaylist = SaveMyPlaylist(SETTINGS['apiKey'], SETTINGS['playlistId']) + saveMyPlaylist.download_items(SETTINGS['destinationFolder'], SETTINGS['skipDownload']) diff --git a/settings-example.json b/settings-example.json new file mode 100644 index 0000000000000000000000000000000000000000..db554f79695e7a4990a9dc8a722d2034ba185725 --- /dev/null +++ b/settings-example.json @@ -0,0 +1,6 @@ +{ + "apiKey": "", + "playlistId": "", + "destinationFolder": "", + "skipDownload": false +} \ No newline at end of file