Exoplayer: OOM when HLS playlist redirects (302) to non m3u resource (MPEG-TS )

Created on 5 Jan 2017  路  3Comments  路  Source: google/ExoPlayer

  • checked with dev-v1, dev-v2
  • demo player
  • there're IPTV services which redirect to MPEG-TS with _302 Moved Temporarily_ to show user "contact help desk" kind of errors
  • "Infinite" m3u parsing (HlsPlaylistParser.parse) with OOM in the end
  • parser pushes garbage to the list (I've got 300k elements with 200Mb+ allocated)
Queue<String> extraLines = new LinkedList<>();
// ...
extraLines.add(line);
$ curl -v http://1ttvauth.top/w/10188/1/sam/<AUTH_TOKEN>/playlist.m3u8
*   Trying 186.2.163.150...
* Connected to 1ttvauth.top (186.2.163.150) port 80 (#0)
> GET /w/10188/1/sam/<AUTH_TOKEN>/playlist.m3u8 HTTP/1.1
> Host: 1ttvauth.top
> User-Agent: curl/7.47.0
> Accept: */*
> 
< HTTP/1.1 302 Moved Temporarily
< Date: Thu, 05 Jan 2017 21:24:09 GMT
< Content-Type: application/octet-stream
< Transfer-Encoding: chunked
< Connection: keep-alive
< Keep-Alive: timeout=60
< Set-Cookie: __ddg_=97228; expires=Fri, 06-Jan-17 21:24:09 GMT; path=/; domain=.1ttvauth.top
< Access-Control-Allow-Origin: *
< Location: http://50.7.134.117/error/ts/error-114.ts
< Server: ddos-guard.net
< 
* Connection #0 to host 1ttvauth.top left intact
  • desktop players like VLC, mplayer - work well
bug

All 3 comments

I doubt we'll be gracefully handling the transition to play the MPEG-TS stream any time soon, but we should figure out the data isn't an HLS playlist and bail out with an error, rather than consuming the stream until we OOM.

Proper Exception (with resolved url?) would be nice.
It will help to switch to proper MediaSource on player level, where source type is identified

It looks like it would be straightforward to include the resolved URL in the exception. The exception type will be some kind of "unexpected content" exception. Note that it wont tell you what the content is, only that it's not an HLS playlist. That should be sufficient though. You can try ExtractorMediaSource with the resolved URL. If you get an UnrecognizedInputFormatException when you try that then something else has happened (e.g. you've probably hit a paywall rather than media content).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RezaMortazavi picture RezaMortazavi  路  3Comments

Tramnguyen108 picture Tramnguyen108  路  3Comments

qeadsw picture qeadsw  路  3Comments

mkaflowski picture mkaflowski  路  3Comments

ojw28 picture ojw28  路  3Comments