Wget: How to download files from a server that requires authentication?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












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.







share|improve this question


















  • 1




    Does it work if you go to the site with a browser?
    – Organic Marble
    Apr 26 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 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 at 11:21










  • @dessert I did this, but it did not work, Wget says "unknown authentication scheme".
    – Alex Silva
    Apr 26 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 at 12:19














up vote
0
down vote

favorite












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.







share|improve this question


















  • 1




    Does it work if you go to the site with a browser?
    – Organic Marble
    Apr 26 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 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 at 11:21










  • @dessert I did this, but it did not work, Wget says "unknown authentication scheme".
    – Alex Silva
    Apr 26 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 at 12:19












up vote
0
down vote

favorite









up vote
0
down vote

favorite











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.







share|improve this question














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.









share|improve this question













share|improve this question




share|improve this question








edited Apr 26 at 5:28









dessert

19.8k55594




19.8k55594










asked Apr 26 at 2:31









Alex Silva

11




11







  • 1




    Does it work if you go to the site with a browser?
    – Organic Marble
    Apr 26 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 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 at 11:21










  • @dessert I did this, but it did not work, Wget says "unknown authentication scheme".
    – Alex Silva
    Apr 26 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 at 12:19












  • 1




    Does it work if you go to the site with a browser?
    – Organic Marble
    Apr 26 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 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 at 11:21










  • @dessert I did this, but it did not work, Wget says "unknown authentication scheme".
    – Alex Silva
    Apr 26 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 at 12:19







1




1




Does it work if you go to the site with a browser?
– Organic Marble
Apr 26 at 4:12




Does it work if you go to the site with a browser?
– Organic Marble
Apr 26 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 at 6:45




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 at 6:45




1




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 at 11:21




@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 at 11:21












@dessert I did this, but it did not work, Wget says "unknown authentication scheme".
– Alex Silva
Apr 26 at 11:30




@dessert I did this, but it did not work, Wget says "unknown authentication scheme".
– Alex Silva
Apr 26 at 11:30




1




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 at 12:19




@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 at 12:19















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1028247%2fwget-how-to-download-files-from-a-server-that-requires-authentication%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1028247%2fwget-how-to-download-files-from-a-server-that-requires-authentication%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

pylint3 and pip3 broken

Missing snmpget and snmpwalk

How to enroll fingerprints to Ubuntu 17.10 with VFS491