mirror of
https://git.lecygnenoir.info/LecygneNoir/prismedia.git
synced 2025-10-03 09:29:16 +02:00
add category options with conversion between peertube/youtube
This commit is contained in:
parent
c79309e091
commit
4c58f14cdf
4 changed files with 90 additions and 7 deletions
|
@ -16,6 +16,7 @@ from googleapiclient.errors import HttpError
|
|||
from googleapiclient.http import MediaFileUpload
|
||||
from google_auth_oauthlib.flow import InstalledAppFlow
|
||||
|
||||
import utils
|
||||
|
||||
# Explicitly tell the underlying HTTP transport library not to retry, since
|
||||
# we are handling retry logic ourselves.
|
||||
|
@ -76,12 +77,17 @@ def initialize_upload(youtube, options):
|
|||
if options.get('--tags'):
|
||||
tags = options.get('--tags').split(',')
|
||||
|
||||
category = None
|
||||
if options.get('--category'):
|
||||
category = utils.getCategory(options.get('--category'), 'youtube')
|
||||
|
||||
body = {
|
||||
"snippet": {
|
||||
"title": options.get('--name') or splitext(basename(path))[0],
|
||||
"description": options.get('--description') or "",
|
||||
"description": options.get('--description') or "default description",
|
||||
"tags": tags,
|
||||
"categoryId": str(options.get('--category') or 1),
|
||||
#if no category, set default to 1 (Films)
|
||||
"categoryId": str(category or 1),
|
||||
},
|
||||
"status": {"privacyStatus": str(options.get('--privacy') or "private")}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue