How can I send an http request at a specific time?

Given a url to a webpage which embeds a video (similar to youtube) how can I write an API (in any language) to send a request (http or any other) and find if the video is valid/broken (maybe by using return codes for the video stream) without actually visiting the page?

  • For example: A video might be removed for various reasons after adding..(like copyright issues/removed by user etc), without actually visiting this URL but by just having the link, is it possible to write an API using the http return codes to find out if the link is broken?? The best one I was able to find for a broken link example!!

  • Answer:

    Youtube - currently - responds with 303 See Other and redirects to index. You could check for that with HEAD requests.

Simon Oberhammer at Quora Visit the source

Was this solution helpful to you?

Other answers

If the URL actually returns an error code (such as 401, 404, etc.) you could use the HTTP HEAD to determine if the document is available. In this case, YouTube returned 200 (success) with the content in the page saying that the video has been removed. So, unless you parse the page for known content or error text, you may not be able to determine if the video is actually present in the page or not.

Raghavendra Kidiyoor

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.