Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use videoFileToken for fragments for private videos. #5617

Closed
Firiks opened this issue Feb 17, 2023 · 4 comments · Fixed by #5677
Closed

Cannot use videoFileToken for fragments for private videos. #5617

Firiks opened this issue Feb 17, 2023 · 4 comments · Fixed by #5677
Assignees
Labels
Component: Player ⏯️ Status: In Progress 🔜 Type: Bug 🐛 Confirmed bug, at least replicated once by another contributor

Comments

@Firiks
Copy link

Firiks commented Feb 17, 2023

Describe the current behavior

When I have private video and get master.m3u8 of private video I can get contents of it using videoFileToken token, then on 720.m3u8 there are no longer tokens which means I cannot play the video. reinjectVideoFileToken will not add file token to fragments.

#EXTM3U
#EXT-X-VERSION:7
#EXT-X-TARGETDURATION:5
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-MAP:URI="2dae54e6-3faa-4dd2-af11-c97289da7deb-720-fragmented.mp4",BYTERANGE="1330@0"
#EXTINF:4.160000,
#EXT-X-BYTERANGE:1607575@1330
2dae54e6-3faa-4dd2-af11-c97289da7deb-720-fragmented.mp4
#EXTINF:3.920000,
#EXT-X-BYTERANGE:1281735@1608905
2dae54e6-3faa-4dd2-af11-c97289da7deb-720-fragmented.mp4
#EXTINF:4.040000,
#EXT-X-BYTERANGE:1309563@2890640
2dae54e6-3faa-4dd2-af11-c97289da7deb-720-fragmented.mp4
#EXTINF:5.360000,
#EXT-X-BYTERANGE:1750274@4200203
2dae54e6-3faa-4dd2-af11-c97289da7deb-720-fragmented.mp4
#EXTINF:3.040000,
#EXT-X-BYTERANGE:992782@5950477
2dae54e6-3faa-4dd2-af11-c97289da7deb-720-fragmented.mp4
#EXTINF:3.720000,
#EXT-X-BYTERANGE:1222683@6943259
2dae54e6-3faa-4dd2-af11-c97289da7deb-720-fragmented.mp4
#EXTINF:3.840000,
#EXT-X-BYTERANGE:1250988@8165942
2dae54e6-3faa-4dd2-af11-c97289da7deb-720-fragmented.mp4
#EXTINF:4.880000,
#EXT-X-BYTERANGE:1600616@9416930
2dae54e6-3faa-4dd2-af11-c97289da7deb-720-fragmented.mp4
#EXTINF:3.120000,
#EXT-X-BYTERANGE:1014247@11017546
2dae54e6-3faa-4dd2-af11-c97289da7deb-720-fragmented.mp4
#EXTINF:4.000000,
#EXT-X-BYTERANGE:1311471@12031793
2dae54e6-3faa-4dd2-af11-c97289da7deb-720-fragmented.mp4
#EXTINF:4.120000,
#EXT-X-BYTERANGE:1351676@13343264
2dae54e6-3faa-4dd2-af11-c97289da7deb-720-fragmented.mp4
#EXTINF:0.280000,
#EXT-X-BYTERANGE:54255@14694940
2dae54e6-3faa-4dd2-af11-c97289da7deb-720-fragmented.mp4
#EXT-X-ENDLIST

Steps to reproduce

Get private video using REST api, then get streaming url from response that is in ['streamingPlaylists'][0]['playlistUrl'], after getting file token add it as query arg and then add also reinjectVideoFileToken query arg.

Describe the expected behavior

reinjectVideoFileToken should add videoFileToken to fragments

Additional information

  • PeerTube instance:
    • Version: 5.0.1
@wickloww wickloww added Type: Bug 🐛 Confirmed bug, at least replicated once by another contributor Component: Player ⏯️ Status: In Progress 🔜 labels Mar 6, 2023
@wickloww wickloww self-assigned this Mar 6, 2023
@Chocobozzz
Copy link
Owner

Fixed in #5677

@Firiks
Copy link
Author

Firiks commented Mar 7, 2023

Hi I can confirm that when reinjectVideoFileToken=true is present then fragments will have tokens. The problem is when master.m3u8 contains qualities like this:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=2681672,RESOLUTION=1280x720,FRAME-RATE=25,CODECS="avc1.64001f,mp4a.40.2"
2dae54e6-3faa-4dd2-af11-c97289da7deb-720.m3u8?videoFileToken=97926858-e6f2-4305-9607-b4a0949fc2f0

then fragments in 720.m3u8 will no longer contain videoFileToken

#EXTM3U
#EXT-X-VERSION:7
#EXT-X-TARGETDURATION:5
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-MAP:URI="2dae54e6-3faa-4dd2-af11-c97289da7deb-720-fragmented.mp4",BYTERANGE="1330@0"
#EXTINF:4.160000,
#EXT-X-BYTERANGE:1607575@1330
2dae54e6-3faa-4dd2-af11-c97289da7deb-720-fragmented.mp4
#EXTINF:3.920000,
#EXT-X-BYTERANGE:1281735@1608905
2dae54e6-3faa-4dd2-af11-c97289da7deb-720-fragmented.mp4
#EXTINF:4.040000,
#EXT-X-BYTERANGE:1309563@2890640
2dae54e6-3faa-4dd2-af11-c97289da7deb-720-fragmented.mp4
#EXTINF:5.360000,
#EXT-X-BYTERANGE:1750274@4200203
2dae54e6-3faa-4dd2-af11-c97289da7deb-720-fragmented.mp4
#EXTINF:3.040000,
#EXT-X-BYTERANGE:992782@5950477
2dae54e6-3faa-4dd2-af11-c97289da7deb-720-fragmented.mp4
#EXTINF:3.720000,
#EXT-X-BYTERANGE:1222683@6943259
2dae54e6-3faa-4dd2-af11-c97289da7deb-720-fragmented.mp4
#EXTINF:3.840000,
#EXT-X-BYTERANGE:1250988@8165942
2dae54e6-3faa-4dd2-af11-c97289da7deb-720-fragmented.mp4
#EXTINF:4.880000,
#EXT-X-BYTERANGE:1600616@9416930
2dae54e6-3faa-4dd2-af11-c97289da7deb-720-fragmented.mp4
#EXTINF:3.120000,
#EXT-X-BYTERANGE:1014247@11017546
2dae54e6-3faa-4dd2-af11-c97289da7deb-720-fragmented.mp4
#EXTINF:4.000000,
#EXT-X-BYTERANGE:1311471@12031793
2dae54e6-3faa-4dd2-af11-c97289da7deb-720-fragmented.mp4
#EXTINF:4.120000,
#EXT-X-BYTERANGE:1351676@13343264
2dae54e6-3faa-4dd2-af11-c97289da7deb-720-fragmented.mp4
#EXTINF:0.280000,
#EXT-X-BYTERANGE:54255@14694940
2dae54e6-3faa-4dd2-af11-c97289da7deb-720-fragmented.mp4
#EXT-X-ENDLIST

Can reinjectVideoFileToken be kept for qualities ?

@wickloww
Copy link
Collaborator

wickloww commented Mar 8, 2023

Hi, thank you for your feedback.
Have you updated your instance? Especially with this commit 73fb3dc?
I personally get this response when I set reinjectVideoFileToken to true:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=2400331,RESOLUTION=1280x720,FRAME-RATE=24,CODECS="avc1.64001f,mp4a.40.2"
07c58c8e-87cb-4f7d-9f00-de83140cb8f2-720.m3u8?videoFileToken=3c7fe980-fa14-4d3c-b268-d328276a0684&reinjectVideoFileToken=true

@Firiks
Copy link
Author

Firiks commented Mar 10, 2023

Hi, thanks the issue is now resolved. I updated to latest image and fragments now have tokens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Player ⏯️ Status: In Progress 🔜 Type: Bug 🐛 Confirmed bug, at least replicated once by another contributor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants