diff --git a/src/discordbot/discordbot.py b/src/discordbot/discordbot.py index 71f8882..42b6717 100644 --- a/src/discordbot/discordbot.py +++ b/src/discordbot/discordbot.py @@ -145,14 +145,19 @@ async def query_database(): thumb_url = f'https://{scheduler_hostname}/thumb/{thumb_filename}' # Creating an embed - embed = discord.Embed( - title='Download Example', - description='Click the link below to download the MP4 file.', - color=discord.Color.green() - ) - embed.set_thumbnail(url=thumb_url) - embed.add_field(name='Download MP4', value=f'[Download Video]({video_url})', inline=False) - + embed = discord.Embed(title="Video", + colour=0x00b0f4, + timestamp=datetime.now()) + embed.add_field(name="Download", + value=f"[mp4]({video_url})", + inline=True) + 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 await live_channel.send(embed=embed) else: diff --git a/src/scheduler/scheduler.py b/src/scheduler/scheduler.py index 800f939..33f2cfd 100644 --- a/src/scheduler/scheduler.py +++ b/src/scheduler/scheduler.py @@ -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)) if stream_prio == 2: 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: logger_job.warning(f"Stream start hour is set to {stream_start}") 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.') # Execute recorder -def exec_recorder(stream_id, stream_hls_url): +def exec_recorder(stream_id, stream_name, stream_hls_url): global rechead current_datetime = datetime.now().strftime("%Y%m%d_%H%M%S-%f") video_file = current_datetime + ".mp4" @@ -172,6 +172,7 @@ def exec_recorder(stream_id, stream_hls_url): else: logger_job.warning(f'Recording {video_file} started.') rechead = { 'id': stream_id, + 'name': stream_name, 'video': video_file, 'thumb': thumb_file } video_output = f'{rec_path}/live/{video_file}'