mirror of
https://git.lecygnenoir.info/LecygneNoir/prismedia.git
synced 2025-10-02 17:09:15 +02:00
adding credentialsdir for youtube upload
This commit is contained in:
parent
822cf0fa9b
commit
8199286023
1 changed files with 9 additions and 2 deletions
|
@ -48,8 +48,8 @@ RETRIABLE_EXCEPTIONS = (
|
|||
RETRIABLE_STATUS_CODES = [500, 502, 503, 504]
|
||||
|
||||
|
||||
CLIENT_SECRETS_FILE = 'youtube_secret.json'
|
||||
CREDENTIALS_PATH = ".youtube_credentials.json"
|
||||
CLIENT_SECRETS_FILE_BASE = 'youtube_secret.json'
|
||||
CREDENTIALS_PATH_BASE = ".youtube_credentials.json"
|
||||
SCOPES = ['https://www.googleapis.com/auth/youtube.upload', 'https://www.googleapis.com/auth/youtube.force-ssl']
|
||||
API_SERVICE_NAME = 'youtube'
|
||||
API_VERSION = 'v3'
|
||||
|
@ -358,6 +358,13 @@ def hearthbeat():
|
|||
|
||||
|
||||
def run(options):
|
||||
global CLIENT_SECRETS_FILE, CREDENTIALS_PATH
|
||||
if options.get('--credentialsdir') :
|
||||
CLIENT_SECRETS_FILE = os.path.join(options.get('--credentialsdir'), CLIENT_SECRETS_FILE_BASE)
|
||||
CREDENTIALS_PATH = os.path.join(options.get('--credentialsdir'), CREDENTIALS_PATH_BASE)
|
||||
else :
|
||||
CLIENT_SECRETS_FILE = CLIENT_SECRETS_FILE_BASE
|
||||
CREDENTIALS_PATH = CREDENTIALS_PATH_BASE
|
||||
youtube = get_authenticated_service()
|
||||
try:
|
||||
initialize_upload(youtube, options)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue