Skip to content
This repository has been archived by the owner on Feb 10, 2023. It is now read-only.

[BUG] F1 TV Backend Change breaks playback #186

Closed
DanseMacabre opened this issue Aug 26, 2021 · 6 comments
Closed

[BUG] F1 TV Backend Change breaks playback #186

DanseMacabre opened this issue Aug 26, 2021 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@DanseMacabre
Copy link

Describe the bug
Currently, playback with mpv are all broken due to this backend change. Before for retrieving the master playlist and all the media segments from the media playlists from the master playlist was as simple as doing a GET request to the segment/playlist. However, now it seems like F1TV wants to use cookie "playToken" to authenticate GET requests to content server. Most video clients (ffmpeg, mpv) doesn't seem to be able to set and send the cookie correctly. As a result, all content fail to load via the above mentioned players. VLC Media Player however is able to load the content without issue it seems like.

To Reproduce
Steps to reproduce the behavior:
Open any video stream with MPV.

Expected behaviour
Video Plays

F1TV account plan
Pro/Proxy, however this is irrelevant, see robvdpol/RaceControl#210

Desktop (please complete the following information):
-win10
-chocolatey

Logs
See: robvdpol/RaceControl#210

Notes
Some description copied from the related bug, and therefore might be incorrect!

@DanseMacabre DanseMacabre added the bug Something isn't working label Aug 26, 2021
@NadimAsad
Copy link

I think this is an unfixable issue for f1viewer. Changes to make MPV work with F1TV streams need to be done on the MPV client, not f1viewer.

@DanseMacabre
Copy link
Author

Looking at the configuration/options for mpv, there are cookie options that allow setting cookies to be used. So likely this is possibly fixable at this level.

@NadimAsad
Copy link

NadimAsad commented Aug 27, 2021

@DanseMacabre Thanks for pointing me in the right direction! I can confirm this to be true. Using --cookies as additional parameter for MPV will fix MPV playback.

Link to relevant MPV documentation: https://mpv.io/manual/master/#network

This doesn't work, my apologies.

Check robvdpol/RaceControl#210 (comment) for why it works now,

@SoMuchForSubtlety
Copy link
Owner

SoMuchForSubtlety commented Aug 27, 2021

Thanks for the report, I just noticed the same issue.

ffmpeg (what mpv uses for streams) picks up on the cookie, but only uses it for the first request and then drops it.

this is the output of ffprobe -loglevel trace url_from_f1viewer

https @ 0x557ff931a8c0] request: GET /out/v1/fea30aa35ecd4c7abc06b4c7f8b4c980/index.m3u8?kid=1042&exp=1630168253&ttl=1440&token=abc&start=2021-08-27T15:45:17+00:00 HTTP/1.1
User-Agent: Lavf/58.76.100
Accept: */*
Range: bytes=0-
Connection: close
Host: ott-video-cf.formula1.com
Icy-MetaData: 1


[https @ 0x557ff931a8c0] header='HTTP/1.1 206 Partial Content'
[https @ 0x557ff931a8c0] http_code=206
[https @ 0x557ff931a8c0] header='Content-Type: application/x-mpegURL'
...
[https @ 0x557ff931a8c0] header='Set-Cookie: playToken=xyz'
...
Probing hls score:100 size:2048
[hls @ 0x557ff9319c40] Format hls probed with size=2048 and score=100
[hls @ 0x557ff9319c40] Skip ('#EXT-X-VERSION:4')
[hls @ 0x557ff9319c40] Skip ('#EXT-X-INDEPENDENT-SEGMENTS')
[hls @ 0x557ff9319c40] Skip ('#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=128000,CODECS="avc1.4D401E",RESOLUTION=480x270,URI="index_7.m3u8?start=2021-08-27T15:45:17+00:00"')
[hls @ 0x557ff9319c40] Can't support the subtitle(uri: index_15_0.m3u8?start=2021-08-27T15:45:17+00:00)
[hls @ 0x557ff9319c40] Can't support the subtitle(uri: index_16_0.m3u8?start=2021-08-27T15:45:17+00:00)
[hls @ 0x557ff9319c40] Can't support the subtitle(uri: index_17_0.m3u8?start=2021-08-27T15:45:17+00:00)
[hls @ 0x557ff9319c40] Opening 'https://ott-video-cf.formula1.com/out/v1/fea30aa35ecd4c7abc06b4c7f8b4c980/index_1.m3u8?start=2021-08-27T15:45:17+00:00' for reading
[tcp @ 0x557ff98dd380] Original list of addresses:
[tcp @ 0x557ff98dd380] Address 52.84.109.15 port 443
...
[tcp @ 0x557ff98dd380] Successfully connected to 52.84.109.15 port 443
[https @ 0x557ff98e5340] request: GET /out/v1/fea30aa35ecd4c7abc06b4c7f8b4c980/index_1.m3u8?start=2021-08-27T15:45:17+00:00 HTTP/1.1
User-Agent: Lavf/58.76.100
Accept: */*
Range: bytes=0-
Connection: keep-alive
Host: ott-video-cf.formula1.com
#### correctly uses the cookie ####
Cookie: playToken=xyz 
Icy-MetaData: 1


[https @ 0x557ff98e5340] header='HTTP/1.1 206 Partial Content'
[https @ 0x557ff98e5340] http_code=206
[https @ 0x557ff98e5340] header='Content-Type: application/x-mpegURL'
...
[hls @ 0x557ff9319c40] Skip ('#EXT-X-VERSION:4')
[hls @ 0x557ff9319c40] Skip ('#EXT-X-DISCONTINUITY-SEQUENCE:14')
[hls @ 0x557ff9319c40] Skip ('#EXT-X-PROGRAM-DATE-TIME:2021-08-27T15:45:11.677Z')
[hls @ 0x557ff9319c40] Skip ('#EXT-X-PROGRAM-DATE-TIME:2021-08-27T15:55:11.677Z')
[hls @ 0x557ff9319c40] Skip ('#EXT-X-PROGRAM-DATE-TIME:2021-08-27T16:05:11.677Z')
[hls @ 0x557ff9319c40] Skip ('#EXT-X-PROGRAM-DATE-TIME:2021-08-27T16:15:11.677Z')
[hls @ 0x557ff9319c40] Skip ('#EXT-X-PROGRAM-DATE-TIME:2021-08-27T16:25:11.677Z')
[https @ 0x557ff98bc500] Opening 'https://ott-video-cf.formula1.com/out/v1/fea30aa35ecd4c7abc06b4c7f8b4c980/index_2.m3u8?start=2021-08-27T15:45:17+00:00' for reading
[https @ 0x557ff98e5340] request: GET /out/v1/fea30aa35ecd4c7abc06b4c7f8b4c980/index_2.m3u8?start=2021-08-27T15:45:17+00:00 HTTP/1.1
#### doesn't use the cookie for the next request ####
User-Agent: Lavf/58.76.100
Accept: */*
Range: bytes=0-
Connection: keep-alive
Host: ott-video-cf.formula1.com
Icy-MetaData: 1



[https @ 0x557ff98e5340] header='HTTP/1.1 400 BadRequest'
[https @ 0x557ff98e5340] http_code=400
[https @ 0x557ff98e5340] HTTP error 400 BadRequest

I filed a bug with ffmpeg, let's see what they say.

VLC can still be used, and other players probably work too.

@SoMuchForSubtlety
Copy link
Owner

I added support for proxying requests as a temporary workaround. ddef349

There will be a release before the weekend.

@SoMuchForSubtlety
Copy link
Owner

new release is out https://github.com/SoMuchForSubtlety/f1viewer/releases/tag/v2.3.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants