Project

General

Profile

Bug #5575

HTTP User Agent self reset value after update.

Added by saen acro about 1 year ago. Updated 2 months ago.

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

0%

Estimated time:
Found in version:
any
Affected Versions:

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 about 1 year 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 12 months 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 12 months 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 4 months 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 3 months 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 3 months 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 3 months 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. 3 months ago

Does tvheadend have permissions on tvheadend directory?

#9

Updated by Unai Goikoetxeta 3 months 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 3 months 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 2 months 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 2 months ago

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

#13

Updated by Jaroslav Kysela 2 months 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.

Also available in: Atom PDF