You are not logged in.

#1 2011-03-21 12:02:01

sant527
Member
Registered: 2009-06-21
Posts: 273

wget

I am using firefox browser. I installed the download helper plugin. So when I open a video from youtube, the download helper icon becomes active. One of the options it shows is copy url. So the following is the url it gave.

http://tc.v20.cache5.c.youtube.com/vide … _counter=2

If select the download option it will download using firefox downloader.

But I want to use this url and download using wget command line.

So I tried

[simha@gauranga Documents]$ wget "http://tc.v20.cache5.c.youtube.com/vide … _counter=2"


The following is the output

--2011-03-21 17:42:06--  http://tc.v20.cache5.c.youtube.com/vide … _counter=2
Resolving tc.v20.cache5.c.youtube.com... 208.117.239.163
Connecting to tc.v20.cache5.c.youtube.com|208.117.239.163|:80... connected.
HTTP request sent, awaiting response... 403 Forbidden
2011-03-21 17:42:14 ERROR 403: Forbidden.

So can anyone try how to use this link and download the file.

Offline

#2 2011-03-21 12:20:09

chrismerck
Member
Registered: 2010-08-31
Posts: 5

Re: wget

Some sites block wget, so you may need to fake your user agent to get the download to work. Or, maybe your URL is bad.

When you connect with any webbrowser (including wget) it sends user-agent data to the server, identifying the name and version of the client you are using. You can fake this information if you want. Of course, you should pause for a moment and think if there is a valid reason for them blocking wget, and if there isn't some better way to do what you are trying to do.

Anyway, to spoof your user-agent with wget, you can use command-line options. Read the wget manual, and/or look at a guide like this one: http://www.askapache.com/dreamhost/wget … trick.html

Last edited by chrismerck (2011-03-21 12:21:22)

Offline

#3 2011-03-21 15:43:04

sant527
Member
Registered: 2009-06-21
Posts: 273

Re: wget

I have tried the .wgetrc method

$ wget -dnv "http://tc.v20.cache5.c.youtube.com/vide … _counter=2"
Setting --no (verbose) to 0
DEBUG output created by Wget 1.12 on linux-gnu.

Caching tc.v20.cache5.c.youtube.com => 208.117.238.27
Created socket 3.
Releasing 0x08e6d1f8 (new refcount 1).

---request begin---
GET /videoplayback?sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Calgorithm%2Cburst%2Cfactor%2Coc%3AU0hPRVdOTl9FSkNOOV9PSFJF&fexp=908401&algorithm=throttle-factor&itag=34&ipbits=0&burst=40&sver=3&signature=3C590F713D768C64F18ED306D5FCFD9F8B74AF8C.A57978726461CA6AB3E10A7A4EC17A3311BF52FF&expire=1300730400&key=yt1&ip=0.0.0.0&factor=1.25&id=6c80fed98681c0fa&redirect_counter=2 HTTP/1.0
User-Agent: Wget/1.12 (linux-gnu)
Accept: */*
Host: tc.v20.cache5.c.youtube.com
Connection: Keep-Alive

---request end---

---response begin---
HTTP/1.1 403 Forbidden
Last-Modified: Wed, 02 May 2007 10:26:10 GMT
Content-Type: text/plain
Connection: close
X-Content-Type-Options: nosniff
Date: Mon, 21 Mar 2011 15:41:17 GMT
Server: gvs 1.0

---response end---
Closed fd 3
http://tc.v20.cache5.c.youtube.com/vide … _counter=2:
2011-03-21 21:23:13 ERROR 403: Forbidden.

Any idea of what happened

Offline

#4 2011-03-21 16:05:06

3])
Member
From: Netherlands
Registered: 2009-10-12
Posts: 215

Re: wget

Perhaps try adding a

robots = off

to your .wgetrc file?


“There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies.”-- C.A.R. Hoare

Offline

#5 2011-03-21 16:44:58

sant527
Member
Registered: 2009-06-21
Posts: 273

Re: wget

I have added robots = off to .wgetrc. But still it doesnot work

$ wget -dnv "http://tc.v20.cache5.c.youtube.com/vide … _counter=2"
Setting --no (verbose) to 0
DEBUG output created by Wget 1.12 on linux-gnu.

Caching tc.v20.cache5.c.youtube.com => 208.117.239.163
Created socket 3.
Releasing 0x09017460 (new refcount 1).

---request begin---
GET /videoplayback?sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Calgorithm%2Cburst%2Cfactor%2Coc%3AU0hPRVdOTl9FSkNOOV9PSFJF&fexp=908401&algorithm=throttle-factor&itag=34&ipbits=0&burst=40&sver=3&signature=3C590F713D768C64F18ED306D5FCFD9F8B74AF8C.A57978726461CA6AB3E10A7A4EC17A3311BF52FF&expire=1300730400&key=yt1&ip=0.0.0.0&factor=1.25&id=6c80fed98681c0fa&redirect_counter=2 HTTP/1.0
Referer: http://www.google.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Host: tc.v20.cache5.c.youtube.com
Connection: Keep-Alive
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300

---request end---

---response begin---
HTTP/1.1 403 Forbidden
Last-Modified: Wed, 02 May 2007 10:26:10 GMT
Content-Type: text/plain
Connection: close
X-Content-Type-Options: nosniff
Date: Mon, 21 Mar 2011 16:32:08 GMT
Server: gvs 1.0

---response end---
Closed fd 3
http://tc.v20.cache5.c.youtube.com/vide … _counter=2:
2011-03-21 22:14:04 ERROR 403: Forbidden.

Offline

Board footer

Powered by FluxBB