Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
Bug Change Header in url works for Curl but not ffmeg (User-Agent)
#1
Hi, I m trying to read a m3u file that need a special UA. So I 'm passing this url to the player.
Code:
www.site.com/file.m3u|User-Agent=Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us

And It works for the first part, but inside this file there is fragments, and for this one kodi use the header
Code:
10:11:20.109 T:1480   DEBUG: ffmpeg[5C8]: [http] User-Agent: Lavf/57.41.100

There is a way to change this header too ?

Code:
10:11:19.860 T:1480   DEBUG: Curl::Debug - HEADER_OUT: GET /url/file.m3u HTTP/1.1
10:11:19.860 T:1480   DEBUG: Curl::Debug - HEADER_OUT: Range: bytes=0-
10:11:19.860 T:1480   DEBUG: Curl::Debug - HEADER_OUT: User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0
10:11:19.860 T:1480   DEBUG: Curl::Debug - HEADER_OUT: Accept: */*
10:11:19.860 T:1480   DEBUG: Curl::Debug - HEADER_OUT: Accept-Charset: UTF-8,*;q=0.8
10:11:19.913 T:1480   DEBUG: Curl::Debug - HEADER_IN: HTTP/1.1 200 OK

10:11:20.020 T:1480   NOTICE: Creating Demuxer
10:11:20.020 T:1480   DEBUG: ffmpeg[5C8]: Probing hls,applehttp score:100 size:2048
10:11:20.020 T:1480   DEBUG: CDVDDemuxFFmpeg::Open - probing detected format [hls,applehttp]
10:11:20.024 T:1480   DEBUG: ffmpeg[5C8]: [hls,applehttp] HLS request for url '/url/file.mp4Frag1Num0', offset 0, playlist 0
10:11:20.109 T:1480   DEBUG: ffmpeg[5C8]: [http] request: GET /url/file.mp4Frag1Num0 HTTP/1.1
10:11:20.109 T:1480   DEBUG: ffmpeg[5C8]: [http] User-Agent: Lavf/57.41.100
10:11:20.109 T:1480   DEBUG: ffmpeg[5C8]: [http] Accept: */*
10:11:20.109 T:1480   DEBUG: ffmpeg[5C8]: [http] Connection: close
10:11:20.109 T:1480   DEBUG: ffmpeg[5C8]: [http] Icy-MetaData: 1

After some research, I have see this a problem with ffmeg and some strange url, but I don't see what I m doing wrong. I have also tried with encoded url.
I m using Win 7 with V17 RC1, but I think it's same on other system.


Edit:
I have tried for other m3u8, and it works but with more debugs lines.
Code:
16:14:13.239 T:1684  NOTICE: Creating Demuxer
16:14:13.239 T:1684   DEBUG: CDVDDemuxFFmpeg::GetFFMpegOptionsFromInput() adding ffmpeg option 'user-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0'
16:14:13.363 T:1684   DEBUG: ffmpeg[694]: [tls] Received incomplete handshake, need more data
16:14:13.429 T:1684   DEBUG: ffmpeg[694]: [https] request: GET /content/sintel/hls/playlist.m3u8 HTTP/1.1
16:14:13.429 T:1684   DEBUG: ffmpeg[694]: [https] User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0

I have take a look in the DVDDemuxFFmpeg.cpp file.
Code:
bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput, bool streaminfo, bool fileinfo)
{
......
  if (m_pInput->IsStreamType(DVDSTREAM_TYPE_FFMPEG))
  {
    // special stream type that makes avformat handle file opening
    // allows internal ffmpeg protocols to be used
    AVDictionary *options = GetFFMpegOptionsFromInput();
...
}
else {

}

In fact the user agent can be modified only in this case, Why Huh
Can I edit the fisrt file to make something ?

And for information, there is some years you can add the user-agent in the m3u file
http://forum.kodi.tv/showthread.php?tid=210429

But now, this also is impossible.
Reply
#2
7 Days after, still no reactions ?
I have tried too with a ticket, there is only 2 line of code to change.

No one have alternative ? I have tried to make a fake m3u local with the good url inside, but ofc not possible to use User-Agent locally.
An idea to have an answer ?

For the moment the only working way I have found is edit a file with an hexadecimal editor.
Reply
#3
"Funny" that this is still not fixed in 18.4 Leia..
Reply
#4
(2019-11-15, 17:46)cache-sk Wrote: "Funny" that this is still not fixed in 18.4 Leia..

And if you want to laugh, you can search  the issue on their github. I have submited a working patch, but refused because it's not like that the core need to work.
The actual version have bugged iptv, https://forum.kodi.tv/showthread.php?tid=328245&page=2 but it's not something used by the community.
I have too Tearing effect, but it s due to my hardware that haven't changed.

I m sure they are working on more usefull feature ....
Reply

Logout Mark Read Team Forum Stats Members Help
Change Header in url works for Curl but not ffmeg (User-Agent)0