Comment obtenir une vidéo youtube id à partir de l'URL avec java?

Je veux obtenir le v=id de youtube URL avec java

Exemple URL Youtube formats:

http://www.youtube.com/watch?v=u8nQa1cJyX8&a=GxdCwVVULXctT2lYDEPllDR0LRTutYfW
http://www.youtube.com/watch?v=u8nQa1cJyX8
http://youtu.be/0zM3nApSvMg
http://www.youtube.com/user/IngridMichaelsonVEVO#p/a/u/1/KdwsulMb8EQ
http://youtu.be/dQw4w9WgXcQ http://www.youtube.com/embed/dQw4w9WgXcQ
http://www.youtube.com/v/dQw4w9WgXcQ
http://www.youtube.com/e/dQw4w9WgXcQ
http://www.youtube.com/watch?v=dQw4w9WgXcQ
http://www.youtube.com/?v=dQw4w9WgXcQ
http://www.youtube.com/watch?feature=player_embedded&v=dQw4w9WgXcQ
http://www.youtube.com/?feature=player_embedded&v=dQw4w9WgXcQ
http://www.youtube.com/user/IngridMichaelsonVEVO#p/u/11/KdwsulMb8EQ
http://www.youtube-nocookie.com/v/6L3ZvIMwZFM?version=3&hl=fr_fr&rel=0

ou de tout autre youtube format contient une vidéo id dans l'url

J'Essaie avec ça :-

  Pattern compiledPattern = Pattern.compile("(?<=v=).*?(?=&|$)",Pattern.CASE_INSENSITIVE);      
        Matcher matcher = compiledPattern.matcher(sourceUrl);
        if(matcher.find()){
            setVideoId(matcher.group());
        }

Il n'est pas de travail pour une seule URL :-

http://youtu.be/6UW3xuJinEg

Suivez le lien. voir où il vous redirige vers
Comment puis-je obtenir son ID ?
si vous envoyez une demande à cette URL, il sera respnd yout avec un 3xx réponse HTTP qui vous redirige vers la véritable URL de Youtube. youtube.com/watch?v=..... format! en.wikipedia.org/wiki/List_of_HTTP_status_codes#3xx_Redirection
Merci!!!! Vous êtes de droite. mais comment puis-je traiter avec du code java ?
J'ai édité ma réponse

OriginalL'auteur Er KK Chopra | 2014-09-08