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 java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
@ -258,13 +260,19 @@ public class MVLive extends AbstractSite {
|
|||
|
||||
@Override
|
||||
public Model createModelFromUrl(String url) {
|
||||
Matcher m = Pattern.compile("https://live.manyvids.com/(?:stream/)?(.*?)(?:/.*?)?").matcher(url.trim());
|
||||
if(m.matches()) {
|
||||
return createModel(m.group(1));
|
||||
}
|
||||
m = Pattern.compile("https://www.manyvids.com/MVLive/(.*?)/\\d+/?").matcher(url.trim());
|
||||
if(m.matches()) {
|
||||
return createModel(m.group(1));
|
||||
try {
|
||||
Matcher m = Pattern.compile("https://live.manyvids.com/(?:stream/)?(.*?)(?:/.*?)?").matcher(url.trim());
|
||||
if (m.matches()) {
|
||||
String modelName = URLDecoder.decode(m.group(1), "utf-8");
|
||||
return createModel(modelName);
|
||||
}
|
||||
m = Pattern.compile("https://www.manyvids.com/MVLive/(.*?)/\\d+/?").matcher(url.trim());
|
||||
if (m.matches()) {
|
||||
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);
|
||||
|
|
Loading…
Reference in New Issue