class VkRipper extends VideoRipper {

    private static final String HOST = "vk";

    public VkRipper(URL url) throws IOException {
        super(url);
    }

    @Override
    public String getHost() {
        return HOST;
    }

    @Override
    public boolean canRip(URL url) {
        Pattern p = Pattern.compile("^https?://[wm.]*vk\\.com/video[0-9]+.*$");
        Matcher m = p.matcher(url.toExternalForm());
        return m.matches();
    }

    @Override
    public URL sanitizeURL(URL url) throws MalformedURLException {
        return url;
    }

    @Override
    public String getGID(URL url) throws MalformedURLException {
        Pattern p = Pattern.compile("^https?://[wm.]*vk\\.com/video([0-9]+).*$");
        Matcher m = p.matcher(url.toExternalForm());
        if (m.matches()) {
            return m.group(1);
        }

        throw new MalformedURLException(
                "Expected vk video URL format:"
                        + "vk.com/videos####"
                        + " Got: " + url);
    }

    @Override
    public void rip() throws IOException {
        LOGGER.info("    Retrieving " + this.url);
        String videoURL = getVideoURLAtPage(this.url.toExternalForm());
        addURLToDownload(new URL(videoURL), HOST + "_" + getGID(this.url));
        waitForThreads();
    }

    public static String getVideoURLAtPage(String url) throws IOException {<FILL_FUNCTION_BODY>}
}

        Document doc = Http.url(url)
                           .userAgent(USER_AGENT)
                           .get();
        String html = doc.outerHtml();
        String videoURL = null;
        for (String quality : new String[] {"1080", "720", "480", "240"}) {
            quality = "url" + quality + "\\\":\\\"";
            if (html.contains(quality)) {
                videoURL = html.substring(html.indexOf(quality) + quality.length());
                videoURL = videoURL.substring(0, videoURL.indexOf("\""));
                videoURL = videoURL.replace("\\", "");
                break;
            }
        }
        if (videoURL == null) {
            throw new IOException("Could not find video URL at " + url);
        }
        return videoURL;
    
<methods>public boolean addURLToDownload(java.net.URL, java.io.File) ,public boolean addURLToDownload(java.net.URL, java.io.File, java.lang.String, Map<java.lang.String,java.lang.String>, java.lang.Boolean) ,public void downloadCompleted(java.net.URL, java.io.File) ,public void downloadErrored(java.net.URL, java.lang.String) ,public void downloadExists(java.net.URL, java.io.File) ,public java.lang.String getAlbumTitle(java.net.URL) ,public int getCompletionPercentage() ,public abstract java.lang.String getGID(java.net.URL) throws java.net.MalformedURLException,public abstract java.lang.String getHost() ,public java.lang.String getStatusText() ,public abstract void rip() throws java.io.IOException,public java.net.URL sanitizeURL(java.net.URL) throws java.net.MalformedURLException,public void setBytesCompleted(int) ,public void setBytesTotal(int) ,public void setWorkingDir(java.net.URL) throws java.io.IOException<variables>private int bytesCompleted,private int bytesTotal