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

OOM when HLS playlist redirects (302) to non m3u resource (MPEG-TS ) #2301

Closed
stari4ek opened this issue Jan 5, 2017 · 3 comments
Closed
Assignees
Labels

Comments

@stari4ek
Copy link

stari4ek commented Jan 5, 2017

  • 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
@ojw28 ojw28 added the bug label Jan 5, 2017
@ojw28
Copy link
Contributor

ojw28 commented Jan 5, 2017

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.

@stari4ek
Copy link
Author

stari4ek commented Jan 5, 2017

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

@ojw28
Copy link
Contributor

ojw28 commented Jan 5, 2017

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).

ojw28 pushed a commit that referenced this issue Jan 13, 2017
Issue:#2301

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=144334062
@ojw28 ojw28 closed this as completed Jan 13, 2017
@google google locked and limited conversation to collaborators Jun 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants