Discussion:
wget unable to retrieve file, error 303: see other
(too old to reply)
Mark Hobley
2006-12-31 13:04:24 UTC
Permalink
I am trying to retrieve a file from youtube using the following command:

wget http://youtube.com/get_video.php?video_id=tTzs9G-VOZ4&l=140&t=OEgsToPDskKti1Hr5dHSqOa4u62UoEXG

This produces an error:

HTTP request sent, awaiting response... 303 See Other
12:59:37 ERROR 303: See Other.

If I type the same url into mozilla, I am prompted to save the file.

How do I force wget to retrieve the file?

Thanks in advance.

Regards,

Mark.
--
Mark Hobley
393 Quinton Road West
QUINTON
Birmingham
B32 1QE

Telephone: (0121) 247 1596
International: 0044 121 247 1596

Email: markhobley at hotpop dot donottypethisbit com

http://markhobley.yi.org/
Mark Hobley
2006-12-31 15:04:23 UTC
Permalink
Post by Mark Hobley
wget http://youtube.com/get_video.php?video_id=tTzs9G-VOZ4&l=140&t=OEgsToPDskKti1Hr5dHSqOa4u62UoEXG
HTTP request sent, awaiting response... 303 See Other
12:59:37 ERROR 303: See Other.
wget
'http://youtube.com/get_video.php?video_id=tTzs9G-VOZ4&l=140&t=OEgsToPDskK' -S

This shows the server responses:

1 HTTP/1.1 303 See Other
2 Date: Sun, 31 Dec 2006 13:59:02 GMT
3 Server: Apache
<snip>
9 Location: http://sjl-v45.sjl.youtube.com/get_video?video_id=tTzs9G-VOZ4
10 Connection: close
11 Content-Type: text/html; charset=utf-8

This appears to be a redirect.

I now try:

wget 'http://sjl-v45.sjl.youtube.com/get_video?video_id=tTzs9G-VOZ4' -S

This time the server responds:

1 HTTP/1.0 200 OK
2 Connection: close
3 Content-Type: video/flv
4 ETag: "-396445590"
5 Accept-Ranges: bytes
6 Last-Modified: Mon, 19 Jun 2006 22:51:46 GMT
7 Content-Length: 5730593
8 Date: Sun, 31 Dec 2006 14:12:05 GMT
9 Server: lighttpd/1.4.11

and the file downloads ok.

Regards,

Mark.
--
Mark Hobley
393 Quinton Road West
QUINTON
Birmingham
B32 1QE

Telephone: (0121) 247 1596
International: 0044 121 247 1596

Email: markhobley at hotpop dot donottypethisbit com

http://markhobley.yi.org/
HASM
2006-12-31 19:40:53 UTC
Permalink
Someone posted the bash script below to pull a youtube video from the ID

-- HASM


#!/bin/bash

(
echo -n http://youtube.com;
wget -q -O - http://youtube.com/watch?v=$ID |\
grep player2 |\
cut -d\" -f2 |\
sed 's;player2.swf;get_video;'
) | xargs wget
Mark Hobley
2007-01-07 02:04:20 UTC
Permalink
Post by HASM
Someone posted the bash script below to pull a youtube video from the ID
Yeah, that is the script I am trying to fix.

Regards,

Mark.
--
Mark Hobley
393 Quinton Road West
QUINTON
Birmingham
B32 1QE

Telephone: (0121) 247 1596
International: 0044 121 247 1596

Email: markhobley at hotpop dot donottypethisbit com

http://markhobley.yi.org/
Moe Trin
2006-12-31 19:20:31 UTC
Permalink
On Sun, 31 Dec 2006, in the Usenet newsgroup comp.os.linux.questions, in article
<u8pk64-***@neptune.markhobley.yi.org>, Mark Hobley wrote:

Boy, you _really_ like posting to obscure newsgroups. Try looking in
the newsgroups news.announce.newgroups, news.groups, or news.lists.misc
for a post on the 15th of each month titled "List of Big Eight Newsgroups"
Post by Mark Hobley
HTTP request sent, awaiting response... 303 See Other
12:59:37 ERROR 303: See Other.
RFC2616

10.3.4 303 See Other

The response to the request can be found under a different URI and
SHOULD be retrieved using a GET method on that resource. This method
exists primarily to allow the output of a POST-activated script to
redirect the user agent to a selected resource. The new URI is not a
substitute reference for the originally requested resource. The 303
response MUST NOT be cached, but the response to the second
(redirected) request might be cacheable.

The different URI SHOULD be given by the Location field in the
response. Unless the request method was HEAD, the entity of the
response SHOULD contain a short hypertext note with a hyperlink to
the new URI(s).
Post by Mark Hobley
How do I force wget to retrieve the file?
Give it the correct URL, or the right options.

Old guy
Mark Hobley
2007-01-07 02:04:20 UTC
Permalink
Post by Moe Trin
Give it the correct URL, or the right options.
Unfortunately, I don't know the url, until I get the response from the server:

wget
'http://youtube.com/get_video.php?video_id=tTzs9G-VOZ4&l=140&t=OEgsToPDskK' -S

This shows the server responses:

1 HTTP/1.1 303 See Other
2 Date: Sun, 31 Dec 2006 13:59:02 GMT
3 Server: Apache
<snip>
9 Location: http://sjl-v45.sjl.youtube.com/get_video?video_id=tTzs9G-VOZ4
10 Connection: close
11 Content-Type: text/html; charset=utf-8

I try to use the -s option to write the response to an output file as follows,
but the output file is not written:

wget
'http://youtube.com/get_video.php?video_id=tTzs9G-VOZ4&l=140&t=OEgsToPDskK' -s
-O /tmp/y1

I suppose I could use the -S and redirect standard error to the file, or are
there better alternatives?

Please advise.

Mark.
--
Mark Hobley
393 Quinton Road West
QUINTON
Birmingham
B32 1QE

Telephone: (0121) 247 1596
International: 0044 121 247 1596

Email: markhobley at hotpop dot donottypethisbit com

http://markhobley.yi.org/
Moe Trin
2007-01-08 01:45:54 UTC
Permalink
On Sun, 07 Jan 2007, in the Usenet newsgroup comp.os.linux.questions, in article
Post by Moe Trin
Give it the correct URL, or the right options.
Doesn't the -r (recursive) option pick this up? Or is it picking up to much?

Old guy

Mark Hobley
2007-01-07 19:04:24 UTC
Permalink
I now have a working script that downloads videos from youtube.com:

#!/bin/sh
bu='http://youtube.com/get_video.php?'
ur=$1
if [ $ur == ''] ; then
read -p "YouTube url? " ur
fi
wget $ur -O /tmp/youtube.html
uf=$bu`grep player2.swf /tmp/youtube.html | cut -d? -f2 | cut -d\" -f1`
# wget $uf -O /tmp/youtube.html -s # does not work
wget $uf -O /tmp/youtube.html -S 2> /tmp/youtube.jnk # stderr captured
uf=`grep 'ocation: http://' /tmp/youtube.jnk | cut -d: -f3`
wget http:$uf -O /tmp/video.flv


Regards,

Mark.
--
Mark Hobley
393 Quinton Road West
QUINTON
Birmingham
B32 1QE

Telephone: (0121) 247 1596
International: 0044 121 247 1596

Email: markhobley at hotpop dot donottypethisbit com

http://markhobley.yi.org/
Loading...