Skip to content

Commit

Permalink
解决小窗模式下短视频竖屏闪退;聚合搜索数量显示真实计数;嗅探调整;
Browse files Browse the repository at this point in the history
  • Loading branch information
q215613905 committed Sep 28, 2022
1 parent a680c46 commit 65a11d0
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,6 @@ private void searchResult() {
this.spNames.put(bean.getName(), bean.getKey());
allRunCount.incrementAndGet();
}
updateSearchResultCount(0);

for (String key : siteKey) {
searchExecutorService.execute(new Runnable() {
Expand All @@ -422,14 +421,14 @@ public void run() {
}catch (Exception e){

}

updateSearchResultCount(1);
// updateSearchResultCount(1);
}
});
}
}
synchronized private void updateSearchResultCount(int n){
finishedCount +=n;
// finishedCount +=n;
finishedCount = resultVods.size();
if(finishedCount > spNames.size()) finishedCount = spNames.size();

}
Expand Down Expand Up @@ -476,6 +475,7 @@ private void searchData(AbsXml absXml) {
}

if (searchAdapter.getData().size() > 0) {
finishedCount +=1;
searchAdapter.addData(data);
} else {
showSuccess();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ private void changeView(String id){
}
public boolean isFolederMode(){ return (getUITag() =='1'); }
// 获取当前页面UI的显示模式 ‘0’ 正常模式 '1' 文件夹模式 '2' 显示缩略图的文件夹模式
public char getUITag(){ return (sortData.flag == null || sortData.flag.length() ==0 ) ? '0' : sortData.flag.charAt(0); }
public char getUITag(){
System.out.println(sortData);
return (sortData == null || sortData.flag == null || sortData.flag.length() ==0 ) ? '0' : sortData.flag.charAt(0);
}
// 是否允许聚合搜索 sortData.flag的第二个字符为‘1’时允许聚搜
public boolean enableFastSearch(){ return (sortData.flag == null || sortData.flag.length() < 2 ) ? true : (sortData.flag.charAt(1) =='1'); }
// 保存当前页面
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,7 @@ boolean autoRetry() {
}

public void play(boolean reset) {
if(mVodInfo==null)return;
VodInfo.VodSeries vs = mVodInfo.seriesMap.get(mVodInfo.playFlag).get(mVodInfo.playIndex);
EventBus.getDefault().post(new RefreshEvent(RefreshEvent.TYPE_REFRESH, mVodInfo.playIndex));
setTip("正在获取播放信息", true, false);
Expand Down Expand Up @@ -1232,16 +1233,20 @@ public void run() {
}

boolean checkVideoFormat(String url) {
if (sourceBean.getType() == 3) {
if (url.contains("=http") || url.contains(".html")) {
return false;
}
Spider sp = ApiConfig.get().getCSP(sourceBean);
if (sp != null && sp.manualVideoCheck()){
return sp.isVideoFormat(url);
try{
if (sourceBean.getType() == 3) {
if (url.contains("=http") || url.contains(".html")) {
return false;
}
Spider sp = ApiConfig.get().getCSP(sourceBean);
if (sp != null && sp.manualVideoCheck()){
return sp.isVideoFormat(url);
}
}
return DefaultConfig.isVideoFormat(url);
}catch (Exception e){
return false;
}
return DefaultConfig.isVideoFormat(url);
}

class MyWebView extends WebView {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ public static String getFilePrefixName(String fileName) {
return start > -1 ? fileName.substring(0, start) : fileName;
}

private static final Pattern snifferMatch = Pattern.compile("http((?!http).)*?default\\.365yg\\.com/.*|http((?!http).){26,}?\\.(m3u8|mp4|flv|avi|mkv|rm|rmvb|wmv|mpg|mpeg|mpe|mp3|m4a|wma)\\?.*|http((?!http).){26,}\\.(m3u8|mp4|flv|avi|mkv|rm|rmvb|wmv|mpg|mpeg|mpe|mp3|m4a|wma)|http((?!http).){26,}?/m3u8\\?pt=m3u8.*|http((?!http).)*?default\\.ixigua\\.com/.*|http((?!http).)*?/video/tos[^\\?]*|http((?!http).)*?dycdn-tos\\.pstatp[^\\?]*|http.*?/player/m3u8play\\.php\\?url=.*|http.*?/player/.*?[pP]lay\\.php\\?url=.*|http.*?/playlist/m3u8/\\?vid=.*|http.*?\\.php\\?type=m3u8&.*|http.*?/download.aspx\\?.*|http.*?/api/up_api.php\\?.*|https.*?\\.66yk\\.cn.*|http((?!http).)*?netease\\.com/file/.*|http((?!http).)*?douyin\\.com/.*/play/\\?.*|http((?!http).)*?huoshan\\.com/.*/\\?item.*");
//增加对flv|avi|mkv|rm|wmv|mpg等几种视频格式的支持
//private static final Pattern snifferMatch = Pattern.compile("http((?!http).){26,}?\\.(m3u8|mp4)\\?.*|http((?!http).){26,}\\.(m3u8|mp4)|http((?!http).){26,}?/m3u8\\?pt=m3u8.*|http((?!http).)*?default\\.ixigua\\.com/.*|http((?!http).)*?cdn-tos[^\\?]*|http((?!http).)*?/obj/tos[^\\?]*|http.*?/player/m3u8play\\.php\\?url=.*|http.*?/player/.*?[pP]lay\\.php\\?url=.*|http.*?/playlist/m3u8/\\?vid=.*|http.*?\\.php\\?type=m3u8&.*|http.*?/download.aspx\\?.*|http.*?/api/up_api.php\\?.*|https.*?\\.66yk\\.cn.*|http((?!http).)*?netease\\.com/file/.*");
private static final Pattern snifferMatch = Pattern.compile("http((?!http).)*?default\\.365yg\\.com/.*|http((?!http).){26,}?\\.(m3u8|mp4|flv|avi|mkv|rm|wmv|mpg)\\?.*|http((?!http).){26,}\\.(m3u8|mp4|flv|avi|mkv|rm|wmv|mpg)|http((?!http).){20,}?/m3u8\\?pt=m3u8.*|http((?!http).)*?default\\.ixigua\\.com/.*|http((?!http).)*?dycdn-tos\\.pstatp[^\\?]*|http.*?/player/m3u8play\\.php\\?url=.*|http.*?/player/.*?[pP]lay\\.php\\?url=.*|http.*?/playlist/m3u8/\\?vid=.*|http.*?\\.php\\?type=m3u8&.*|http.*?/download.aspx\\?.*|http.*?/api/up_api.php\\?.*|https.*?\\.66yk\\.cn.*|http((?!http).)*?netease\\.com/file/.*");
public static boolean isVideoFormat(String url) {
if (url.contains("=http") || url.contains(".html")) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,10 @@ public void getSearch(String sourceKey, String wd) {
if (type == 3) {
try {
Spider sp = ApiConfig.get().getCSP(sourceBean);
json(searchResult, sp.searchContent(wd, false), sourceBean.getKey());
String search = sp.searchContent(wd, false);
if(!search.isEmpty()){
json(searchResult, search, sourceBean.getKey());
}
} catch (Throwable th) {
th.printStackTrace();
}
Expand Down

0 comments on commit 65a11d0

Please sign in to comment.