Add createModelFromUrl for MVLive
This commit is contained in:
parent
096ed7a734
commit
335cdb8cb4
|
@ -6,6 +6,8 @@ import java.io.IOException;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
@ -240,4 +242,20 @@ public class MVLive extends AbstractSite {
|
|||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@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));
|
||||
}
|
||||
|
||||
return super.createModelFromUrl(url);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -32,14 +32,6 @@ public class MVLiveMergedHlsDownload extends MergedFfmpegHlsDownload {
|
|||
return t;
|
||||
});
|
||||
scheduler.scheduleAtFixedRate(() -> updateCloudFlareCookies(), 2, 2, TimeUnit.MINUTES);
|
||||
|
||||
try {
|
||||
|
||||
((MVLiveModel)getModel()).getRoomLocation();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
updateCloudFlareCookies();
|
||||
super.start();
|
||||
} finally {
|
||||
|
|
Loading…
Reference in New Issue