Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
Is it possible to change default header (User-Agent) without recompiling Kodi?
#1
I have a URL of a remote playlist that I want to use in Kodi. This playlist updates almost everyday and I don't have control over it. Video URLs in this playlists requires common browser User-Agent i.e. Kodi's default like "Kodi/19.0-ALPHA1 (X11; Linux x86_64) ..." results in 403 Forbidden error.

If I had control over the playlist, I could append |User-Agent=... to every media item, but I don't. And I can't simply fork the playlist because of the frequent updates, URLs would expire quickly.

I guess the only easy way to solve this would be by changing Kodi's default User-Agent. Is it possible?
Reply
#2
Do you use these playlists in IPTV Simple? as that has a user agent setting in the advanced tab of the addon settings. Not something I've ever used so if you've any questions on usage ask in https://forum.kodi.tv/forumdisplay.php?fid=215
Reply
#3
I'm using Playlist Loader because I need to use multiple playlists and IPTV Simple supports only one.

IPTV Simple uses C++ to set User-Agent, I don't want to compile anything (actually I don't know how to do it).

But I found a way. Forked Playlist Loader adding the following code:
python:

if not url.startswith('plugin') and not re.search('(&|\|)user-agent=', url, re.IGNORECASE):
    if re.search('\|', url):
        url += '&User-Agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0'
    else:
        url += '|User-Agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/94.0'
Reply

Logout Mark Read Team Forum Stats Members Help
Is it possible to change default header (User-Agent) without recompiling Kodi?0