Project

General

Profile

Actions

Feature #5274

closed

Easier HTTP streaming auth/access

Added by Luis Alves over 6 years ago. Updated almost 6 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Start date:
2017-05-03
Due date:
% Done:

100%

Estimated time:
(Total: 0:00 h)

Description

I used to have my tvh server only available on my local network but recently I have the need (and bandwidth) to watch tv when I'm not at home so I had to "enable" authentication.
Then I bumped into a bunch of issue/limitation because the way http authentication works.

Tvheadend generates a playlist by pointing at: http://<user>:<pass>@<ip>:<port>/playlist
The generated playlist will only work for a certain period of time (while the ticket is valid).
The problem is that almost all players will only read the playlist once meaning that after a while, the ticket is invalid and the playlist useless.
This happens on basically all smart tv iptv players (ott player, ss iptv, ...) and all android apps that take a playlist as input.
So, speaking for myself, the "ticket" method is completely useless...

Here are my suggestions to solve this:

1) When the playlist is requested with plain authentication, it should include the authentication on each item within the playlist (and discard the ticket arg).
Example:
http://<user>:<pass>@<ip>:<port>/playlist
Should return for each item:
#EXTINF <...>
http://<user>:<pass>
@<ip>:<port>/stream/channelid/<id>?<...>

(this one is more of a fix than an enhancement)

2) Authenticate by using extra arguments (discard ticket, include user/pass arguments on playlist):
Example:
http://<ip>:<port>/playlist?username=<user>&password=<pass>
Returns:
#EXTINF <...>
http://<ip>:<port>/stream/channelid/<id>?username=<user>&password=<pass>&<...>

3) Authenticate by url path (similar to what xtream-codes does):
Example (when the request explicitly includes user/pass return a link which includes auth):
http://<ip>:<port>/playlist?username=<user>&password=<pass>
Returns:
#EXTINF <...>
http://<ip>:<port>/stream2/<user>/<pass>/channelid/<id>?<...>

For whoever wants to try, I have done some quick hacks to the code to implemented both 2) and 3) (but can only generate playlist for method 3):
https://github.com/ljalves/tvheadend/commit/f03fc5f5d82c75a8ce677a88226f2369bc3fec87

On this branch, if you request the playlist with "username" and "password", like in "3)" you will get a playlist with /stream2/<user>/<pass>/channelid/...

To test 2) you can play a stream with:
http://<ip>:<port>/stream/channelid/<id>?username=<user>&password=<pass>&<...>


Subtasks 1 (0 open1 closed)

Feature #4352: Ticket expirationFixedJohn Törnblom2017-05-03

Actions
Actions

Also available in: Atom PDF