package xyz.stream.api.database;

import xyz.stream.api.database.entity.ServerEntity;
import xyz.stream.utils.OkHttpUtils$HttpStatusException;
import xyz.stream.utils.y;

/* JADX INFO: loaded from: classes3.dex */
public final class c implements y {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ Integer f35789a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ String f35790b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ String f35791c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final /* synthetic */ e f35792d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final /* synthetic */ f f35793e;

    public c(Integer num, String str, String str2, e eVar, f fVar) {
        this.f35793e = fVar;
        this.f35789a = num;
        this.f35790b = str;
        this.f35791c = str2;
        this.f35792d = eVar;
    }

    @Override // xyz.stream.utils.y
    public final void n(String str) {
        ServerEntity serverEntityJ = this.f35793e.j(this.f35789a, this.f35790b, this.f35791c, str, this.f35792d);
        e eVar = this.f35792d;
        if (serverEntityJ == null) {
            eVar.h("Failed to parse IPTV data.");
            return;
        }
        f fVar = this.f35793e;
        int i10 = fVar.f35810c;
        fVar.f35810c = 0;
        eVar.n(serverEntityJ, i10);
    }

    @Override // xyz.stream.utils.y
    public final void r(Exception exc) {
        String message;
        u.a.g(exc, new StringBuilder("Failed to fetch IPTV data: "));
        boolean z10 = exc instanceof OkHttpUtils$HttpStatusException;
        e eVar = this.f35792d;
        if (!z10 ? (message = exc.getMessage()) == null || !message.trim().startsWith("401") : ((OkHttpUtils$HttpStatusException) exc).a() != 401) {
            eVar.q(this.f35790b, this.f35791c, this.f35789a);
            return;
        }
        eVar.h("Failed to fetch IPTV data: " + exc.getMessage());
    }
}
