Remove channel title from credentials in playlist generation and deletion tasks
This commit is contained in:
parent
28203bd630
commit
f36fe8ea84
1 changed files with 2 additions and 0 deletions
|
@ -8,6 +8,7 @@ from . import models
|
||||||
@shared_task
|
@shared_task
|
||||||
def generate_playlist(creds, game_pk):
|
def generate_playlist(creds, game_pk):
|
||||||
game = models.MusikGame.objects.get(pk=game_pk)
|
game = models.MusikGame.objects.get(pk=game_pk)
|
||||||
|
creds.pop("channel_title")
|
||||||
credentials = google.oauth2.credentials.Credentials(**creds)
|
credentials = google.oauth2.credentials.Credentials(**creds)
|
||||||
yt_api = googleapiclient.discovery.build("youtube", "v3", credentials=credentials)
|
yt_api = googleapiclient.discovery.build("youtube", "v3", credentials=credentials)
|
||||||
pl_request = yt_api.playlists().insert(
|
pl_request = yt_api.playlists().insert(
|
||||||
|
@ -47,6 +48,7 @@ def generate_playlist(creds, game_pk):
|
||||||
|
|
||||||
@shared_task
|
@shared_task
|
||||||
def delete_playlist(creds, playlist_id):
|
def delete_playlist(creds, playlist_id):
|
||||||
|
creds.pop("channel_title")
|
||||||
credentials = google.oauth2.credentials.Credentials(**creds)
|
credentials = google.oauth2.credentials.Credentials(**creds)
|
||||||
|
|
||||||
yt_api = googleapiclient.discovery.build("youtube", "v3", credentials=credentials)
|
yt_api = googleapiclient.discovery.build("youtube", "v3", credentials=credentials)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue