youtube call 4 - spider version of call 2. get Location without a download of media


/ Published in: Bash
Save to your folder(s)

java httpurlconnection or apache.commons..GetMethod will have to simulate a 'spider' where you process the GET but NO DOWNLOAD of media happens


Copy this code and paste it in your HTML
  1. $ wget -d --spider "http://www.youtube.com/get_video?&video_id=VFGVzt7c5bY&t=vjVQa1PpcFMxWE6Xqi2iNijfCB1ILO02PYHx4FtPGz4="
  2. Setting --spider (spider) to 1
  3. DEBUG output created by Wget 1.11.3 on cygwin.
  4.  
  5. Spider mode enabled. Check if remote file exists.
  6. --2009-05-05 11:48:27-- http://www.youtube.com/get_video?&video_id=VFGVzt7c5bY&t=vjVQa1PpcFMxWE6Xqi2iNijfCB1ILO02PYHx4FtPGz4=
  7. Resolving www.youtube.com... 208.65.153.253
  8. Caching www.youtube.com => 208.65.153.253
  9. Connecting to www.youtube.com|208.65.153.253|:80... connected.
  10. Created socket 3.
  11. Releasing 0x00f51068 (new refcount 1).
  12.  
  13. ---request begin---
  14. HEAD /get_video?&video_id=VFGVzt7c5bY&t=vjVQa1PpcFMxWE6Xqi2iNijfCB1ILO02PYHx4FtPGz4= HTTP/1.0
  15. User-Agent: Wget/1.11.3
  16. Accept: */*
  17. Host: www.youtube.com
  18. Connection: Keep-Alive
  19.  
  20. ---request end---
  21. HTTP request sent, awaiting response...
  22. ---response begin---
  23. HTTP/1.1 303 See Other
  24. Date: Tue, 05 May 2009 18:48:23 GMT
  25. Server: Apache
  26. X-Content-Type-Options: nosniff
  27. Set-Cookie: use_hitbox=72c46ff6cbcdb7c5585c36411b6b334edAEAAAAw; path=/; domain=.youtube.com
  28. Set-Cookie: VISITOR_INFO1_LIVE=PmSEuruntn8; path=/; domain=.youtube.com; expires=Thu, 31-Dec-2009 18:48:23 GMT
  29. Set-Cookie: GEO=65204316c00d1402d44691102a22567bcwwAAAAyVVMYBcOnAPeJAEo=; path=/; domain=.youtube.com
  30. Expires: Tue, 27 Apr 1971 19:44:06 EST
  31. X-YouTube-MID: WkFSZzctYUFHdmkyLVFfemJtWlczelpscFVRYkxEWGNPbTBweHdpRmZpVWY5RWJrOVNLd3dR
  32. Cache-Control: no-cache
  33. Location: http://v3.lscache3.googlevideo.com/videoplayback?sparams=id%2Cexpire%2Cip%2Cipbits%2Citag&itag=5&ip=24.5.195.167&signature=5C6FF28648A7D2E8A953E9E5185
  34. FC88B7238456E.1240710527F1F828891196B5A04027F453F7A278&sver=3&expire=1241570903&key=yt1&ipbits=0&id=545195cededce5b6
  35. Keep-Alive: timeout=300
  36. Connection: Keep-Alive
  37. Content-Type: text/html; charset=utf-8
  38.  
  39. ---response end---
  40. 303 See Other
  41. cdm: 1 2 3 4 5 6 7 8
  42. Stored cookie youtube.com -1 (ANY) / <session> <insecure> [expiry none] use_hitbox 72c46ff6cbcdb7c5585c36411b6b334edAEAAAAw
  43. cdm: 1 2 3 4 5 6 7 8
  44. Stored cookie youtube.com -1 (ANY) / <permanent> <insecure> [expiry 2009-12-31 10:48:23] VISITOR_INFO1_LIVE PmSEuruntn8
  45. cdm: 1 2 3 4 5 6 7 8
  46. Stored cookie youtube.com -1 (ANY) / <session> <insecure> [expiry none] GEO 65204316c00d1402d44691102a22567bcwwAAAAyVVMYBcOnAPeJAEo=
  47. Location: http://v3.lscache3.googlevideo.com/videoplayback?sparams=id%2Cexpire%2Cip%2Cipbits%2Citag&itag=5&ip=24.5.195.167&signature=5C6FF28648A7D2E8A953E9E5185
  48. FC88B7238456E.1240710527F1F828891196B5A04027F453F7A278&sver=3&expire=1241570903&key=yt1&ipbits=0&id=545195cededce5b6 [following]
  49. Closed fd 3
  50. Spider mode enabled. Check if remote file exists.
  51. --2009-05-05 11:48:27-- http://v3.lscache3.googlevideo.com/videoplayback?sparams=id%2Cexpire%2Cip%2Cipbits%2Citag&itag=5&ip=24.5.195.167&signature=5C6FF28648A7
  52. D2E8A953E9E5185FC88B7238456E.1240710527F1F828891196B5A04027F453F7A278&sver=3&expire=1241570903&key=yt1&ipbits=0&id=545195cededce5b6
  53. Resolving v3.lscache3.googlevideo.com... 74.125.15.22
  54. Caching v3.lscache3.googlevideo.com => 74.125.15.22
  55. Connecting to v3.lscache3.googlevideo.com|74.125.15.22|:80... connected.
  56. Created socket 3.
  57. Releasing 0x00f51e28 (new refcount 1).
  58.  
  59. ---request begin---
  60. HEAD /videoplayback?sparams=id%2Cexpire%2Cip%2Cipbits%2Citag&itag=5&ip=24.5.195.167&signature=5C6FF28648A7D2E8A953E9E5185FC88B7238456E.1240710527F1F828891196B5A
  61. 04027F453F7A278&sver=3&expire=1241570903&key=yt1&ipbits=0&id=545195cededce5b6 HTTP/1.0
  62. User-Agent: Wget/1.11.3
  63. Accept: */*
  64. Host: v3.lscache3.googlevideo.com
  65. Connection: Keep-Alive
  66.  
  67. ---request end---
  68. HTTP request sent, awaiting response...
  69. ---response begin---
  70. HTTP/1.1 200 OK
  71. Content-Disposition: attachment; filename="video.flv"
  72. Last-Modified: Sat, 17 May 2008 01:28:32 GMT
  73. Content-Type: video/x-flv
  74. Content-Length: 4005432
  75. Expires: Tue, 05 May 2009 19:48:23 GMT
  76. Cache-Control: public,max-age=3600
  77. Connection: close
  78. Date: Tue, 05 May 2009 18:48:23 GMT
  79. Server: gvs 1.0
  80.  
  81. ---response end---
  82. 200 OK
  83. Length: 4005432 (3.8M) [video/x-flv]
  84. Closed fd 3
  85. Remote file exists.

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.