Skip to content

share/{token} endpoint returns folder path instead of master.m3u8 for video stream URLs #45

@gimphub-tech

Description

@gimphub-tech

Describe the bug

When accessing a video asset via a share link, the stream_url returned by the API points to the S3 folder prefix instead of the HLS master playlist file.
Expected:
https://s3.../processed/.../master.m3u8
Actual:
https://s3.../processed/... (folder, no master.m3u8)

<video src="https://sos-ch-dk-2.exo.io/freeframe-vps/processed/.../[VERSION_ID]?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=[REDACTED]..." ...>

Root cause:
In apps/api/routers/share.py around line 297, the stream_url for the share asset overview endpoint uses:

stream_url = generate_presigned_get_url(media_file.s3_key_processed)

For videos, s3_key_processed is the HLS folder prefix. The /master.m3u8 suffix is missing.

The fix already exists in get_share_stream_url (line ~1375) and in assets.py. The same pattern should be applied here:

if asset.asset_type.value == "video":
    s3_key = f"{media_file.s3_key_processed}/master.m3u8"
else:
    s3_key = media_file.s3_key_processed
stream_url = generate_presigned_get_url(s3_key)

Steps to reproduce

  1. Upload a video asset
  2. Create a public share link
  3. Open the share link
  4. Inspect the

Expected behavior

The share link video player uses the HLS master playlist URL ending in /master.m3u8, so the video streams correctly via HLS adaptive bitrate.

Screenshots

Image

Area

Backend (FastAPI)

Version / Commit

latest main

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions