forked from j62/ctbrec
Fix add by model URL for MV Live
This commit is contained in:
parent
d43e022563
commit
de19de2efe
|
@ -3,6 +3,8 @@ package ctbrec.sites.manyvids;
|
||||||
import static ctbrec.io.HttpConstants.*;
|
import static ctbrec.io.HttpConstants.*;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
@ -258,13 +260,19 @@ public class MVLive extends AbstractSite {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Model createModelFromUrl(String url) {
|
public Model createModelFromUrl(String url) {
|
||||||
|
try {
|
||||||
Matcher m = Pattern.compile("https://live.manyvids.com/(?:stream/)?(.*?)(?:/.*?)?").matcher(url.trim());
|
Matcher m = Pattern.compile("https://live.manyvids.com/(?:stream/)?(.*?)(?:/.*?)?").matcher(url.trim());
|
||||||
if(m.matches()) {
|
if (m.matches()) {
|
||||||
return createModel(m.group(1));
|
String modelName = URLDecoder.decode(m.group(1), "utf-8");
|
||||||
|
return createModel(modelName);
|
||||||
}
|
}
|
||||||
m = Pattern.compile("https://www.manyvids.com/MVLive/(.*?)/\\d+/?").matcher(url.trim());
|
m = Pattern.compile("https://www.manyvids.com/MVLive/(.*?)/\\d+/?").matcher(url.trim());
|
||||||
if(m.matches()) {
|
if (m.matches()) {
|
||||||
return createModel(m.group(1));
|
String modelName = URLDecoder.decode(m.group(1), "utf-8");
|
||||||
|
return createModel(modelName);
|
||||||
|
}
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
LOG.error("Couldn't decode model name from URL", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.createModelFromUrl(url);
|
return super.createModelFromUrl(url);
|
||||||
|
|
Loading…
Reference in New Issue