CAG v5.7.4版本的 MD5 值为:bc57ead76a7a30559f0708e9d60d749f
以下内容为反编译后的 VideoClient.java 源代码,内容仅作参考
package org.godfootsteps.arch.videoApi;
import com.blankj.utilcode.util.NetworkUtils;
import com.google.android.exoplayer2.metadata.icy.IcyHeaders;
import com.google.android.gms.actions.SearchIntents;
import d.c.a.j.v;
import d.c.a.l.b;
import d.c.a.m.c;
import i.c.a.c.m;
import i.j.a.e.t.d;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.regex.Pattern;
import kotlin.Metadata;
import kotlin.coroutines.intrinsics.CoroutineSingletons;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import n.e;
import n.f.g;
import n.g.f.a.c;
import n.i.a.l;
import n.i.a.p;
import n.i.b.h;
import n.o.a;
import org.godfootsteps.arch.api.model.BaseModel;
import org.godfootsteps.arch.api.util.Request;
import org.godfootsteps.arch.vimeoApi.VimeoApi;
import org.godfootsteps.arch.vimeoApi.VimeoApi$singleVideoRequest$1;
import org.godfootsteps.arch.vimeoApi.model.AlbumModel;
import org.godfootsteps.arch.vimeoApi.model.VideoModel;
import org.godfootsteps.arch.youtubeApi.YouTubeApi;
import org.godfootsteps.arch.youtubeApi.YouTubeApi$singleVideoRequest$1;
import org.godfootsteps.arch.youtubeApi.model.ListItemBean;
import org.godfootsteps.arch.youtubeApi.model.YouTubeListModel;
import org.godfootsteps.router.model.PlaylistData;
import org.godfootsteps.router.model.Video;
@Metadata(d1 = {"\u0000L\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0006\n\u0002\u0010\u000b\n\u0002\b\u0004\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0007\bÆ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J,\u0010\u000f\u001a\u00020\u00102\u0006\u0010\u0011\u001a\u00020\u00042\u0012\u0010\u0012\u001a\u000e\u0012\u0004\u0012\u00020\u0004\u0012\u0004\u0012\u00020\u00100\u00132\b\b\u0002\u0010\u0014\u001a\u00020\u000bJ<\u0010\u0015\u001a\u00020\u00102\u0006\u0010\u0016\u001a\u00020\u00042\u0018\u0010\u0012\u001a\u0014\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00180\u0017\u0012\u0004\u0012\u00020\u00100\u00132\u0012\u0010\u0019\u001a\u000e\u0012\u0004\u0012\u00020\u001a\u0012\u0004\u0012\u00020\u00100\u0013J@\u0010\u001b\u001a\u00020\u00102\u0006\u0010\u001c\u001a\u00020\u00042\b\u0010\u001d\u001a\u0004\u0018\u00010\u00042\u0012\u0010\u0012\u001a\u000e\u0012\u0004\u0012\u00020\u001e\u0012\u0004\u0012\u00020\u00100\u00132\u0012\u0010\u0019\u001a\u000e\u0012\u0004\u0012\u00020\u001a\u0012\u0004\u0012\u00020\u00100\u0013JF\u0010\u001f\u001a\u00020 2\u0006\u0010!\u001a\u00020\u00042\u0006\u0010\"\u001a\u00020\u00042\u0006\u0010#\u001a\u00020\u00042\u0012\u0010\u0012\u001a\u000e\u0012\u0004\u0012\u00020\u001e\u0012\u0004\u0012\u00020\u00100\u00132\u0012\u0010\u0019\u001a\u000e\u0012\u0004\u0012\u00020\u001a\u0012\u0004\u0012\u00020\u00100\u0013J6\u0010$\u001a\u00020\u00102\u0006\u0010\u0011\u001a\u00020\u00042\u0012\u0010\u0012\u001a\u000e\u0012\u0004\u0012\u00020\u0018\u0012\u0004\u0012\u00020\u00100\u00132\u0012\u0010\u0019\u001a\u000e\u0012\u0004\u0012\u00020\u001a\u0012\u0004\u0012\u00020\u00100\u0013J\f\u0010%\u001a\u00020\u000b*\u0004\u0018\u00010\u0004J\n\u0010&\u001a\u00020\u000b*\u00020\u0004R\u000e\u0010\u0003\u001a\u00020\u0004X\u0086T¢\u0006\u0002\n\u0000R\u001a\u0010\u0005\u001a\u00020\u0004X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0006\u0010\u0007\"\u0004\b\b\u0010\tR\u001a\u0010\n\u001a\u00020\u000bX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\n\u0010\f\"\u0004\b\r\u0010\u000e¨\u0006'"}, d2 = {"Lorg/godfootsteps/arch/videoApi/VideoClient;", "", "()V", "VIMEO", "", "VIMEO_TOKEN", "getVIMEO_TOKEN", "()Ljava/lang/String;", "setVIMEO_TOKEN", "(Ljava/lang/String;)V", "isYoutubePlatform", "", "()Z", "setYoutubePlatform", "(Z)V", "getVideoThumbnail", "", "videoId", "onSuccess", "Lkotlin/Function1;", "isH", "multipleVideoRequest", "videoIds", "", "Lorg/godfootsteps/router/model/Video;", "onError", "", "playlistRequest", "listId", "page1", "Lorg/godfootsteps/router/model/PlaylistData;", "searchVideo", "Lkotlinx/coroutines/Job;", SearchIntents.EXTRA_QUERY, "nextPageToken", "channelId", "singleVideoRequest", "isCurrentPlatformVideoId", "isVimeoId", "arch_release"}, k = 1, mv = {1, 5, 1}, xi = 48)
public final class VideoClient {
public static final VideoClient a = new VideoClient();
public static boolean b = true;
public final void a(String str, final l<? super String, e> lVar, final boolean z) {
h.e(str, "videoId");
h.e(lVar, "onSuccess");
if (b(str)) {
e(str, new l<Video, e>() {
{
super(1);
}
@Override
public e invoke(Video video) {
invoke2(video);
return e.a;
}
public final void invoke2(Video video) {
h.e(video, "it");
l<String, e> lVar2 = lVar;
String hqThumbnailURL = z ? video.getHqThumbnailURL() : video.getThumbnailURL();
h.d(hqThumbnailURL, "if (isH) it.hqThumbnailURL else it.thumbnailURL");
lVar2.invoke(hqThumbnailURL);
}
}, new l<Integer, e>() {
{
super(1);
}
@Override
public e invoke(Integer num) {
invoke(num.intValue());
return e.a;
}
public final void invoke(int i2) {
l<String, e> lVar2 = lVar;
if (lVar2 == null) {
return;
}
lVar2.invoke("");
}
});
return;
}
String str2 = z ? "hqdefault" : "mqdefault";
lVar.invoke("http://img.youtube.com/vi/" + str + '/' + str2 + ".jpg");
}
public final boolean b(String str) {
h.e(str, "<this>");
return a.B(str, "Vimeo_", true) || Pattern.matches("^[0-9]+$", str);
}
public final void c(String str, l<? super List<? extends Video>, e> lVar, l<? super Integer, e> lVar2) {
h.e(str, "videoIds");
h.e(lVar, "onSuccess");
h.e(lVar2, "onError");
if (!b(str) && (!a.c(str, ",", false, 2) || !b((String) a.A(str, new String[]{","}, false, 0, 6).get(0)))) {
YouTubeApi.a.c(str, lVar, lVar2);
} else {
VimeoApi.a.b(str, lVar, lVar2);
}
}
public final void d(final String str, String str2, final l<? super PlaylistData, e> lVar, final l<? super Integer, e> lVar2) {
final String str3 = str2;
h.e(str, "listId");
h.e(lVar, "onSuccess");
h.e(lVar2, "onError");
boolean z = true;
if (b(str)) {
h.e(str, "listId");
h.e(lVar, "onSuccess");
h.e(lVar2, "onError");
if (str3 == null) {
str3 = IcyHeaders.REQUEST_HEADER_ENABLE_METADATA_VALUE;
}
if (h.a(str3, IcyHeaders.REQUEST_HEADER_ENABLE_METADATA_VALUE)) {
d.c.a.l.a aVar = d.c.a.l.a.a;
String a2 = d.c.a.l.a.c.a(h.j("album_", str));
if (a2 != null && !a.o(a2)) {
z = false;
}
if (!z && (!NetworkUtils.c() || !aVar.a(h.j("album_", str)))) {
List list = (List) m.b(a2, m.d(Video.class));
h.d(list, "videoList");
h.e(list, "<this>");
PlaylistData playlistData = new PlaylistData();
playlistData.setNumVideo(list.size());
playlistData.getVideos().addAll(list);
playlistData.setToken("");
lVar.invoke(playlistData);
return;
}
n.m.t.a.p.m.e1.a.f2(new l<Request<AlbumModel, BaseModel<AlbumModel>>, e>() {
@Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\u0010\u0000\u001a\b\u0012\u0004\u0012\u00020\u00020\u0001H\u008a@"}, d2 = {"<anonymous>", "Lorg/godfootsteps/arch/api/model/BaseModel;", "Lorg/godfootsteps/arch/vimeoApi/model/AlbumModel;"}, k = 3, mv = {1, 5, 1}, xi = 48)
@c(c = "org.godfootsteps.arch.vimeoApi.VimeoApi$listRequestByNet$1$1", f = "VimeoApi.kt", l = {136}, m = "invokeSuspend")
public static final class AnonymousClass1 extends SuspendLambda implements l<n.g.c<? super BaseModel<AlbumModel>>, Object> {
public final String $listId;
public final String $page;
public int label;
public AnonymousClass1(String str, String str2, n.g.c<? super AnonymousClass1> cVar) {
super(1, cVar);
this.$listId = str;
this.$page = str2;
}
@Override
public final n.g.c<e> create(n.g.c<?> cVar) {
return new AnonymousClass1(this.$listId, this.$page, cVar);
}
@Override
public final Object invoke(n.g.c<? super BaseModel<AlbumModel>> cVar) {
return ((AnonymousClass1) create(cVar)).invokeSuspend(e.a);
}
@Override
public final Object invokeSuspend(Object obj) {
CoroutineSingletons coroutineSingletons = CoroutineSingletons.COROUTINE_SUSPENDED;
int i2 = this.label;
if (i2 == 0) {
d.Q4(obj);
Objects.requireNonNull(b.a);
b bVar = b.a.b;
String str = this.$listId;
String str2 = this.$page;
this.label = 1;
obj = bVar.c(str, str2, this);
if (obj == coroutineSingletons) {
return coroutineSingletons;
}
} else if (i2 != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
} else {
d.Q4(obj);
}
return obj;
}
}
{
super(1);
}
@Override
public e invoke(Request<AlbumModel, BaseModel<AlbumModel>> request) {
invoke2(request);
return e.a;
}
public final void invoke2(Request<AlbumModel, BaseModel<AlbumModel>> request) {
h.e(request, "$this$request");
request.f(new AnonymousClass1(str, str3, null));
final l<PlaylistData, e> lVar3 = lVar;
final String str4 = str3;
final String str5 = str;
request.f15180l = new l<AlbumModel, e>() {
{
super(1);
}
@Override
public e invoke(AlbumModel albumModel) {
invoke2(albumModel);
return e.a;
}
public final void invoke2(AlbumModel albumModel) {
h.e(albumModel, "it");
List<VideoModel> data = albumModel.getData();
ArrayList arrayList = new ArrayList(d.S(data, 10));
for (VideoModel videoModel : data) {
arrayList.add(VimeoApi.a(VimeoApi.a, videoModel));
}
l<PlaylistData, e> lVar4 = lVar3;
String next = albumModel.getPaging().getNext();
h.e(arrayList, "<this>");
PlaylistData playlistData2 = new PlaylistData();
playlistData2.setNumVideo(arrayList.size());
playlistData2.getVideos().addAll(arrayList);
playlistData2.setToken(next);
lVar4.invoke(playlistData2);
if (h.a(str4, IcyHeaders.REQUEST_HEADER_ENABLE_METADATA_VALUE)) {
d.c.a.l.a aVar2 = d.c.a.l.a.a;
i.c.a.c.d dVar = d.c.a.l.a.c;
String j2 = h.j("album_", str5);
String e2 = m.e(arrayList);
d.c.a.m.b bVar = d.c.a.m.b.a;
dVar.b(j2, e2, d.c.a.m.b.b);
Iterator it = arrayList.iterator();
while (it.hasNext()) {
Video video = (Video) it.next();
d.c.a.l.a aVar3 = d.c.a.l.a.a;
i.c.a.c.d dVar2 = d.c.a.l.a.c;
String id = video.getId();
h.d(id, "video.id");
String j3 = h.j("video_", id);
String e3 = m.e(video);
d.c.a.m.b bVar2 = d.c.a.m.b.a;
dVar2.b(j3, e3, d.c.a.m.b.b);
}
}
}
};
final l<Integer, e> lVar4 = lVar2;
request.f15181m = new p<Integer, String, e>() {
{
super(2);
}
@Override
public e invoke(Integer num, String str6) {
invoke(num.intValue(), str6);
return e.a;
}
public final void invoke(int i2, String str6) {
h.e(str6, "s");
lVar4.invoke(Integer.valueOf(i2));
}
};
}
});
return;
}
n.m.t.a.p.m.e1.a.f2(new l<Request<AlbumModel, BaseModel<AlbumModel>>, e>() {
@Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\u0010\u0000\u001a\b\u0012\u0004\u0012\u00020\u00020\u0001H\u008a@"}, d2 = {"<anonymous>", "Lorg/godfootsteps/arch/api/model/BaseModel;", "Lorg/godfootsteps/arch/vimeoApi/model/AlbumModel;"}, k = 3, mv = {1, 5, 1}, xi = 48)
@c(c = "org.godfootsteps.arch.vimeoApi.VimeoApi$listRequestByNet$1$1", f = "VimeoApi.kt", l = {136}, m = "invokeSuspend")
public static final class AnonymousClass1 extends SuspendLambda implements l<n.g.c<? super BaseModel<AlbumModel>>, Object> {
public final String $listId;
public final String $page;
public int label;
public AnonymousClass1(String str, String str2, n.g.c<? super AnonymousClass1> cVar) {
super(1, cVar);
this.$listId = str;
this.$page = str2;
}
@Override
public final n.g.c<e> create(n.g.c<?> cVar) {
return new AnonymousClass1(this.$listId, this.$page, cVar);
}
@Override
public final Object invoke(n.g.c<? super BaseModel<AlbumModel>> cVar) {
return ((AnonymousClass1) create(cVar)).invokeSuspend(e.a);
}
@Override
public final Object invokeSuspend(Object obj) {
CoroutineSingletons coroutineSingletons = CoroutineSingletons.COROUTINE_SUSPENDED;
int i2 = this.label;
if (i2 == 0) {
d.Q4(obj);
Objects.requireNonNull(b.a);
b bVar = b.a.b;
String str = this.$listId;
String str2 = this.$page;
this.label = 1;
obj = bVar.c(str, str2, this);
if (obj == coroutineSingletons) {
return coroutineSingletons;
}
} else if (i2 != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
} else {
d.Q4(obj);
}
return obj;
}
}
{
super(1);
}
@Override
public e invoke(Request<AlbumModel, BaseModel<AlbumModel>> request) {
invoke2(request);
return e.a;
}
public final void invoke2(Request<AlbumModel, BaseModel<AlbumModel>> request) {
h.e(request, "$this$request");
request.f(new AnonymousClass1(str, str3, null));
final l<? super PlaylistData, e> lVar3 = lVar;
final String str4 = str3;
final String str5 = str;
request.f15180l = new l<AlbumModel, e>() {
{
super(1);
}
@Override
public e invoke(AlbumModel albumModel) {
invoke2(albumModel);
return e.a;
}
public final void invoke2(AlbumModel albumModel) {
h.e(albumModel, "it");
List<VideoModel> data = albumModel.getData();
ArrayList arrayList = new ArrayList(d.S(data, 10));
for (VideoModel videoModel : data) {
arrayList.add(VimeoApi.a(VimeoApi.a, videoModel));
}
l<PlaylistData, e> lVar4 = lVar3;
String next = albumModel.getPaging().getNext();
h.e(arrayList, "<this>");
PlaylistData playlistData2 = new PlaylistData();
playlistData2.setNumVideo(arrayList.size());
playlistData2.getVideos().addAll(arrayList);
playlistData2.setToken(next);
lVar4.invoke(playlistData2);
if (h.a(str4, IcyHeaders.REQUEST_HEADER_ENABLE_METADATA_VALUE)) {
d.c.a.l.a aVar2 = d.c.a.l.a.a;
i.c.a.c.d dVar = d.c.a.l.a.c;
String j2 = h.j("album_", str5);
String e2 = m.e(arrayList);
d.c.a.m.b bVar = d.c.a.m.b.a;
dVar.b(j2, e2, d.c.a.m.b.b);
Iterator it = arrayList.iterator();
while (it.hasNext()) {
Video video = (Video) it.next();
d.c.a.l.a aVar3 = d.c.a.l.a.a;
i.c.a.c.d dVar2 = d.c.a.l.a.c;
String id = video.getId();
h.d(id, "video.id");
String j3 = h.j("video_", id);
String e3 = m.e(video);
d.c.a.m.b bVar2 = d.c.a.m.b.a;
dVar2.b(j3, e3, d.c.a.m.b.b);
}
}
}
};
final l<? super Integer, e> lVar4 = lVar2;
request.f15181m = new p<Integer, String, e>() {
{
super(2);
}
@Override
public e invoke(Integer num, String str6) {
invoke(num.intValue(), str6);
return e.a;
}
public final void invoke(int i2, String str6) {
h.e(str6, "s");
lVar4.invoke(Integer.valueOf(i2));
}
};
}
});
return;
}
YouTubeApi youTubeApi = YouTubeApi.a;
h.e(str, "listId");
h.e(lVar, "onSuccess");
h.e(lVar2, "onError");
if (str3 != null && !a.o(str2)) {
z = false;
}
if (z) {
d.c.a.m.b bVar = d.c.a.m.b.a;
String a3 = bVar.a(youTubeApi.b(str));
if (!a.o(a3) && (!NetworkUtils.c() || !bVar.b(youTubeApi.b(str)))) {
final YouTubeListModel youTubeListModel = (YouTubeListModel) m.a(a3, YouTubeListModel.class);
youTubeApi.c(g.y(youTubeListModel.getItems(), ",", null, null, 0, null, new l<ListItemBean, CharSequence>() {
@Override
public final CharSequence invoke(ListItemBean listItemBean) {
h.e(listItemBean, "it");
return listItemBean.getSnippet().getResourceId().getVideoId();
}
}, 30), new l<List<? extends Video>, e>() {
{
super(1);
}
@Override
public e invoke(List<? extends Video> list2) {
invoke2(list2);
return e.a;
}
public final void invoke2(List<? extends Video> list2) {
h.e(list2, "it");
l<PlaylistData, e> lVar3 = lVar;
String nextPageToken = youTubeListModel.getNextPageToken();
h.e(list2, "<this>");
PlaylistData playlistData2 = new PlaylistData();
playlistData2.setNumVideo(list2.size());
playlistData2.getVideos().addAll(list2);
playlistData2.setToken(nextPageToken);
lVar3.invoke(playlistData2);
}
}, lVar2);
return;
}
if (str3 == null) {
str3 = "";
}
l<YouTubeApi.ListRequest<YouTubeListModel>, e> lVar3 = new l<YouTubeApi.ListRequest<YouTubeListModel>, e>() {
@Metadata(d1 = {"\u0000\u0006\n\u0000\n\u0002\u0018\u0002\u0010\u0000\u001a\u00020\u0001H\u008a@"}, d2 = {"<anonymous>", "Lorg/godfootsteps/arch/youtubeApi/model/YouTubeListModel;"}, k = 3, mv = {1, 5, 1}, xi = 48)
@c(c = "org.godfootsteps.arch.youtubeApi.YouTubeApi$listRequestByNet$1$1", f = "YouTubeApi.kt", l = {153}, m = "invokeSuspend")
public static final class AnonymousClass1 extends SuspendLambda implements l<n.g.c<? super YouTubeListModel>, Object> {
public final String $listId;
public final String $token;
public int label;
public AnonymousClass1(String str, String str2, n.g.c<? super AnonymousClass1> cVar) {
super(1, cVar);
this.$listId = str;
this.$token = str2;
}
@Override
public final n.g.c<e> create(n.g.c<?> cVar) {
return new AnonymousClass1(this.$listId, this.$token, cVar);
}
@Override
public final Object invoke(n.g.c<? super YouTubeListModel> cVar) {
return ((AnonymousClass1) create(cVar)).invokeSuspend(e.a);
}
@Override
public final Object invokeSuspend(Object obj) {
CoroutineSingletons coroutineSingletons = CoroutineSingletons.COROUTINE_SUSPENDED;
int i2 = this.label;
boolean z = true;
if (i2 == 0) {
d.Q4(obj);
Objects.requireNonNull(d.c.a.m.c.a);
d.c.a.m.c cVar = c.a.b;
String str = this.$listId;
String str2 = this.$token;
this.label = 1;
String str3 = v.j() ? "20" : null;
if (str3 == null) {
str3 = "48";
}
String str4 = str3;
YouTubeKeyHelper youTubeKeyHelper = YouTubeKeyHelper.a;
obj = cVar.a(str, str2, str4, YouTubeKeyHelper.c, this);
if (obj == coroutineSingletons) {
return coroutineSingletons;
}
} else if (i2 != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
} else {
d.Q4(obj);
}
YouTubeListModel youTubeListModel = (YouTubeListModel) obj;
String str5 = this.$token;
if (str5 != null && !a.o(str5)) {
z = false;
}
if (z) {
d.c.a.m.b bVar = d.c.a.m.b.a;
String str6 = this.$listId;
String str7 = v.j() ? "10" : null;
if (str7 == null) {
str7 = "16";
}
StringBuilder sb = new StringBuilder();
sb.append("0:https://www.googleapis.com/youtube/v3/playlistItems?playlistId=");
sb.append(str6);
sb.append("&maxResults=");
sb.append(str7);
sb.append("&part=snippet&fields=items(snippet/resourceId/videoId),pageInfo,nextPageToken&key=");
YouTubeKeyHelper youTubeKeyHelper2 = YouTubeKeyHelper.a;
sb.append(YouTubeKeyHelper.c);
String sb2 = sb.toString();
String e2 = m.e(youTubeListModel);
h.d(e2, "toJson(listModel)");
bVar.c(sb2, e2);
}
return youTubeListModel;
}
}
{
super(1);
}
@Override
public e invoke(YouTubeApi.ListRequest<YouTubeListModel> listRequest) {
invoke2(listRequest);
return e.a;
}
public final void invoke2(YouTubeApi.ListRequest<YouTubeListModel> listRequest) {
h.e(listRequest, "$this$listRequest");
listRequest.f(new AnonymousClass1(str, str3, null));
final l<PlaylistData, e> lVar4 = lVar;
listRequest.f15180l = new l<PlaylistData, e>() {
{
super(1);
}
@Override
public e invoke(PlaylistData playlistData2) {
invoke2(playlistData2);
return e.a;
}
public final void invoke2(PlaylistData playlistData2) {
h.e(playlistData2, "it");
lVar4.invoke(playlistData2);
}
};
final l<Integer, e> lVar5 = lVar2;
listRequest.f15181m = new p<Integer, String, e>() {
{
super(2);
}
@Override
public e invoke(Integer num, String str4) {
invoke(num.intValue(), str4);
return e.a;
}
public final void invoke(int i2, String str4) {
h.e(str4, "s");
lVar5.invoke(Integer.valueOf(i2));
}
};
}
};
YouTubeApi.ListRequest<YouTubeListModel> listRequest = new YouTubeApi.ListRequest<>(str3);
lVar3.invoke(listRequest);
listRequest.k();
return;
}
l<YouTubeApi.ListRequest<YouTubeListModel>, e> lVar4 = new l<YouTubeApi.ListRequest<YouTubeListModel>, e>() {
@Metadata(d1 = {"\u0000\u0006\n\u0000\n\u0002\u0018\u0002\u0010\u0000\u001a\u00020\u0001H\u008a@"}, d2 = {"<anonymous>", "Lorg/godfootsteps/arch/youtubeApi/model/YouTubeListModel;"}, k = 3, mv = {1, 5, 1}, xi = 48)
@n.g.f.a.c(c = "org.godfootsteps.arch.youtubeApi.YouTubeApi$listRequestByNet$1$1", f = "YouTubeApi.kt", l = {153}, m = "invokeSuspend")
public static final class AnonymousClass1 extends SuspendLambda implements l<n.g.c<? super YouTubeListModel>, Object> {
public final String $listId;
public final String $token;
public int label;
public AnonymousClass1(String str, String str2, n.g.c<? super AnonymousClass1> cVar) {
super(1, cVar);
this.$listId = str;
this.$token = str2;
}
@Override
public final n.g.c<e> create(n.g.c<?> cVar) {
return new AnonymousClass1(this.$listId, this.$token, cVar);
}
@Override
public final Object invoke(n.g.c<? super YouTubeListModel> cVar) {
return ((AnonymousClass1) create(cVar)).invokeSuspend(e.a);
}
@Override
public final Object invokeSuspend(Object obj) {
CoroutineSingletons coroutineSingletons = CoroutineSingletons.COROUTINE_SUSPENDED;
int i2 = this.label;
boolean z = true;
if (i2 == 0) {
d.Q4(obj);
Objects.requireNonNull(d.c.a.m.c.a);
d.c.a.m.c cVar = c.a.b;
String str = this.$listId;
String str2 = this.$token;
this.label = 1;
String str3 = v.j() ? "20" : null;
if (str3 == null) {
str3 = "48";
}
String str4 = str3;
YouTubeKeyHelper youTubeKeyHelper = YouTubeKeyHelper.a;
obj = cVar.a(str, str2, str4, YouTubeKeyHelper.c, this);
if (obj == coroutineSingletons) {
return coroutineSingletons;
}
} else if (i2 != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
} else {
d.Q4(obj);
}
YouTubeListModel youTubeListModel = (YouTubeListModel) obj;
String str5 = this.$token;
if (str5 != null && !a.o(str5)) {
z = false;
}
if (z) {
d.c.a.m.b bVar = d.c.a.m.b.a;
String str6 = this.$listId;
String str7 = v.j() ? "10" : null;
if (str7 == null) {
str7 = "16";
}
StringBuilder sb = new StringBuilder();
sb.append("0:https://www.googleapis.com/youtube/v3/playlistItems?playlistId=");
sb.append(str6);
sb.append("&maxResults=");
sb.append(str7);
sb.append("&part=snippet&fields=items(snippet/resourceId/videoId),pageInfo,nextPageToken&key=");
YouTubeKeyHelper youTubeKeyHelper2 = YouTubeKeyHelper.a;
sb.append(YouTubeKeyHelper.c);
String sb2 = sb.toString();
String e2 = m.e(youTubeListModel);
h.d(e2, "toJson(listModel)");
bVar.c(sb2, e2);
}
return youTubeListModel;
}
}
{
super(1);
}
@Override
public e invoke(YouTubeApi.ListRequest<YouTubeListModel> listRequest2) {
invoke2(listRequest2);
return e.a;
}
public final void invoke2(YouTubeApi.ListRequest<YouTubeListModel> listRequest2) {
h.e(listRequest2, "$this$listRequest");
listRequest2.f(new AnonymousClass1(str, str3, null));
final l<? super PlaylistData, e> lVar42 = lVar;
listRequest2.f15180l = new l<PlaylistData, e>() {
{
super(1);
}
@Override
public e invoke(PlaylistData playlistData2) {
invoke2(playlistData2);
return e.a;
}
public final void invoke2(PlaylistData playlistData2) {
h.e(playlistData2, "it");
lVar42.invoke(playlistData2);
}
};
final l<? super Integer, e> lVar5 = lVar2;
listRequest2.f15181m = new p<Integer, String, e>() {
{
super(2);
}
@Override
public e invoke(Integer num, String str4) {
invoke(num.intValue(), str4);
return e.a;
}
public final void invoke(int i2, String str4) {
h.e(str4, "s");
lVar5.invoke(Integer.valueOf(i2));
}
};
}
};
YouTubeApi.ListRequest<YouTubeListModel> listRequest2 = new YouTubeApi.ListRequest<>(str3);
lVar4.invoke(listRequest2);
listRequest2.k();
}
public final void e(String str, l<? super Video, e> lVar, l<? super Integer, e> lVar2) {
h.e(str, "videoId");
h.e(lVar, "onSuccess");
h.e(lVar2, "onError");
if (b(str)) {
VimeoApi vimeoApi = VimeoApi.a;
h.e(str, "videoId");
h.e(lVar, "onSuccess");
h.e(lVar2, "onError");
vimeoApi.b(str, new VimeoApi$singleVideoRequest$1(lVar2, lVar), lVar2);
return;
}
YouTubeApi youTubeApi = YouTubeApi.a;
h.e(str, "videoId");
h.e(lVar, "onSuccess");
h.e(lVar2, "onError");
youTubeApi.c(str, new YouTubeApi$singleVideoRequest$1(lVar2, lVar), lVar2);
}
}