Fix createModelFromUrl for Showup and Fc2Live

This commit is contained in:
0xboobface 2020-05-23 16:20:14 +02:00
parent 62be5795f4
commit f1a0e5900c
2 changed files with 5 additions and 6 deletions

View File

@ -41,7 +41,7 @@ public class Fc2Live extends AbstractSite {
@Override
public Model createModelFromUrl(String url) {
Matcher m = Pattern.compile("http.*?fc2.*?.com/(\\d+)/?").matcher(url);
if(m.find()) {
if (m.find()) {
Fc2Model model = (Fc2Model) createModel("");
model.setId(m.group(1));
try {
@ -51,10 +51,10 @@ public class Fc2Live extends AbstractSite {
return null;
}
return model;
}
} else {
return super.createModelFromUrl(url);
}
}
@Override
public Double getTokenBalance() throws IOException {

View File

@ -20,7 +20,6 @@ import org.slf4j.LoggerFactory;
import ctbrec.Config;
import ctbrec.Model;
import ctbrec.UnknownModel;
import ctbrec.io.HttpClient;
import ctbrec.io.HttpException;
import ctbrec.sites.AbstractSite;
@ -172,11 +171,11 @@ public class Showup extends AbstractSite {
@Override
public Model createModelFromUrl(String url) {
Matcher matcher = Pattern.compile(getBaseUrl() + "(?:/profile)?/(.*)").matcher(url);
Matcher matcher = Pattern.compile("https?://(?:.*?\\.)?showup.tv(?:/profile)?/(.*)").matcher(url);
if (matcher.find()) {
return createModel(matcher.group(1));
} else {
return new UnknownModel();
return super.createModelFromUrl(url);
}
}