private static String paramVFromURL(URL url) throws HostNoGV, NoQuery, NoYouTubeParamV, DocIdInvalid {
        /** YouTube */
        String queryURL;
        int startDocId, endDocId;

        if ((url.getHost() == null) ||
           (url.getHost().indexOf("youtube.com") == -1)) {
            throw new HostNoGV();
        }

        if ((queryURL = url.getQuery()) == null) {
            throw new NoQuery();
        }

        if ((startDocId = queryURL.indexOf("v=")) == -1) {
            throw new NoYouTubeParamV();
        }

        startDocId += "v=".length();
        endDocId = startDocId;

        if ((endDocId == queryURL.length()) ||
            (queryURL.charAt(endDocId) == '&')) { // no buit
            throw new DocIdInvalid();
        }
        endDocId++;

        while ((endDocId < queryURL.length()) &&
                (queryURL.charAt(endDocId) != '&'))
            endDocId++;
        
        return queryURL.substring(startDocId, endDocId);
}