Wget: How to download files from a server that requires authentication?
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
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.
command-line server password cron wget
 |Â
show 5 more comments
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.
command-line server password cron wget
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
 |Â
show 5 more comments
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.
command-line server password cron wget
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.
command-line server password cron wget
edited Apr 26 at 5:28
![](https://i.stack.imgur.com/9L8vd.png?s=32&g=1)
![](https://i.stack.imgur.com/9L8vd.png?s=32&g=1)
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
 |Â
show 5 more comments
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
 |Â
show 5 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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