Project

General

Profile

Feature #5575

Option to not override settings from m3u

Added by saen acro over 5 years ago. Updated over 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Configuration
Target version:
-
Start date:
2019-03-14
Due date:
% Done:

0%

Estimated time:

Description

HTTP User Agent feature reset its value after any update of TVH
In rest of time after restart etc stay as is set until update.

History

#1

Updated by Flole Systems over 5 years ago

Also in the Web Interface? I do not see that issue here, I can update and restart without losing the setting.

#2

Updated by Alex Foo over 5 years ago

I have the same issue here. 'Custom HTTP headers' field in muxes settings cleared after restart. :(
Did some research and looks like these settings saved ok into files like storage/.config/tvheadend/input/iptv/networks/[...]/muxes/[...] but after restart its ignored for some reason...

#3

Updated by Alex Foo over 5 years ago

I have the same issue here. 'Custom HTTP headers' field in muxes settings cleared after restart. :(
Did some research and looks like these settings saved ok into files like /tvheadend/input/iptv/networks/[...]/muxes/[...] but after restart its ignored for some reason...

#4

Updated by Christian Lipp almost 5 years ago

I have the same issue - after restarting server the custom headers are empty. Since my IPTV blocks requests from TVH it ist a real problem for me (scheduled recordings etc.)
It would be nice if someone can check and fix this bug.

#5

Updated by Unai Goikoetxeta almost 5 years ago

Hello,

I am experiencing the same issue on Ubuntu 18.04.03 LTS and was able to reproduce the problem in both the official stable repository and mamarley's stable PPA repository.

These are the two TVheadend versions I have seen the problem with:

  • HTS Tvheadend 4.2.8-36~g5bdcfd8ac
  • HTS Tvheadend 4.2.9~pre+201911151752-0~built201911152017~git5bdcfd8~ubuntu18.04.1

These are the steps taken to reproduce the problem:

1. Go to Configuration -> DVB Inputs -> Muxes
2. Select a group of Muxes from an IPTV network originally added using the "IPTV Automatic Network" option
3. Click Edit in the top menu
4. Select "Custom HTTP headers"
5. Enter the following header and save:
User-Agent: VLC/3.0.9 LibVLC/3.0.9

After I follow the steps above, the custom HTTP header works right away. However, if the tvheadend service is restarted or if i wait some time, the value of the custom HTTP header goes away and I am forced to add it again...

This looks like a bug to me. Any help or direction will be greatly appreciated.

Thank you!

#6

Updated by Flole Systems almost 5 years ago

First you should considering updating to latest master. I do not have the issue with that one. Even if there is a fix it won't be backported to 4.2 anyways, so updating is necessary anyways.

#7

Updated by Unai Goikoetxeta almost 5 years ago

Thank you for your reply. I have updated to the unstable branch of the repo (TVHeadend/4.3-1857~g221c29b40) and I still see the same behavior... Are you sure that you don't have the same issue following the steps explained on post #5?

As a workaround, I can now set the "HTTP User Agent:" under general settings to change it for all IPTV connections made from TVHeadend.

#8

Updated by Pablo R. almost 5 years ago

Does tvheadend have permissions on tvheadend directory?

#9

Updated by Unai Goikoetxeta almost 5 years ago

Hi Pablo,

The tvheadend binary is being ran by the hts user, and the hts user owns all the files inside /home/hts. In fact, it seems that all the directories within have a mask of 700 and the files of 600, including the files where the custom header settings are supposed to be stored located at:

/home/hts/.hts/tvheadend/input/iptv/networks/e383fa5e8d3db0122f145391b6fe2fb7/muxes

Additionally, I have compiled the sources myself, and can confirm that the problem is still happening in the master branch of the code (4.3-1857~g221c29b40).

I strongly believe that a bug is causing this behavior.

Thank you.

#10

Updated by Flole Systems almost 5 years ago

It seems according to the code like it's wanted behaviour: Whenever the m3u is imported the m3u-http-headers field is parsed, if it is not contained there is an empty string being put into the field.

Possible fix (this will still overwrite any existing headers though whenever there are headers set in the m3u file):
Change src/input/mpegts/iptv/iptv_auto.c:252 to

      if (strcmp(im->mm_iptv_hdr ?: "", custom) && strcmp(custom, "")) {

If it works please let me know so we can get this merged.

#11

Updated by Unai Goikoetxeta almost 5 years ago

Hello Flole Systems,

The suggested modification of the source code works as expected. The code inside the if is not ran anymore because the custom value is not empty, keeping the custom header value intact after restarting the service.

Thank you!!

#12

Updated by Flole Systems almost 5 years ago

PR is created, once it's merged we can close this.

#13

Updated by Jaroslav Kysela almost 5 years ago

The rule for the automatic network is to overwrite all settings from m3u (except url which is the key) for mux. If something is missing in your imported m3u, you should fetch m3u and modify it before it's imported to tvh. The HTTP header settings is just one of parameters which can be configured through m3u. Examples: #3219.

With this proposed change, we cannot remove the HTTP headers using the automatic m3u import.

Eventually, it would be probably more nice to have a check list with fields which can be changed by the m3u import (or we can start just with this one boolean: 'Do not import HTTP headers') if the user want to force this behaviour.

#14

Updated by Flole Systems over 4 years ago

  • Tracker changed from Bug to Feature
  • Subject changed from HTTP User Agent self reset value after update. to Option to not override settings from m3u
  • Found in version deleted (any)

As Jaroslav said, this is the intended behavior. Making this a feature request instead.

#15

Updated by Unai Goikoetxeta over 4 years ago

I have just read Jaroslav's reply and I have a quick question about setting the HTTP Header on the m3u.

I was unable to identify a clear example on #3219, but I was able to identify two possible ways searching the Internet:

Option 1:

#EXTINF:0,Channel
http://url_to_media|User-agent=VLC/3.0.9 LibVLC/3.0.9

Option 2:

#EXTINF:0,Channel
#EXTVLCOPT:http-user-agent=VLC/3.0.9 LibVLC/3.0.9
http://url_to_media

I think that option 1 might be the right way of doing it as #EXTVLCOPT might be an VLC option.

Can you confirm this?

Thank you!

#16

Updated by Unai Goikoetxeta over 4 years ago

I am going to answer to myself. After testing it, i can confirm that option #1 works :)

Also available in: Atom PDF