forked from j62/ctbrec
1
0
Fork 0

Implement createModelFromUrl

This commit is contained in:
0xboobface 2019-01-28 13:32:42 +01:00
parent 182a9e079e
commit 626d13f87a
1 changed files with 16 additions and 0 deletions

View File

@ -178,4 +178,20 @@ public class LiveJasmin extends AbstractSite {
private LiveJasminHttpClient getLiveJasminHttpClient() { private LiveJasminHttpClient getLiveJasminHttpClient() {
return (LiveJasminHttpClient) httpClient; return (LiveJasminHttpClient) httpClient;
} }
@Override
public Model createModelFromUrl(String url) {
Matcher m = Pattern.compile("http.*?livejasmin\\.com.*?#!chat/(.*)").matcher(url);
if(m.find()) {
String name = m.group(1);
return createModel(name);
}
m = Pattern.compile("http.*?livejasmin\\.com.*?/chat-html5/(.*)").matcher(url);
if(m.find()) {
String name = m.group(1);
return createModel(name);
}
return super.createModelFromUrl(url);
}
} }