mirror of
https://git.lecygnenoir.info/LecygneNoir/prismedia.git
synced 2025-10-05 10:19:23 +02:00
Add the publishAt option to allow planned publication for your videos. See README for prerequisites
This commit is contained in:
parent
8968438af2
commit
d2c6154738
5 changed files with 95 additions and 4 deletions
|
@ -36,6 +36,7 @@ def get_authenticated_service(secret):
|
|||
client_id=str(secret.get('peertube', 'client_id')),
|
||||
client_secret=str(secret.get('peertube', 'client_secret'))
|
||||
)
|
||||
|
||||
return oauth
|
||||
|
||||
|
||||
|
@ -113,9 +114,10 @@ def upload_video(oauth, secret, options):
|
|||
headers=headers)
|
||||
if response is not None:
|
||||
if response.status_code == 200:
|
||||
uuid = response.json()
|
||||
uuid = uuid['video']
|
||||
uuid = uuid['uuid']
|
||||
jresponse = response.json()
|
||||
jresponse = jresponse['video']
|
||||
uuid = jresponse['uuid']
|
||||
idvideo = str(jresponse['id'])
|
||||
template = ('Peertube : Video was successfully uploaded.\n'
|
||||
'Watch it at %s/videos/watch/%s.')
|
||||
print(template % (url, uuid))
|
||||
|
@ -123,6 +125,9 @@ def upload_video(oauth, secret, options):
|
|||
exit(('Peertube : The upload failed with an unexpected response: '
|
||||
'%s') % response)
|
||||
|
||||
if options.get('--publishAt'):
|
||||
utils.publishAt(str(options.get('--publishAt')), oauth, url, idvideo)
|
||||
|
||||
|
||||
def run(options):
|
||||
secret = RawConfigParser()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue