0

I'm setting up a streaming server running Ubuntu 16.04 for personal use, using TVHeadend as a PVR backend for Kodi. TVheadend needs a so-called "XMLTV" file to provide EPG functionality, and this file needs to be updated (downloaded from the TV provider) twice a day.

My TV provider sent me a URL like this to download the file:
http://srv:port/xmltv.php?username=xxxx&password=yyyyyyy

The problem is, even sending user and password in the URL, wget still gets the 401 (Unauthorized) error from the server.

I've already tried sending user and password as arguments on the wget command line (wget --user username --password PASS), but to no avail.

I need to fix this so I can create a Cron Job to automatically update the EPG every 12 hours.

  • 1
    Does it work if you go to the site with a browser? – Organic Marble Apr 26 '18 at 4:12
  • Did you quote username and password properly? I'd use single quotes: wget --user 'USERNAME' --password 'PASSWORD' http://SERVER:PORT/xmltv.php – dessert Apr 26 '18 at 6:45
  • 1
    @OrganicMarble yes, opening the URL in a browser gives me the expected result, a beautiful ready-to-use XMLTV.XML file. – Alex Silva Apr 26 '18 at 11:21
  • @dessert I did this, but it did not work, Wget says "unknown authentication scheme". – Alex Silva Apr 26 '18 at 11:30
  • 1
    @PatrickMevzek I managed to solve this challenge, just removed the String username and password from the URL and put as arguments to wget, like this: "wget --post-data 'username=XXXX&password=yyyyyyyy' srv:port/xmltv.php". I was using the basic HTTP authentication instead of the post method and this was the source of the problem, now everything works like a charm! – Alex Silva Apr 27 '18 at 12:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.