Adding support for video transcripts

main
Bob Mottram 2023-02-18 22:10:15 +00:00
parent 9bfd159402
commit dc031cd4a9
36 changed files with 238 additions and 106 deletions

View File

@ -660,6 +660,7 @@ class PubServer(BaseHTTPRequestHandler):
attach_image_filename = None
media_type = None
image_description = None
video_transcript = None
in_reply_to = message_id
in_reply_to_atom_uri = message_id
subject = None
@ -696,7 +697,8 @@ class PubServer(BaseHTTPRequestHandler):
False, False,
comments_enabled,
attach_image_filename,
media_type, image_description, city,
media_type, image_description,
video_transcript, city,
in_reply_to, in_reply_to_atom_uri,
subject, self.server.debug,
schedule_post,
@ -20860,6 +20862,8 @@ class PubServer(BaseHTTPRequestHandler):
if not fields.get('imageDescription'):
fields['imageDescription'] = None
if not fields.get('videoTranscript'):
fields['videoTranscript'] = None
if not fields.get('subject'):
fields['subject'] = None
if not fields.get('replyTo'):
@ -20950,6 +20954,9 @@ class PubServer(BaseHTTPRequestHandler):
media_creator = ''
if fields.get('mediaCreator'):
media_creator = fields['mediaCreator']
video_transcript = ''
if fields.get('videoTranscript'):
video_transcript = fields['videoTranscript']
message_json = \
create_public_post(self.server.base_dir,
nickname,
@ -20960,6 +20967,7 @@ class PubServer(BaseHTTPRequestHandler):
False, False, comments_enabled,
filename, attachment_media_type,
fields['imageDescription'],
video_transcript,
city,
fields['replyTo'], fields['replyTo'],
fields['subject'],
@ -21062,6 +21070,7 @@ class PubServer(BaseHTTPRequestHandler):
fields['message'],
filename, attachment_media_type,
fields['imageDescription'],
video_transcript,
self.server.theme_name)
if message_json:
message_json = message_json.encode('utf-8')
@ -21101,6 +21110,9 @@ class PubServer(BaseHTTPRequestHandler):
media_creator = ''
if fields.get('mediaCreator'):
media_creator = fields['mediaCreator']
video_transcript = ''
if fields.get('videoTranscript'):
video_transcript = fields['videoTranscript']
message_json = \
create_blog_post(self.server.base_dir, nickname,
self.server.domain, self.server.port,
@ -21110,6 +21122,7 @@ class PubServer(BaseHTTPRequestHandler):
client_to_server, comments_enabled,
filename, attachment_media_type,
fields['imageDescription'],
video_transcript,
city,
fields['replyTo'], fields['replyTo'],
fields['subject'],
@ -21203,6 +21216,9 @@ class PubServer(BaseHTTPRequestHandler):
img_description = ''
if fields.get('imageDescription'):
img_description = fields['imageDescription']
video_transcript = ''
if fields.get('videoTranscript'):
video_transcript = fields['videoTranscript']
if filename:
city = get_spoofed_city(self.server.city,
@ -21228,9 +21244,11 @@ class PubServer(BaseHTTPRequestHandler):
filename,
attachment_media_type,
img_description,
video_transcript,
city,
self.server.low_bandwidth,
license_url, creator)
license_url, creator,
fields['languagesDropdown'])
replace_you_tube(post_json_object,
self.server.yt_replace_domain,
@ -21282,6 +21300,9 @@ class PubServer(BaseHTTPRequestHandler):
media_creator = ''
if fields.get('mediaCreator'):
media_creator = fields['mediaCreator']
video_transcript = ''
if fields.get('videoTranscript'):
video_transcript = fields['videoTranscript']
message_json = \
create_unlisted_post(self.server.base_dir,
nickname,
@ -21292,6 +21313,7 @@ class PubServer(BaseHTTPRequestHandler):
client_to_server, comments_enabled,
filename, attachment_media_type,
fields['imageDescription'],
video_transcript,
city,
fields['replyTo'],
fields['replyTo'],
@ -21401,6 +21423,9 @@ class PubServer(BaseHTTPRequestHandler):
media_creator = ''
if fields.get('mediaCreator'):
media_creator = fields['mediaCreator']
video_transcript = ''
if fields.get('videoTranscript'):
video_transcript = fields['videoTranscript']
message_json = \
create_followers_only_post(self.server.base_dir,
nickname,
@ -21413,6 +21438,7 @@ class PubServer(BaseHTTPRequestHandler):
comments_enabled,
filename, attachment_media_type,
fields['imageDescription'],
video_transcript,
city,
fields['replyTo'],
fields['replyTo'],
@ -21532,6 +21558,9 @@ class PubServer(BaseHTTPRequestHandler):
media_creator = ''
if fields.get('mediaCreator'):
media_creator = fields['mediaCreator']
video_transcript = ''
if fields.get('videoTranscript'):
video_transcript = fields['videoTranscript']
message_json = \
create_direct_message_post(self.server.base_dir,
nickname,
@ -21546,6 +21575,7 @@ class PubServer(BaseHTTPRequestHandler):
filename,
attachment_media_type,
fields['imageDescription'],
video_transcript,
city,
fields['replyTo'],
fields['replyTo'],
@ -21665,6 +21695,9 @@ class PubServer(BaseHTTPRequestHandler):
media_creator = ''
if fields.get('mediaCreator'):
media_creator = fields['mediaCreator']
video_transcript = ''
if fields.get('videoTranscript'):
video_transcript = fields['videoTranscript']
message_json = \
create_direct_message_post(self.server.base_dir,
nickname,
@ -21677,6 +21710,7 @@ class PubServer(BaseHTTPRequestHandler):
comments_enabled,
filename, attachment_media_type,
fields['imageDescription'],
video_transcript,
city,
None, None,
fields['subject'],
@ -21782,6 +21816,9 @@ class PubServer(BaseHTTPRequestHandler):
media_creator = ''
if fields.get('mediaCreator'):
media_creator = fields['mediaCreator']
video_transcript = ''
if fields.get('videoTranscript'):
video_transcript = fields['videoTranscript']
message_json = \
create_report_post(self.server.base_dir,
nickname,
@ -21791,6 +21828,7 @@ class PubServer(BaseHTTPRequestHandler):
False, False, True,
filename, attachment_media_type,
fields['imageDescription'],
video_transcript,
city,
self.server.debug, fields['subject'],
fields['languagesDropdown'],
@ -21842,6 +21880,9 @@ class PubServer(BaseHTTPRequestHandler):
media_creator = ''
if fields.get('mediaCreator'):
media_creator = fields['mediaCreator']
video_transcript = ''
if fields.get('videoTranscript'):
video_transcript = fields['videoTranscript']
message_json = \
create_question_post(self.server.base_dir,
nickname,
@ -21853,6 +21894,7 @@ class PubServer(BaseHTTPRequestHandler):
comments_enabled,
filename, attachment_media_type,
fields['imageDescription'],
video_transcript,
city,
fields['subject'],
int_duration_days,

View File

@ -530,6 +530,7 @@ def _desktop_reply_to_post(session, post_id: str,
event_end_time = None
location = None
buy_url = ''
video_transcript = None
_say_command(say_str, say_str, screenreader, system_language, espeak)
if send_post_via_server(signing_priv_key_pem, __version__,
base_dir, session, nickname, password,
@ -537,8 +538,9 @@ def _desktop_reply_to_post(session, post_id: str,
to_nickname, to_domain, to_port, cc_url,
http_prefix, reply_message,
comments_enabled, attach, media_type,
attached_image_description, city,
cached_webfingers, person_cache, is_article,
attached_image_description, video_transcript,
city, cached_webfingers,
person_cache, is_article,
system_language, languages_understood,
low_bandwidth, content_license_url,
media_license_url, media_creator,
@ -607,6 +609,7 @@ def _desktop_new_post(session,
event_end_time = None
location = None
buy_url = ''
video_transcript = None
_say_command(say_str, say_str, screenreader, system_language, espeak)
if send_post_via_server(signing_priv_key_pem, __version__,
base_dir, session, nickname, password,
@ -614,7 +617,7 @@ def _desktop_new_post(session,
None, '#Public', port, cc_url,
http_prefix, new_message,
comments_enabled, attach, media_type,
attached_image_description, city,
attached_image_description, video_transcript, city,
cached_webfingers, person_cache, is_article,
system_language, languages_understood,
low_bandwidth, content_license_url,
@ -1355,6 +1358,7 @@ def _desktop_new_dm_base(session, to_handle: str,
event_end_time = None
location = None
buy_url = ''
video_transcript = None
say_str = 'Sending'
_say_command(say_str, say_str, screenreader, system_language, espeak)
@ -1364,7 +1368,7 @@ def _desktop_new_dm_base(session, to_handle: str,
to_nickname, to_domain, to_port, cc_url,
http_prefix, new_message,
comments_enabled, attach, media_type,
attached_image_description, city,
attached_image_description, video_transcript, city,
cached_webfingers, person_cache, is_article,
system_language, languages_understood,
low_bandwidth, content_license_url,

View File

@ -1697,6 +1697,7 @@ def _command_options() -> None:
if argb.languages_understood:
languages_understood = [argb.languages_understood]
translate = {}
video_transcript = None
print('Sending post to ' + argb.sendto)
send_post_via_server(signing_priv_key_pem, __version__,
@ -1705,7 +1706,8 @@ def _command_options() -> None:
to_nickname, to_domain, to_port, cc_url,
http_prefix, send_message,
argb.commentsEnabled, attach, media_type,
attached_image_description, city,
attached_image_description,
video_transcript, city,
cached_webfingers, person_cache, is_article,
argb.language, languages_understood,
argb.low_bandwidth,
@ -3386,6 +3388,7 @@ def _command_options() -> None:
languages_understood = [argb.language]
translate = {}
buy_url = ''
test_video_transcript = ''
create_public_post(base_dir, nickname, domain, port, http_prefix,
"like this is totally just a #test man",
@ -3393,7 +3396,8 @@ def _command_options() -> None:
test_c2s,
test_comments_enabled,
test_attach_image_filename,
test_media_type, test_image_description, test_city,
test_media_type, test_image_description,
test_video_transcript, test_city,
test_in_reply_to, test_in_reply_to_atom_uri,
test_subject, test_schedule_post,
test_event_date, test_event_time,
@ -3408,7 +3412,8 @@ def _command_options() -> None:
test_c2s,
test_comments_enabled,
test_attach_image_filename,
test_media_type, test_image_description, test_city,
test_media_type, test_image_description,
test_video_transcript, test_city,
test_in_reply_to, test_in_reply_to_atom_uri,
test_subject, test_schedule_post,
test_event_date, test_event_time,
@ -3423,7 +3428,8 @@ def _command_options() -> None:
test_c2s,
test_comments_enabled,
test_attach_image_filename,
test_media_type, test_image_description, test_city,
test_media_type, test_image_description,
test_video_transcript, test_city,
test_in_reply_to, test_in_reply_to_atom_uri,
test_subject, test_schedule_post,
test_event_date, test_event_time,
@ -3438,7 +3444,8 @@ def _command_options() -> None:
test_c2s,
test_comments_enabled,
test_attach_image_filename,
test_media_type, test_image_description, test_city,
test_media_type, test_image_description,
test_video_transcript, test_city,
'someone', test_in_reply_to_atom_uri,
test_subject, test_schedule_post,
test_event_date, test_event_time,
@ -3454,7 +3461,8 @@ def _command_options() -> None:
test_c2s,
test_comments_enabled,
'img/logo.png', 'image/png',
'Description of image', test_city,
'Description of image',
test_video_transcript, test_city,
test_in_reply_to, test_in_reply_to_atom_uri,
test_subject, test_schedule_post,
test_event_date, test_event_time,
@ -3469,7 +3477,8 @@ def _command_options() -> None:
test_c2s,
test_comments_enabled,
test_attach_image_filename,
test_media_type, test_image_description, test_city,
test_media_type, test_image_description,
test_video_transcript, test_city,
test_in_reply_to, test_in_reply_to_atom_uri,
test_subject, test_schedule_post,
test_event_date, test_event_time,
@ -3484,7 +3493,8 @@ def _command_options() -> None:
test_c2s,
test_comments_enabled,
test_attach_image_filename,
test_media_type, test_image_description, test_city,
test_media_type, test_image_description,
test_video_transcript, test_city,
test_in_reply_to, test_in_reply_to_atom_uri,
test_subject, test_schedule_post,
test_event_date, test_event_time,
@ -3499,7 +3509,8 @@ def _command_options() -> None:
test_c2s,
test_comments_enabled,
test_attach_image_filename,
test_media_type, test_image_description, test_city,
test_media_type, test_image_description,
test_video_transcript, test_city,
test_in_reply_to, test_in_reply_to_atom_uri,
test_subject, test_schedule_post,
test_event_date, test_event_time,

View File

@ -3763,6 +3763,7 @@ def _bounce_dm(sender_post_id: str, session, http_prefix: str,
attach_image_filename = None
media_type = None
image_description = ''
video_transcript = None
city = 'London, England'
in_reply_to = remove_id_ending(sender_post_id)
in_reply_to_atom_uri = None
@ -3780,7 +3781,7 @@ def _bounce_dm(sender_post_id: str, session, http_prefix: str,
save_to_file, client_to_server,
comments_enabled,
attach_image_filename, media_type,
image_description, city,
image_description, video_transcript, city,
in_reply_to, in_reply_to_atom_uri,
subject, debug, schedule_post,
event_date, event_time, event_end_time,

View File

@ -553,9 +553,11 @@ def attach_media(base_dir: str, http_prefix: str,
nickname: str, domain: str, port: int,
post_json: {}, image_filename: str,
media_type: str, description: str,
video_transcript: str,
city: str, low_bandwidth: bool,
content_license_url: str,
creator: str) -> {}:
creator: str,
system_language: str) -> {}:
"""Attaches media to a json object post
The description can be None
"""
@ -619,6 +621,14 @@ def attach_media(base_dir: str, http_prefix: str,
attachment_json['height'] = attach_image_height
post_json['attachment'] = [attachment_json]
if video_transcript and 'video' in media_type:
video_transcript_json = {
'mediaType': 'text/vtt',
'name': system_language,
'type': 'Document',
'url': http_prefix + '://' + domain + '/' + media_path
}
post_json['attachment'].append(video_transcript_json)
if base_dir:
if media_type.startswith('image/'):

View File

@ -635,6 +635,7 @@ def _convert_rss_to_activitypub(base_dir: str, http_prefix: str,
attach_image_filename = None
media_type = None
image_description = None
video_transcript = None
city = 'London, England'
conversation_id = None
languages_understood = [system_language]
@ -644,8 +645,8 @@ def _convert_rss_to_activitypub(base_dir: str, http_prefix: str,
rss_description,
save_to_file,
attach_image_filename, media_type,
image_description, city,
rss_title, system_language,
image_description, video_transcript,
city, rss_title, system_language,
conversation_id, low_bandwidth,
content_license_url,
media_license_url, media_creator,

View File

@ -1144,7 +1144,8 @@ def _create_post_s2s(base_dir: str, nickname: str, domain: str, port: int,
to_recipients: [], to_cc: [], in_reply_to: str,
sensitive: bool, comments_enabled: bool,
tags: [], attach_image_filename: str,
media_type: str, image_description: str, city: str,
media_type: str, image_description: str,
video_transcript: str, city: str,
post_object_type: str, summary: str,
in_reply_to_atom_uri: str, system_language: str,
conversation_id: str, low_bandwidth: bool,
@ -1211,8 +1212,9 @@ def _create_post_s2s(base_dir: str, nickname: str, domain: str, port: int,
new_post['object'] = \
attach_media(base_dir, http_prefix, nickname, domain, port,
new_post['object'], attach_image_filename,
media_type, image_description, city, low_bandwidth,
media_license_url, media_creator)
media_type, image_description, video_transcript,
city, low_bandwidth,
media_license_url, media_creator, system_language)
_attach_post_license(new_post['object'], content_license_url)
_attach_buy_link(new_post['object'], buy_url, translate)
return new_post
@ -1224,7 +1226,8 @@ def _create_post_c2s(base_dir: str, nickname: str, domain: str, port: int,
to_recipients: [], to_cc: [], in_reply_to: str,
sensitive: bool, comments_enabled: bool,
tags: [], attach_image_filename: str,
media_type: str, image_description: str, city: str,
media_type: str, image_description: str,
video_transcript: str, city: str,
post_object_type: str, summary: str,
in_reply_to_atom_uri: str, system_language: str,
conversation_id: str, low_bandwidth: str,
@ -1280,8 +1283,10 @@ def _create_post_c2s(base_dir: str, nickname: str, domain: str, port: int,
new_post = \
attach_media(base_dir, http_prefix, nickname, domain, port,
new_post, attach_image_filename,
media_type, image_description, city, low_bandwidth,
media_license_url, media_creator)
media_type, image_description, video_transcript,
city, low_bandwidth,
media_license_url, media_creator,
system_language)
_attach_post_license(new_post, content_license_url)
_attach_buy_link(new_post, buy_url, translate)
return new_post
@ -1479,7 +1484,8 @@ def _create_post_base(base_dir: str,
save_to_file: bool,
client_to_server: bool, comments_enabled: bool,
attach_image_filename: str,
media_type: str, image_description: str, city: str,
media_type: str, image_description: str,
video_transcript: str, city: str,
is_moderation_report: bool,
is_article: bool,
in_reply_to: str,
@ -1655,7 +1661,8 @@ def _create_post_base(base_dir: str,
to_recipients, to_cc, in_reply_to,
sensitive, comments_enabled,
tags, attach_image_filename,
media_type, image_description, city,
media_type, image_description,
video_transcript, city,
post_object_type, summary,
in_reply_to_atom_uri, system_language,
conversation_id, low_bandwidth,
@ -1669,7 +1676,8 @@ def _create_post_base(base_dir: str,
to_recipients, to_cc, in_reply_to,
sensitive, comments_enabled,
tags, attach_image_filename,
media_type, image_description, city,
media_type, image_description,
video_transcript, city,
post_object_type, summary,
in_reply_to_atom_uri, system_language,
conversation_id, low_bandwidth,
@ -1907,8 +1915,8 @@ def create_public_post(base_dir: str,
content: str, save_to_file: bool,
client_to_server: bool, comments_enabled: bool,
attach_image_filename: str, media_type: str,
image_description: str, city: str,
in_reply_to: str,
image_description: str, video_transcript: str,
city: str, in_reply_to: str,
in_reply_to_atom_uri: str, subject: str,
schedule_post: bool,
event_date: str, event_time: str, event_end_time: str,
@ -1939,7 +1947,7 @@ def create_public_post(base_dir: str,
http_prefix, content, save_to_file,
client_to_server, comments_enabled,
attach_image_filename, media_type,
image_description, city,
image_description, video_transcript, city,
is_moderation_report, is_article,
in_reply_to, in_reply_to_atom_uri, subject,
schedule_post, event_date, event_time, location,
@ -1990,8 +1998,8 @@ def create_blog_post(base_dir: str,
content: str, save_to_file: bool,
client_to_server: bool, comments_enabled: bool,
attach_image_filename: str, media_type: str,
image_description: str, city: str,
in_reply_to: str, in_reply_to_atom_uri: str,
image_description: str, video_transcript: str,
city: str, in_reply_to: str, in_reply_to_atom_uri: str,
subject: str, schedule_post: bool,
event_date: str, event_time: str, event_end_time: str,
location: str, system_language: str,
@ -2006,7 +2014,7 @@ def create_blog_post(base_dir: str,
content, save_to_file,
client_to_server, comments_enabled,
attach_image_filename, media_type,
image_description, city,
image_description, video_transcript, city,
in_reply_to, in_reply_to_atom_uri, subject,
schedule_post,
event_date, event_time, event_end_time, location,
@ -2025,7 +2033,7 @@ def create_news_post(base_dir: str,
domain: str, port: int, http_prefix: str,
content: str, save_to_file: bool,
attach_image_filename: str, media_type: str,
image_description: str, city: str,
image_description: str, video_transcript: str, city: str,
subject: str, system_language: str,
conversation_id: str, low_bandwidth: bool,
content_license_url: str,
@ -2046,7 +2054,7 @@ def create_news_post(base_dir: str,
content, save_to_file,
client_to_server, False,
attach_image_filename, media_type,
image_description, city,
image_description, video_transcript, city,
in_reply_to, in_reply_to_atom_uri, subject,
schedule_post,
event_date, event_time, event_end_time, location,
@ -2065,8 +2073,8 @@ def create_question_post(base_dir: str,
save_to_file: bool,
client_to_server: bool, comments_enabled: bool,
attach_image_filename: str, media_type: str,
image_description: str, city: str,
subject: str, duration_days: int,
image_description: str, video_transcript: str,
city: str, subject: str, duration_days: int,
system_language: str, low_bandwidth: bool,
content_license_url: str,
media_license_url: str, media_creator: str,
@ -2083,7 +2091,7 @@ def create_question_post(base_dir: str,
http_prefix, content, save_to_file,
client_to_server, comments_enabled,
attach_image_filename, media_type,
image_description, city,
image_description, video_transcript, city,
False, False, None, None, subject,
False, None, None, None, None, None,
None, None, None,
@ -2118,8 +2126,9 @@ def create_unlisted_post(base_dir: str,
content: str, save_to_file: bool,
client_to_server: bool, comments_enabled: bool,
attach_image_filename: str, media_type: str,
image_description: str, city: str,
in_reply_to: str, in_reply_to_atom_uri: str,
image_description: str, video_transcript: str,
city: str, in_reply_to: str,
in_reply_to_atom_uri: str,
subject: str, schedule_post: bool,
event_date: str, event_time: str, event_end_time: str,
location: str, system_language: str,
@ -2138,7 +2147,7 @@ def create_unlisted_post(base_dir: str,
http_prefix, content, save_to_file,
client_to_server, comments_enabled,
attach_image_filename, media_type,
image_description, city,
image_description, video_transcript, city,
False, False,
in_reply_to, in_reply_to_atom_uri, subject,
schedule_post, event_date,
@ -2157,8 +2166,8 @@ def create_followers_only_post(base_dir: str,
save_to_file: bool,
client_to_server: bool, comments_enabled: bool,
attach_image_filename: str, media_type: str,
image_description: str, city: str,
in_reply_to: str,
image_description: str, video_transcript: str,
city: str, in_reply_to: str,
in_reply_to_atom_uri: str,
subject: str, schedule_post: bool,
event_date: str,
@ -2178,7 +2187,7 @@ def create_followers_only_post(base_dir: str,
http_prefix, content, save_to_file,
client_to_server, comments_enabled,
attach_image_filename, media_type,
image_description, city,
image_description, video_transcript, city,
False, False,
in_reply_to, in_reply_to_atom_uri, subject,
schedule_post, event_date, event_time, location,
@ -2233,8 +2242,8 @@ def create_direct_message_post(base_dir: str,
save_to_file: bool, client_to_server: bool,
comments_enabled: bool,
attach_image_filename: str, media_type: str,
image_description: str, city: str,
in_reply_to: str,
image_description: str, video_transcript: str,
city: str, in_reply_to: str,
in_reply_to_atom_uri: str,
subject: str, debug: bool,
schedule_post: bool,
@ -2264,7 +2273,7 @@ def create_direct_message_post(base_dir: str,
http_prefix, content, save_to_file,
client_to_server, comments_enabled,
attach_image_filename, media_type,
image_description, city,
image_description, video_transcript, city,
False, False,
in_reply_to, in_reply_to_atom_uri, subject,
schedule_post, event_date, event_time, location,
@ -2293,9 +2302,9 @@ def create_report_post(base_dir: str,
content: str, save_to_file: bool,
client_to_server: bool, comments_enabled: bool,
attach_image_filename: str, media_type: str,
image_description: str, city: str,
debug: bool, subject: str, system_language: str,
low_bandwidth: bool,
image_description: str, video_transcript: str,
city: str, debug: bool, subject: str,
system_language: str, low_bandwidth: bool,
content_license_url: str,
media_license_url: str, media_creator: str,
languages_understood: [], translate: {}) -> {}:
@ -2371,7 +2380,7 @@ def create_report_post(base_dir: str,
http_prefix, content, save_to_file,
client_to_server, comments_enabled,
attach_image_filename, media_type,
image_description, city,
image_description, video_transcript, city,
True, False, None, None, subject,
False, None, None, None, None, None,
None, None, None,
@ -2495,7 +2504,7 @@ def send_post(signing_priv_key_pem: str, project_version: str,
save_to_file: bool, client_to_server: bool,
comments_enabled: bool,
attach_image_filename: str, media_type: str,
image_description: str, city: str,
image_description: str, video_transcript: str, city: str,
federation_list: [], send_threads: [], post_log: [],
cached_webfingers: {}, person_cache: {},
is_article: bool, system_language: str,
@ -2564,7 +2573,7 @@ def send_post(signing_priv_key_pem: str, project_version: str,
save_to_file, client_to_server,
comments_enabled,
attach_image_filename, media_type,
image_description, city,
image_description, video_transcript, city,
False, is_article, in_reply_to,
in_reply_to_atom_uri, subject,
False, None, None, None, None, None,
@ -2664,8 +2673,8 @@ def send_post_via_server(signing_priv_key_pem: str, project_version: str,
http_prefix: str, content: str,
comments_enabled: bool,
attach_image_filename: str, media_type: str,
image_description: str, city: str,
cached_webfingers: {}, person_cache: {},
image_description: str, video_transcript: str,
city: str, cached_webfingers: {}, person_cache: {},
is_article: bool, system_language: str,
languages_understood: [],
low_bandwidth: bool,
@ -2755,7 +2764,7 @@ def send_post_via_server(signing_priv_key_pem: str, project_version: str,
save_to_file, client_to_server,
comments_enabled,
attach_image_filename, media_type,
image_description, city,
image_description, video_transcript, city,
False, is_article, in_reply_to,
in_reply_to_atom_uri, subject,
False,

View File

@ -777,6 +777,7 @@ def create_server_alice(path: str, domain: str, port: int,
media_license_url = 'https://creativecommons.org/licenses/by-nc/4.0'
media_creator = 'Mr Blobby'
buy_url = ''
test_video_transcript = ''
create_public_post(path, nickname, domain, port, http_prefix,
"No wise fish would go anywhere without a porpoise",
test_save_to_file,
@ -784,8 +785,9 @@ def create_server_alice(path: str, domain: str, port: int,
test_comments_enabled,
test_attach_image_filename,
test_media_type,
test_image_description, test_city,
test_in_reply_to, test_in_reply_to_atom_uri,
test_image_description, test_video_transcript,
test_city, test_in_reply_to,
test_in_reply_to_atom_uri,
test_subject, test_schedule_post,
test_event_date, test_event_time,
test_event_end_time, test_location,
@ -800,8 +802,9 @@ def create_server_alice(path: str, domain: str, port: int,
test_comments_enabled,
test_attach_image_filename,
test_media_type,
test_image_description, test_city,
test_in_reply_to, test_in_reply_to_atom_uri,
test_image_description, test_video_transcript,
test_city, test_in_reply_to,
test_in_reply_to_atom_uri,
test_subject, test_schedule_post,
test_event_date, test_event_time,
test_event_end_time, test_location,
@ -817,8 +820,9 @@ def create_server_alice(path: str, domain: str, port: int,
test_comments_enabled,
test_attach_image_filename,
test_media_type,
test_image_description, test_city,
test_in_reply_to, test_in_reply_to_atom_uri,
test_image_description, test_video_transcript,
test_city, test_in_reply_to,
test_in_reply_to_atom_uri,
test_subject, test_schedule_post,
test_event_date, test_event_time,
test_event_end_time, test_location,
@ -947,6 +951,7 @@ def create_server_bob(path: str, domain: str, port: int,
media_creator = 'Hamster'
translate = {}
buy_url = ''
test_video_transcript = ''
create_public_post(path, nickname, domain, port, http_prefix,
"It's your life, live it your way.",
test_save_to_file,
@ -954,8 +959,9 @@ def create_server_bob(path: str, domain: str, port: int,
test_comments_enabled,
test_attach_image_filename,
test_media_type,
test_image_description, test_city,
test_in_reply_to, test_in_reply_to_atom_uri,
test_image_description, test_video_transcript,
test_city, test_in_reply_to,
test_in_reply_to_atom_uri,
test_subject, test_schedule_post,
test_event_date, test_event_time,
test_event_end_time, test_location,
@ -971,8 +977,9 @@ def create_server_bob(path: str, domain: str, port: int,
test_comments_enabled,
test_attach_image_filename,
test_media_type,
test_image_description, test_city,
test_in_reply_to, test_in_reply_to_atom_uri,
test_image_description, test_video_transcript,
test_city, test_in_reply_to,
test_in_reply_to_atom_uri,
test_subject, test_schedule_post,
test_event_date, test_event_time,
test_event_end_time, test_location,
@ -987,8 +994,9 @@ def create_server_bob(path: str, domain: str, port: int,
test_comments_enabled,
test_attach_image_filename,
test_media_type,
test_image_description, test_city,
test_in_reply_to, test_in_reply_to_atom_uri,
test_image_description, test_video_transcript,
test_city, test_in_reply_to,
test_in_reply_to_atom_uri,
test_subject, test_schedule_post,
test_event_date, test_event_time,
test_event_end_time, test_location,
@ -1327,6 +1335,7 @@ def test_post_message_between_servers(base_dir: str) -> None:
assert test_image_height
media_type = get_attachment_media_type(attached_image_filename)
attached_image_description = 'Logo'
video_transcript = None
is_article = False
city = 'London, England'
# nothing in Alice's outbox
@ -1345,7 +1354,8 @@ def test_post_message_between_servers(base_dir: str) -> None:
'यह एक परीक्षण है #sillyquestion',
save_to_file, client_to_server, True,
attached_image_filename, media_type,
attached_image_description, city, federation_list,
attached_image_description, video_transcript,
city, federation_list,
alice_send_threads, alice_post_log, alice_cached_webfingers,
alice_person_cache, is_article, system_language,
languages_understood,
@ -1715,13 +1725,14 @@ def test_follow_between_servers(base_dir: str) -> None:
signing_priv_key_pem = None
translate = {}
buy_url = ''
video_transcript = None
send_result = \
send_post(signing_priv_key_pem, __version__,
session_alice, alice_dir, 'alice', alice_domain, alice_port,
'bob', bob_domain, bob_port, cc_url,
http_prefix, 'Alice message', save_to_file,
client_to_server, True,
None, None, None, city, federation_list,
None, None, None, video_transcript, city, federation_list,
alice_send_threads, alice_post_log, alice_cached_webfingers,
alice_person_cache, is_article, system_language,
languages_understood,
@ -2086,13 +2097,14 @@ def test_shared_items_federation(base_dir: str) -> None:
signing_priv_key_pem = None
translate = {}
buy_url = ''
video_transcript = None
send_result = \
send_post(signing_priv_key_pem, __version__,
session_alice, alice_dir, 'alice', alice_domain, alice_port,
'bob', bob_domain, bob_port, cc_url,
http_prefix, 'Alice message', save_to_file,
client_to_server, True,
None, None, None, city, federation_list,
None, None, None, video_transcript, city, federation_list,
alice_send_threads, alice_post_log, alice_cached_webfingers,
alice_person_cache, is_article, system_language,
languages_understood,
@ -2520,13 +2532,14 @@ def test_group_follow(base_dir: str) -> None:
translate = {}
buy_url = ''
video_transcript = None
send_result = \
send_post(signing_priv_key_pem, __version__,
session_alice, alice_dir, 'alice', alice_domain, alice_port,
'testgroup', testgroup_domain, testgroupPort, cc_url,
http_prefix, "Alice group message",
save_to_file, client_to_server, True,
None, None, None, city, federation_list,
None, None, None, video_transcript, city, federation_list,
alice_send_threads, alice_post_log, alice_cached_webfingers,
alice_person_cache, is_article, system_language,
languages_understood,
@ -2916,7 +2929,7 @@ def _test_create_person_account(base_dir: str):
content, save_to_file,
client_to_server,
comments_enabled, attach_image_filename, media_type,
'Not suitable for Vogons', 'London, England',
'Not suitable for Vogons', '', 'London, England',
test_in_reply_to, test_in_reply_to_atom_uri,
test_subject, test_schedule_post,
test_event_date, test_event_time,
@ -2943,7 +2956,7 @@ def _test_create_person_account(base_dir: str):
content, save_to_file,
client_to_server,
comments_enabled, attach_image_filename, media_type,
'Not suitable for Vogons', 'London, England',
'Not suitable for Vogons', '', 'London, England',
test_in_reply_to, test_in_reply_to_atom_uri,
test_subject, test_schedule_post,
test_event_date, test_event_time,
@ -3155,6 +3168,7 @@ def test_client_to_server(base_dir: str):
location = "Kinshasa"
translate = {}
buy_url = ''
video_transcript = None
send_result = \
send_post_via_server(signing_priv_key_pem, __version__,
alice_dir, session_alice, 'alice', password,
@ -3162,7 +3176,8 @@ def test_client_to_server(base_dir: str):
'bob', bob_domain, bob_port, None,
http_prefix, 'Sent from my ActivityPub client',
True, attached_image_filename, media_type,
attached_image_description, city,
attached_image_description,
video_transcript, city,
cached_webfingers, person_cache, is_article,
system_language, languages_understood,
low_bandwidth, content_license_url,
@ -4771,12 +4786,14 @@ def _test_reply_to_public_post(base_dir: str) -> None:
media_creator = 'Skeletor'
translate = {}
buy_url = ''
video_transcript = ''
reply = \
create_public_post(base_dir, nickname, domain, port, http_prefix,
content, save_to_file,
client_to_server, comments_enabled,
attach_image_filename, media_type,
image_description, city, test_in_reply_to,
image_description, video_transcript,
city, test_in_reply_to,
test_in_reply_to_atom_uri,
test_subject, test_schedule_post,
test_event_date, test_event_time,
@ -5725,13 +5742,14 @@ def _test_links_within_post(base_dir: str) -> None:
media_creator = 'Dr No'
translate = {}
buy_url = ''
video_transcript = ''
post_json_object = \
create_public_post(base_dir, nickname, domain, port, http_prefix,
content, save_to_file,
client_to_server, comments_enabled,
attach_image_filename, media_type,
image_description, city,
image_description, video_transcript, city,
test_in_reply_to, test_in_reply_to_atom_uri,
test_subject, test_schedule_post,
test_event_date, test_event_time,
@ -5776,7 +5794,7 @@ def _test_links_within_post(base_dir: str) -> None:
False,
False, True,
None, None,
False, None,
'', '', None,
test_in_reply_to, test_in_reply_to_atom_uri,
test_subject, test_schedule_post,
test_event_date, test_event_time,
@ -6852,13 +6870,14 @@ def _test_can_replyto(base_dir: str) -> None:
media_creator = 'The Penguin'
translate = {}
buy_url = ''
video_transcript = ''
post_json_object = \
create_public_post(base_dir, nickname, domain, port, http_prefix,
content, save_to_file,
client_to_server, comments_enabled,
attach_image_filename, media_type,
image_description, city,
image_description, video_transcript, city,
test_in_reply_to, test_in_reply_to_atom_uri,
test_subject, test_schedule_post,
test_event_date, test_event_time,

View File

@ -619,5 +619,6 @@
"Media license": "رخصة وسائل الإعلام",
"Media creator": "صانع الوسائط",
"Import Blocks": "استيراد مثيلات محظورة",
"Export Blocks": "تصدير المثيلات المحظورة"
"Export Blocks": "تصدير المثيلات المحظورة",
"Transcript": "نص"
}

View File

@ -619,5 +619,6 @@
"Media license": "মিডিয়া লাইসেন্স",
"Media creator": "মিডিয়া নির্মাতা",
"Import Blocks": "অবরুদ্ধ দৃষ্টান্ত আমদানি করুন",
"Export Blocks": "অবরুদ্ধ দৃষ্টান্ত রপ্তানি করুন"
"Export Blocks": "অবরুদ্ধ দৃষ্টান্ত রপ্তানি করুন",
"Transcript": "প্রতিলিপি"
}

View File

@ -619,5 +619,6 @@
"Media license": "Llicència de mitjans",
"Media creator": "Creador de mitjans",
"Import Blocks": "Importa instàncies bloquejades",
"Export Blocks": "Exporta instàncies bloquejades"
"Export Blocks": "Exporta instàncies bloquejades",
"Transcript": "Transcripció"
}

View File

@ -619,5 +619,6 @@
"Media license": "Trwydded cyfryngau",
"Media creator": "Crëwr cyfryngau",
"Import Blocks": "Mewnforio Achosion wedi'u Rhwystro",
"Export Blocks": "Allforio Achosion wedi'u Rhwystro"
"Export Blocks": "Allforio Achosion wedi'u Rhwystro",
"Transcript": "Trawsgrifiad"
}

View File

@ -619,5 +619,6 @@
"Media license": "Medienlizenz",
"Media creator": "Mediengestalter",
"Import Blocks": "Blockierte Instanzen importieren",
"Export Blocks": "Blockierte Instanzen exportieren"
"Export Blocks": "Blockierte Instanzen exportieren",
"Transcript": "Abschrift"
}

View File

@ -619,5 +619,6 @@
"Media license": "Άδεια ΜΜΕ",
"Media creator": "Δημιουργός πολυμέσων",
"Import Blocks": "Εισαγωγή αποκλεισμένων παρουσιών",
"Export Blocks": "Εξαγωγή αποκλεισμένων παρουσιών"
"Export Blocks": "Εξαγωγή αποκλεισμένων παρουσιών",
"Transcript": "Αντίγραφο"
}

View File

@ -619,5 +619,6 @@
"Media license": "Media license",
"Media creator": "Media creator",
"Import Blocks": "Import Blocks",
"Export Blocks": "Export Blocks"
"Export Blocks": "Export Blocks",
"Transcript": "Transcript"
}

View File

@ -619,5 +619,6 @@
"Media license": "Licencia de medios",
"Media creator": "Creadora de medios",
"Import Blocks": "Importar instancias bloqueadas",
"Export Blocks": "Exportar instancias bloqueadas"
"Export Blocks": "Exportar instancias bloqueadas",
"Transcript": "Transcripción"
}

View File

@ -619,5 +619,6 @@
"Media license": "مجوز رسانه",
"Media creator": "سازنده رسانه",
"Import Blocks": "وارد کردن موارد مسدود شده",
"Export Blocks": "نمونه های مسدود شده را صادر کنید"
"Export Blocks": "نمونه های مسدود شده را صادر کنید",
"Transcript": "رونوشت"
}

View File

@ -619,5 +619,6 @@
"Media license": "Licence média",
"Media creator": "Créateur de médias",
"Import Blocks": "Importer des instances bloquées",
"Export Blocks": "Exporter les instances bloquées"
"Export Blocks": "Exporter les instances bloquées",
"Transcript": "Transcription"
}

View File

@ -619,5 +619,6 @@
"Media license": "Ceadúnas meáin",
"Media creator": "Cruthaitheoir meáin",
"Import Blocks": "Iompórtáil Cásanna Blocáilte",
"Export Blocks": "Easpórtáil Cásanna Blocáilte"
"Export Blocks": "Easpórtáil Cásanna Blocáilte",
"Transcript": "Athscríbhinn"
}

View File

@ -619,5 +619,6 @@
"Media license": "मीडिया लाइसेंस",
"Media creator": "मीडिया निर्माता",
"Import Blocks": "अवरोधित उदाहरण आयात करें",
"Export Blocks": "निर्यात अवरुद्ध उदाहरण"
"Export Blocks": "निर्यात अवरुद्ध उदाहरण",
"Transcript": "प्रतिलिपि"
}

View File

@ -619,5 +619,6 @@
"Media license": "Licenza multimediale",
"Media creator": "Creatore multimediale",
"Import Blocks": "Importa istanze bloccate",
"Export Blocks": "Esporta istanze bloccate"
"Export Blocks": "Esporta istanze bloccate",
"Transcript": "Trascrizione"
}

View File

@ -619,5 +619,6 @@
"Media license": "メディアライセンス",
"Media creator": "メディアクリエーター",
"Import Blocks": "ブロックされたインスタンスのインポート",
"Export Blocks": "ブロックされたインスタンスのエクスポート"
"Export Blocks": "ブロックされたインスタンスのエクスポート",
"Transcript": "成績証明書"
}

View File

@ -619,5 +619,6 @@
"Media license": "미디어 라이센스",
"Media creator": "미디어 크리에이터",
"Import Blocks": "차단된 인스턴스 가져오기",
"Export Blocks": "차단된 인스턴스 내보내기"
"Export Blocks": "차단된 인스턴스 내보내기",
"Transcript": "성적 증명서"
}

View File

@ -619,5 +619,6 @@
"Media license": "Lîsansa medyayê",
"Media creator": "Afirînerê medyayê",
"Import Blocks": "Mînakên Astengkirî Import",
"Export Blocks": "Mînakên Astengkirî Export"
"Export Blocks": "Mînakên Astengkirî Export",
"Transcript": "Transcript"
}

View File

@ -619,5 +619,6 @@
"Media license": "Media licentie",
"Media creator": "Media-maker",
"Import Blocks": "Importeer geblokkeerde instanties",
"Export Blocks": "Exporteer geblokkeerde instanties"
"Export Blocks": "Exporteer geblokkeerde instanties",
"Transcript": "Vertaling"
}

View File

@ -615,5 +615,6 @@
"Media license": "Media license",
"Media creator": "Media creator",
"Import Blocks": "Import Blocks",
"Export Blocks": "Export Blocks"
"Export Blocks": "Export Blocks",
"Transcript": "Transcript"
}

View File

@ -619,5 +619,6 @@
"Media license": "Licencja medialna",
"Media creator": "Kreator mediów",
"Import Blocks": "Importuj zablokowane instancje",
"Export Blocks": "Eksportuj zablokowane instancje"
"Export Blocks": "Eksportuj zablokowane instancje",
"Transcript": "Transkrypcja"
}

View File

@ -619,5 +619,6 @@
"Media license": "Licença de mídia",
"Media creator": "Criador de mídia",
"Import Blocks": "Importar instâncias bloqueadas",
"Export Blocks": "Exportar instâncias bloqueadas"
"Export Blocks": "Exportar instâncias bloqueadas",
"Transcript": "Transcrição"
}

View File

@ -619,5 +619,6 @@
"Media license": "Медиа лицензия",
"Media creator": "Создатель медиа",
"Import Blocks": "Импорт заблокированных экземпляров",
"Export Blocks": "Экспорт заблокированных экземпляров"
"Export Blocks": "Экспорт заблокированных экземпляров",
"Transcript": "Стенограмма"
}

View File

@ -619,5 +619,6 @@
"Media license": "Leseni ya media",
"Media creator": "Muundaji wa media",
"Import Blocks": "Ingiza Matukio Yaliyozuiwa",
"Export Blocks": "Hamisha Matukio Yaliyozuiwa"
"Export Blocks": "Hamisha Matukio Yaliyozuiwa",
"Transcript": "Nakala"
}

View File

@ -619,5 +619,6 @@
"Media license": "Medya lisansı",
"Media creator": "Medya yaratıcısı",
"Import Blocks": "Engellenen Örnekleri İçe Aktar",
"Export Blocks": "Engellenen Örnekleri Dışa Aktar"
"Export Blocks": "Engellenen Örnekleri Dışa Aktar",
"Transcript": "Deşifre metni"
}

View File

@ -619,5 +619,6 @@
"Media license": "Медіа ліцензія",
"Media creator": "Творець медіа",
"Import Blocks": "Імпортувати заблоковані екземпляри",
"Export Blocks": "Експортувати заблоковані екземпляри"
"Export Blocks": "Експортувати заблоковані екземпляри",
"Transcript": "Стенограма"
}

View File

@ -619,5 +619,6 @@
"Media license": "מעדיע דערלויבעניש",
"Media creator": "מעדיע באשעפער",
"Import Blocks": "ימפּאָרט בלאַקט ינסטאַנסיז",
"Export Blocks": "עקספּאָרט בלאַקט ינסטאַנסיז"
"Export Blocks": "עקספּאָרט בלאַקט ינסטאַנסיז",
"Transcript": "טראַנסקריפּט"
}

View File

@ -619,5 +619,6 @@
"Media license": "媒体许可证",
"Media creator": "媒体创作者",
"Import Blocks": "导入被阻止的实例",
"Export Blocks": "导出被阻止的实例"
"Export Blocks": "导出被阻止的实例",
"Transcript": "成绩单"
}

View File

@ -360,6 +360,7 @@ def html_citations(base_dir: str, nickname: str, domain: str,
blog_image_filename: str,
blog_image_attachment_media_type: str,
blog_image_description: str,
blog_video_transcript: str,
theme: str) -> str:
"""Show the citations screen when creating a blog
"""

View File

@ -347,6 +347,7 @@ def html_new_post(edit_post_params: {},
show_public_on_dropdown = True
message_box_height = 400
image_description_height = 150
transcript_height = 1000
# filename of the banner shown at the top
banner_file, _ = \
@ -496,6 +497,13 @@ def html_new_post(edit_post_params: {},
new_post_image_section += \
edit_text_field(media_license_str, 'mediaLicense',
'', 'CC-BY-NC')
new_post_image_section += \
' <label class="labels">' + \
translate['Transcript'] + ' (WebVTT)</label>\n'
new_post_image_section += \
' <textarea id="videoTranscript" name="videoTranscript" ' + \
'style="height:' + str(transcript_height) + \
'px" spellcheck="true" autocomplete="on"></textarea>\n'
new_post_image_section += end_edit_section()
new_post_emoji_section = ''