pull/578/head
FongMi 2 years ago
parent 3a5309c678
commit 12bf0a12f7
  1. 4
      app/build.gradle
  2. BIN
      app/libs/danmaku.aar
  3. 1
      app/src/leanback/java/com/fongmi/android/tv/ui/activity/LiveActivity.java
  4. 51
      app/src/main/java/com/fongmi/android/tv/impl/NewPipeImpl.java
  5. 1
      settings.gradle
  6. 2
      zlive/build.gradle

@ -118,9 +118,7 @@ dependencies {
implementation 'com.github.bumptech.glide:glide:4.16.0'
implementation 'com.github.bumptech.glide:annotations:4.16.0'
implementation 'com.github.bumptech.glide:okhttp3-integration:4.16.0'
implementation 'com.github.ctiao:DanmakuFlameMaster:0.9.25'
implementation 'com.github.jahirfiquitiva:TextDrawable:1.0.3'
implementation('com.github.teamnewpipe:NewPipeExtractor:v0.23.1') { exclude group: 'org.jsoup', module: 'jsoup' }
implementation 'com.github.thegrizzlylabs:sardine-android:0.9'
implementation 'com.github.YarikSOffice:lingver:1.3.0'
implementation 'com.google.android.material:material:1.11.0'
@ -131,7 +129,6 @@ dependencies {
implementation 'com.tencent.tbs:tbssdk:44286'
implementation 'io.antmedia:rtmp-client:3.2.0'
implementation 'javax.servlet:javax.servlet-api:3.1.0'
implementation 'net.java.dev.jna:jna:5.2.0'
implementation 'org.chromium.net:cronet-embedded:76.3809.111'
implementation 'org.eclipse.jetty:jetty-client:8.1.22.v20160922'
implementation('org.eclipse.jetty:jetty-server:8.1.22.v20160922') { exclude group: 'org.eclipse.jetty.orbit', module: 'javax.servlet' }
@ -141,6 +138,7 @@ dependencies {
implementation 'org.greenrobot:eventbus:3.3.1'
implementation 'org.nanohttpd:nanohttpd:2.3.1'
implementation('org.simpleframework:simple-xml:2.7.1') { exclude group: 'stax', module: 'stax-api' exclude group: 'xpp3', module: 'xpp3' }
implementation(ext: 'aar', name: 'danmaku', group: 'fongmi', version: 'release')
implementation(ext: 'aar', name: 'dlna-core-release', group: 'fongmi', version: 'release')
implementation(ext: 'aar', name: 'dlna-dmc-release', group: 'fongmi', version: 'release')
implementation(ext: 'aar', name: 'dlna-dmr-release', group: 'fongmi', version: 'release')

Binary file not shown.

@ -38,6 +38,7 @@ import com.fongmi.android.tv.databinding.ActivityLiveBinding;
import com.fongmi.android.tv.event.ActionEvent;
import com.fongmi.android.tv.event.ErrorEvent;
import com.fongmi.android.tv.event.PlayerEvent;
import com.fongmi.android.tv.event.RefreshEvent;
import com.fongmi.android.tv.impl.Callback;
import com.fongmi.android.tv.impl.LiveCallback;
import com.fongmi.android.tv.impl.PassCallback;

@ -1,51 +0,0 @@
package com.fongmi.android.tv.impl;
import androidx.annotation.NonNull;
import com.github.catvod.net.OkHttp;
import com.github.catvod.utils.Util;
import com.google.common.net.HttpHeaders;
import org.schabi.newpipe.extractor.downloader.Downloader;
import org.schabi.newpipe.extractor.downloader.Request;
import org.schabi.newpipe.extractor.downloader.Response;
import org.schabi.newpipe.extractor.exceptions.ReCaptchaException;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
public class NewPipeImpl extends Downloader {
@Override
public Response execute(@NonNull Request request) throws IOException, ReCaptchaException {
String url = request.url();
RequestBody reqBody = null;
byte[] dataToSend = request.dataToSend();
if (dataToSend != null) reqBody = RequestBody.create(dataToSend, null);
okhttp3.Request.Builder builder = new okhttp3.Request.Builder().method(request.httpMethod(), reqBody).url(url).addHeader(HttpHeaders.USER_AGENT, Util.CHROME);
for (Map.Entry<String, List<String>> pair : request.headers().entrySet()) {
String headerName = pair.getKey();
List<String> headerValueList = pair.getValue();
if (headerValueList.size() > 1) {
builder.removeHeader(headerName);
for (String headerValue : headerValueList) builder.addHeader(headerName, headerValue);
} else if (headerValueList.size() == 1) {
builder.header(headerName, headerValueList.get(0));
}
}
okhttp3.Response response = OkHttp.client().newCall(builder.build()).execute();
if (response.code() == 429) {
response.close();
throw new ReCaptchaException("reCaptcha Challenge requested", url);
}
String responseBodyToReturn = null;
ResponseBody resBody = response.body();
if (resBody != null) responseBodyToReturn = resBody.string();
String latestUrl = response.request().url().toString();
return new Response(response.code(), response.message(), response.headers().toMultimap(), responseBodyToReturn, latestUrl);
}
}

@ -27,6 +27,7 @@ dependencyResolutionManagement {
include ':app'
include ':hook'
include ':tvbus'
include ':zlive'
include ':catvod'
include ':pyramid'
include ':quickjs'

@ -15,5 +15,5 @@ android {
}
dependencies {
implementation 'net.java.dev.jna:jna:5.2.0'
api 'net.java.dev.jna:jna:5.2.0'
}
Loading…
Cancel
Save