private String getCookie(URL url) {
        final Pattern COOKIE_PATTERN = Pattern.compile("_ddn_intercept_2_=([^;]+)");
        try {
            URLConnection conn = url.openConnection();

            BufferedReader in = new BufferedReader(
                    new InputStreamReader(
                            conn.getInputStream()));
            String inputLine;
            String tmp = "";
            while ((inputLine = in.readLine()) != null)
                tmp += inputLine;
            in.close();
            Matcher archiveMatcher = COOKIE_PATTERN.matcher(tmp);
            if (archiveMatcher.find()) {
                return archiveMatcher.group(0);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }