mirror of
https://git.lecygnenoir.info/LecygneNoir/prismedia.git
synced 2025-10-03 17:39:16 +02:00
Add new feature to schedule different publication date depending of the platform. Target v0.9.0, Fix #43
This commit is contained in:
parent
159ab00cc9
commit
429ea2333e
6 changed files with 37 additions and 4 deletions
|
@ -1,5 +1,10 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## v0.8.1
|
||||||
|
|
||||||
|
### Features
|
||||||
|
- Add two new options to schedule video by platform. You may now use youtubeAt and peertubeAt to prepare previews
|
||||||
|
|
||||||
## v0.8.0
|
## v0.8.0
|
||||||
|
|
||||||
### Breaking changes
|
### Breaking changes
|
||||||
|
|
|
@ -112,6 +112,8 @@ Options:
|
||||||
--publishAt=DATE Publish the video at the given DATE using local server timezone.
|
--publishAt=DATE Publish the video at the given DATE using local server timezone.
|
||||||
DATE should be on the form YYYY-MM-DDThh:mm:ss eg: 2018-03-12T19:00:00
|
DATE should be on the form YYYY-MM-DDThh:mm:ss eg: 2018-03-12T19:00:00
|
||||||
DATE should be in the future
|
DATE should be in the future
|
||||||
|
--peertubeAt=DATE
|
||||||
|
--youtubeAt=DATE Override publishAt for the corresponding platform. Allow to create preview on specific platform
|
||||||
--thumbnail=STRING Path to a file to use as a thumbnail for the video.
|
--thumbnail=STRING Path to a file to use as a thumbnail for the video.
|
||||||
Supported types are jpg and jpeg.
|
Supported types are jpg and jpeg.
|
||||||
By default, prismedia search for an image based on video name followed by .jpg or .jpeg
|
By default, prismedia search for an image based on video name followed by .jpg or .jpeg
|
||||||
|
|
|
@ -230,8 +230,13 @@ def upload_video(oauth, secret, options):
|
||||||
if options.get('--privacy'):
|
if options.get('--privacy'):
|
||||||
privacy = options.get('--privacy').lower()
|
privacy = options.get('--privacy').lower()
|
||||||
|
|
||||||
if options.get('--publishAt'):
|
# If peertubeAt exists, use instead of publishAt
|
||||||
|
if options.get('--peertubeAt'):
|
||||||
|
publishAt = options.get('--peertubeAt')
|
||||||
|
elif options.get('--publishAt'):
|
||||||
publishAt = options.get('--publishAt')
|
publishAt = options.get('--publishAt')
|
||||||
|
|
||||||
|
if 'publishAt' in locals():
|
||||||
publishAt = datetime.datetime.strptime(publishAt, '%Y-%m-%dT%H:%M:%S')
|
publishAt = datetime.datetime.strptime(publishAt, '%Y-%m-%dT%H:%M:%S')
|
||||||
tz = get_localzone()
|
tz = get_localzone()
|
||||||
tz = pytz.timezone(str(tz))
|
tz = pytz.timezone(str(tz))
|
||||||
|
|
|
@ -124,9 +124,15 @@ def initialize_upload(youtube, options):
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if options.get('--publishAt'):
|
# If peertubeAt exists, use instead of publishAt
|
||||||
|
if options.get('--youtubeAt'):
|
||||||
|
publishAt = options.get('--youtubeAt')
|
||||||
|
elif options.get('--publishAt'):
|
||||||
|
publishAt = options.get('--publishAt')
|
||||||
|
|
||||||
|
if 'publishAt' in locals():
|
||||||
# Youtube needs microsecond and the local timezone from ISO 8601
|
# Youtube needs microsecond and the local timezone from ISO 8601
|
||||||
publishAt = options.get('--publishAt') + ".000001"
|
publishAt = publishAt + ".000001"
|
||||||
publishAt = datetime.datetime.strptime(publishAt, '%Y-%m-%dT%H:%M:%S.%f')
|
publishAt = datetime.datetime.strptime(publishAt, '%Y-%m-%dT%H:%M:%S.%f')
|
||||||
tz = get_localzone()
|
tz = get_localzone()
|
||||||
tz = pytz.timezone(str(tz))
|
tz = pytz.timezone(str(tz))
|
||||||
|
|
|
@ -25,3 +25,6 @@ nsfw = False
|
||||||
platform = youtube, peertube
|
platform = youtube, peertube
|
||||||
language = French
|
language = French
|
||||||
publishAt=2034-05-07T19:00:00
|
publishAt=2034-05-07T19:00:00
|
||||||
|
# platformAt overrides the default publishAt for the corresponding platform
|
||||||
|
#peertubeAt = 2034-05-14T19:00:00
|
||||||
|
#youtubeAt = 2034-05-21T19:00:00
|
|
@ -33,6 +33,8 @@ Options:
|
||||||
--publishAt=DATE Publish the video at the given DATE using local server timezone.
|
--publishAt=DATE Publish the video at the given DATE using local server timezone.
|
||||||
DATE should be on the form YYYY-MM-DDThh:mm:ss eg: 2018-03-12T19:00:00
|
DATE should be on the form YYYY-MM-DDThh:mm:ss eg: 2018-03-12T19:00:00
|
||||||
DATE should be in the future
|
DATE should be in the future
|
||||||
|
--peertubeAt=DATE
|
||||||
|
--youtubeAt=DATE Override publishAt for the corresponding platform. Allow to create preview on specific platform
|
||||||
--thumbnail=STRING Path to a file to use as a thumbnail for the video.
|
--thumbnail=STRING Path to a file to use as a thumbnail for the video.
|
||||||
Supported types are jpg and jpeg.
|
Supported types are jpg and jpeg.
|
||||||
By default, prismedia search for an image based on video name followed by .jpg or .jpeg
|
By default, prismedia search for an image based on video name followed by .jpg or .jpeg
|
||||||
|
@ -208,6 +210,16 @@ if __name__ == '__main__':
|
||||||
validatePublish,
|
validatePublish,
|
||||||
error="DATE should be the form YYYY-MM-DDThh:mm:ss and has to be in the future")
|
error="DATE should be the form YYYY-MM-DDThh:mm:ss and has to be in the future")
|
||||||
),
|
),
|
||||||
|
Optional('--peertubeAt'): Or(None, And(
|
||||||
|
str,
|
||||||
|
validatePublish,
|
||||||
|
error="DATE should be the form YYYY-MM-DDThh:mm:ss and has to be in the future")
|
||||||
|
),
|
||||||
|
Optional('--youtubeAt'): Or(None, And(
|
||||||
|
str,
|
||||||
|
validatePublish,
|
||||||
|
error="DATE should be the form YYYY-MM-DDThh:mm:ss and has to be in the future")
|
||||||
|
),
|
||||||
Optional('--debug'): bool,
|
Optional('--debug'): bool,
|
||||||
Optional('--cca'): bool,
|
Optional('--cca'): bool,
|
||||||
Optional('--disable-comments'): bool,
|
Optional('--disable-comments'): bool,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue