import java.net.*;
class urlReader {
String readUrl(refurl) {
// vcontext = context.get("vcontext");
// def refurl = vcontext.get("refurl");
java.net.URI refuri = new java.net.URI(refurl);
String query = refuri.getQuery();
String host = refuri.getHost();
String type = ""
if(host.endsWith("youtube.com")) {
if(query.startsWith("v=")) {
if(query.indexOf("&") > -1) {
query = query.substring(2,query.indexOf("&"));
}
else {
query = query.substring(2);
}
type = "youtube";
embedIndex = query;
}
}
return type;
}
}