Skip to content
Snippets Groups Projects
Commit 3a33f939 authored by Robert Goldmann's avatar Robert Goldmann
Browse files

move settings to config folder; create destination folder if not exists

parent 70eefe0e
Branches
Tags
No related merge requests found
...@@ -91,6 +91,7 @@ class SaveMyPlaylist: ...@@ -91,6 +91,7 @@ class SaveMyPlaylist:
return items, nextPageToken return items, nextPageToken
def download_items(self, destinationFolder, debug=False): def download_items(self, destinationFolder, debug=False):
os.makedirs(destinationFolder, exist_ok=True)
print('>>> Scanning destination folder...') print('>>> Scanning destination folder...')
downloadedVideos = [f for f in os.listdir(destinationFolder) if downloadedVideos = [f for f in os.listdir(destinationFolder) if
os.path.isfile(os.path.join(destinationFolder, f)) and f.endswith('.mp4')] os.path.isfile(os.path.join(destinationFolder, f)) and f.endswith('.mp4')]
...@@ -134,7 +135,7 @@ class SaveMyPlaylist: ...@@ -134,7 +135,7 @@ class SaveMyPlaylist:
if __name__ == '__main__': if __name__ == '__main__':
with open("settings.json", "r") as f: with open("config/settings.json", "r") as f:
SETTINGS = json.load(f) SETTINGS = json.load(f)
saveMyPlaylist = SaveMyPlaylist(SETTINGS['apiKey'], SETTINGS['playlistId']) saveMyPlaylist = SaveMyPlaylist(SETTINGS['apiKey'], SETTINGS['playlistId'])
......
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment