2023-02-15 10:03:03 +00:00
|
|
|
package com.zhangmeng.tools.controller;
|
|
|
|
|
|
2023-02-17 08:45:53 +00:00
|
|
|
import com.zhangmeng.tools.utils.AlertUtils;
|
|
|
|
|
import com.zhangmeng.tools.utils.ResourcesUtils;
|
2023-02-15 10:03:03 +00:00
|
|
|
import javafx.collections.FXCollections;
|
|
|
|
|
import javafx.collections.ObservableList;
|
2023-02-17 08:45:53 +00:00
|
|
|
import javafx.event.EventHandler;
|
2023-02-15 10:03:03 +00:00
|
|
|
import javafx.fxml.FXML;
|
2023-02-17 08:45:53 +00:00
|
|
|
import javafx.fxml.FXMLLoader;
|
|
|
|
|
import javafx.scene.Node;
|
|
|
|
|
import javafx.scene.Scene;
|
2023-02-15 10:03:03 +00:00
|
|
|
import javafx.scene.control.ComboBox;
|
2023-02-17 08:45:53 +00:00
|
|
|
import javafx.scene.control.TextField;
|
|
|
|
|
import javafx.scene.layout.AnchorPane;
|
|
|
|
|
import javafx.scene.web.WebEngine;
|
|
|
|
|
import javafx.scene.web.WebView;
|
|
|
|
|
import javafx.stage.Stage;
|
|
|
|
|
import javafx.stage.WindowEvent;
|
2023-02-15 10:03:03 +00:00
|
|
|
import javafx.util.StringConverter;
|
2023-02-17 08:45:53 +00:00
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
2023-02-15 10:03:03 +00:00
|
|
|
|
2023-02-16 01:21:09 +00:00
|
|
|
/**
|
|
|
|
|
* @author : 芊芊墨客
|
|
|
|
|
* @version : 1.0
|
|
|
|
|
* @date : 2023-02-16 09:19
|
|
|
|
|
*/
|
2023-02-17 08:45:53 +00:00
|
|
|
@Slf4j
|
2023-02-15 10:03:03 +00:00
|
|
|
public class VipParserController {
|
|
|
|
|
|
|
|
|
|
@FXML
|
|
|
|
|
private ComboBox<URLS> comboBox;
|
|
|
|
|
|
2023-02-17 08:45:53 +00:00
|
|
|
@FXML
|
|
|
|
|
private TextField input_text;
|
|
|
|
|
|
2023-02-15 10:03:03 +00:00
|
|
|
@FXML
|
|
|
|
|
public void initialize() {
|
|
|
|
|
|
|
|
|
|
ObservableList<URLS> list = FXCollections.observableArrayList();
|
|
|
|
|
URLS[] values = URLS.values();
|
|
|
|
|
list.addAll(values);
|
|
|
|
|
|
|
|
|
|
comboBox.setConverter(new StringConverter<URLS>() {
|
|
|
|
|
@Override
|
|
|
|
|
public String toString(URLS object) {
|
2023-02-17 08:45:53 +00:00
|
|
|
if (object == null) {
|
2023-02-15 10:03:03 +00:00
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
return object.getName();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public URLS fromString(String string) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
comboBox.setItems(list);
|
|
|
|
|
comboBox.getSelectionModel().select(4);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@FXML
|
2023-02-17 08:45:53 +00:00
|
|
|
public void player() {
|
|
|
|
|
log.info("点击解析:{}", comboBox.getSelectionModel().getSelectedItem().name);
|
|
|
|
|
|
|
|
|
|
if (input_text.getText().length() == 0){
|
|
|
|
|
AlertUtils.alert_warning("请输入解析地址!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String url = comboBox.getSelectionModel().getSelectedItem().url;
|
|
|
|
|
String path = url + input_text.getText();
|
2023-02-15 10:03:03 +00:00
|
|
|
|
2023-02-17 08:45:53 +00:00
|
|
|
AnchorPane root = null;
|
|
|
|
|
try {
|
|
|
|
|
root = FXMLLoader.load(ResourcesUtils.getResource("vip-parser-player"));
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WebView webView = (WebView) root.lookup("#webView");
|
|
|
|
|
WebEngine engine = webView.getEngine();
|
|
|
|
|
engine.load(path);
|
|
|
|
|
|
|
|
|
|
Stage stage = (Stage) this.comboBox.getScene().getWindow();
|
|
|
|
|
stage.hide();
|
|
|
|
|
|
|
|
|
|
Scene scene = new Scene(root);
|
|
|
|
|
Stage player_stage = new Stage();
|
|
|
|
|
player_stage.setScene(scene);
|
|
|
|
|
player_stage.setTitle("播放");
|
|
|
|
|
player_stage.setWidth(1600);
|
|
|
|
|
player_stage.setHeight(800);
|
|
|
|
|
player_stage.setFullScreen(true);
|
|
|
|
|
player_stage.setOnCloseRequest(windowEvent -> {
|
|
|
|
|
log.info("播放关闭");
|
|
|
|
|
stage.show();
|
|
|
|
|
});
|
|
|
|
|
player_stage.show();
|
2023-02-15 10:03:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public enum URLS {
|
|
|
|
|
|
|
|
|
|
vip1717yun("1717yun解析", "https://www.1717yun.com/jx/ty.php?url=", "稳定通用"),
|
|
|
|
|
wpsseo("wpsseo", "http://www.wpsseo.cn/jx/?url=", "稳定通用"),
|
|
|
|
|
cjw123("cjw123", "https://a.cjw123.com/index.php?url=", "稳定通用"),
|
|
|
|
|
xmflv("xmflv", "https://jx.xmflv.com/?url=", "稳定通用"),
|
|
|
|
|
jsonplayer("jsonplayer", "https://jx.jsonplayer.com/player/?url=", "稳定通用"),
|
|
|
|
|
vip1717yun_2("VIP视频解析116kan智能解析", "https://www.1717yun.com/api/?url=", "vip解析");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private String name;
|
|
|
|
|
private String url;
|
|
|
|
|
private String desc;
|
|
|
|
|
|
|
|
|
|
URLS(String name, String url, String desc) {
|
|
|
|
|
this.name = name;
|
|
|
|
|
this.url = url;
|
|
|
|
|
this.desc = desc;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getName() {
|
|
|
|
|
return name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setName(String name) {
|
|
|
|
|
this.name = name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getUrl() {
|
|
|
|
|
return url;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setUrl(String url) {
|
|
|
|
|
this.url = url;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getDesc() {
|
|
|
|
|
return desc;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setDesc(String desc) {
|
|
|
|
|
this.desc = desc;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|