add stream_name to rechead
This commit is contained in:
parent
aed95d6577
commit
5b646f6815
2 changed files with 16 additions and 10 deletions
|
@ -145,14 +145,19 @@ async def query_database():
|
||||||
thumb_url = f'https://{scheduler_hostname}/thumb/{thumb_filename}'
|
thumb_url = f'https://{scheduler_hostname}/thumb/{thumb_filename}'
|
||||||
|
|
||||||
# Creating an embed
|
# Creating an embed
|
||||||
embed = discord.Embed(
|
embed = discord.Embed(title="Video",
|
||||||
title='Download Example',
|
colour=0x00b0f4,
|
||||||
description='Click the link below to download the MP4 file.',
|
timestamp=datetime.now())
|
||||||
color=discord.Color.green()
|
embed.add_field(name="Download",
|
||||||
)
|
value=f"[mp4]({video_url})",
|
||||||
embed.set_thumbnail(url=thumb_url)
|
inline=True)
|
||||||
embed.add_field(name='Download MP4', value=f'[Download Video]({video_url})', inline=False)
|
embed.add_field(name="Watch",
|
||||||
|
value="[plyr.js](https://deflax.net)",
|
||||||
|
inline=True)
|
||||||
|
embed.set_image(url=thumb_url)
|
||||||
|
embed.set_thumbnail(url="https://deflax.net/img/logo-96.png")
|
||||||
|
embed.set_footer(text="DeflaxTV",
|
||||||
|
icon_url="https://deflax.net/img/logo-96.png")
|
||||||
# Sending the embed to the channel
|
# Sending the embed to the channel
|
||||||
await live_channel.send(embed=embed)
|
await live_channel.send(embed=embed)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -79,7 +79,7 @@ def process_running_channel(database, scheduler, stream_id, stream_name, stream_
|
||||||
scheduler.add_job(func=exec_stream, id=stream_id, args=(stream_id, stream_name, stream_prio, stream_hls_url))
|
scheduler.add_job(func=exec_stream, id=stream_id, args=(stream_id, stream_name, stream_prio, stream_hls_url))
|
||||||
if stream_prio == 2:
|
if stream_prio == 2:
|
||||||
rec_id = f'rec_{stream_id}'
|
rec_id = f'rec_{stream_id}'
|
||||||
scheduler.add_job(func=exec_recorder, id=rec_id, args=(stream_id, stream_hls_url))
|
scheduler.add_job(func=exec_recorder, id=rec_id, args=(stream_id, stream_name, stream_hls_url))
|
||||||
else:
|
else:
|
||||||
logger_job.warning(f"Stream start hour is set to {stream_start}")
|
logger_job.warning(f"Stream start hour is set to {stream_start}")
|
||||||
scheduler.add_job(
|
scheduler.add_job(
|
||||||
|
@ -162,7 +162,7 @@ def exec_stream(stream_id, stream_name, stream_prio, stream_hls_url):
|
||||||
logger_job.warning(f'Source with higher priority ({prio}) is blocking. Skipping playhead update.')
|
logger_job.warning(f'Source with higher priority ({prio}) is blocking. Skipping playhead update.')
|
||||||
|
|
||||||
# Execute recorder
|
# Execute recorder
|
||||||
def exec_recorder(stream_id, stream_hls_url):
|
def exec_recorder(stream_id, stream_name, stream_hls_url):
|
||||||
global rechead
|
global rechead
|
||||||
current_datetime = datetime.now().strftime("%Y%m%d_%H%M%S-%f")
|
current_datetime = datetime.now().strftime("%Y%m%d_%H%M%S-%f")
|
||||||
video_file = current_datetime + ".mp4"
|
video_file = current_datetime + ".mp4"
|
||||||
|
@ -172,6 +172,7 @@ def exec_recorder(stream_id, stream_hls_url):
|
||||||
else:
|
else:
|
||||||
logger_job.warning(f'Recording {video_file} started.')
|
logger_job.warning(f'Recording {video_file} started.')
|
||||||
rechead = { 'id': stream_id,
|
rechead = { 'id': stream_id,
|
||||||
|
'name': stream_name,
|
||||||
'video': video_file,
|
'video': video_file,
|
||||||
'thumb': thumb_file }
|
'thumb': thumb_file }
|
||||||
video_output = f'{rec_path}/live/{video_file}'
|
video_output = f'{rec_path}/live/{video_file}'
|
||||||
|
|
Loading…
Reference in a new issue