aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes Java HTTP 403 Response Issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Java HTTP 403 Response Issue" Watch "Java HTTP 403 Response Issue" New topic
Author

Java HTTP 403 Response Issue

Stephen Murray
Greenhorn

Joined: Aug 30, 2013
Posts: 8
I'm looking to download videos from YouTube. My code works with most video. I can save the videos no problem but for some videos an HTTP response code of 403 is returned. For example all Vevo videos return 403 errors.

I'm pretty sure it is to do with the headers. I've added headers to the request as per Chromes Live HTTP Headers.

This is my code. Can somebody please suggest something I'm missing.

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61426
    
  67

A 403 means "Forbidden"; it is usually returned by a request when authorization fails.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Stephen Murray
Greenhorn

Joined: Aug 30, 2013
Posts: 8
Hi, thank you for your response. The video is Coldplay's Viva La Vida which I can access through my browser. As I said in my post I can download most other videos besides ones such as Vevo videos. Are there any other HTTP fields such as Cookies I should be using to get it to work?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61426
    
  67

I guess I would use the browser tools to inspect the request that works, and compare it to the request that doesn't work in order to find out what the differences are.
Stephen Murray
Greenhorn

Joined: Aug 30, 2013
Posts: 8
I have done, that is where those headers came from.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61426
    
  67

If the requests are identical, the response should be identical. There's got to be some difference.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java HTTP 403 Response Issue