import android.app.Application;
import com.github.catvod.spider.AppYsV2;
import com.github.catvod.spider.Init;
import com.github.catvod.utils.Json;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonObject;
import org.junit.Assert;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;

@RunWith(RobolectricTestRunner.class)
public class AppYsV2Test {
    // @Mock
    private Application mockContext;

    private AppYsV2 spider;

    @org.junit.Before
    public void setUp() throws Exception {
        mockContext = RuntimeEnvironment.application;
        Init.init(mockContext);
        spider = new AppYsV2();
        spider.init(mockContext, "http://211.101.237.197:6532/api.php/app/");
    }

    @org.junit.Test
    public void homeContent() throws Exception {
        String content = spider.homeContent(true);
        JsonObject map = Json.safeObject(content);
        Gson gson = new GsonBuilder().setPrettyPrinting().create();

        System.out.println("homeContent--" + gson.toJson(map));

        //Assert.assertFalse(map.getAsJsonArray("list").isEmpty());
    }

    @org.junit.Test
    public void homeVideoContent() throws Exception {
        String content = spider.homeVideoContent();
        JsonObject map = Json.safeObject(content);
        Gson gson = new GsonBuilder().setPrettyPrinting().create();

        System.out.println("homeVideoContent--" + gson.toJson(map));

        //Assert.assertFalse(map.getAsJsonArray("list").isEmpty());
    }

    @org.junit.Test
    public void categoryContent() throws Exception {
        String content = spider.categoryContent("2", "2", true, new HashMap<>());
        JsonObject map = Json.safeObject(content);
        Gson gson = new GsonBuilder().setPrettyPrinting().create();
        System.out.println("categoryContent--" + gson.toJson(map));
        Assert.assertFalse(map.getAsJsonArray("list").isEmpty());
    }

    @org.junit.Test
    public void detailContent() throws Exception {

        String content = spider.detailContent(Arrays.asList("124923"));
        JsonObject map = Json.safeObject(content);
        Gson gson = new GsonBuilder().setPrettyPrinting().create();
        System.out.println("detailContent--" + gson.toJson(map));
        Assert.assertFalse(map.getAsJsonArray("list").isEmpty());
    }

    @org.junit.Test
    public void playerContent() throws Exception {
        String froms = "FF源-勿信视频内广告$$$LZ源-勿信视频内广告$$$官网TX云$$$BF$$$";
        String urls = "第01集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7157_0312029b/index.m3u8#第02集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7159_eb883cc3/index.m3u8#第03集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7163_c290b983/index.m3u8#第04集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7164_2f0e31cb/index.m3u8#第05集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7162_c99dd96f/index.m3u8#第06集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7165_6bce06ca/index.m3u8#第07集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7166_bdaaf8f3/index.m3u8#第08集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7169_378107c9/index.m3u8#第09集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7167_f4cc26c3/index.m3u8#第10集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7168_be8a4b0c/index.m3u8#第11集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7170_2420c90d/index.m3u8#第12集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7172_992e853b/index.m3u8#第13集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7171_5497dbfd/index.m3u8#第14集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7173_eb012483/index.m3u8#第15集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7174_0c865a91/index.m3u8#第16集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7176_fc223996/index.m3u8#第17集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7175_fe8d0d0a/index.m3u8#第18集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7178_1a76223c/index.m3u8#第19集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7179_5f52390d/index.m3u8#第20集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7177_11f268fa/index.m3u8#第21集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7181_cdb88db5/index.m3u8#第22集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7180_b68ee15d/index.m3u8#第23集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7183_66335d2a/index.m3u8#第24集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7182_8d2b0c17/index.m3u8#第25集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7185_d43b8810/index.m3u8#第26集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7187_80c1c117/index.m3u8#第27集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7186_991e0645/index.m3u8#第28集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7184_53a17d67/index.m3u8#第29集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7189_2f833fc7/index.m3u8#第30集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7188_55aa6a1a/index.m3u8#第31集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7195_20463a48/index.m3u8#第32集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7192_1b9638c7/index.m3u8#第33集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7191_c3be051d/index.m3u8#第34集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7190_f1790871/index.m3u8#第35集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7193_4feecdd9/index.m3u8#第36集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7194_ed7852e2/index.m3u8#第37集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7196_1030b485/index.m3u8#第38集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7198_d5bf1b6d/index.m3u8#第39集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7197_8c505ae9/index.m3u8#第40集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7204_f43bbd97/index.m3u8#第41集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7199_6d90609b/index.m3u8#第42集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7202_d2bb1644/index.m3u8#第43集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7200_863e3ee3/index.m3u8#第44集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7201_7d751b72/index.m3u8#第45集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7203_f21b18c8/index.m3u8#第46集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7205_84bd10a9/index.m3u8#第47集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7206_580677f5/index.m3u8#第48集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7208_d7e68bfc/index.m3u8#第49集$http://43.248.129.14:20240/?url=https://vip.ffzy-play.com/20221029/7207_241f728e/index.m3u8#$$$第01集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10879_f1428071/index.m3u8#第02集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10880_f85371e3/index.m3u8#第03集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10881_61f11f73/index.m3u8#第04集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10883_b722048d/index.m3u8#第05集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10882_bbe4483f/index.m3u8#第06集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10884_d5b261da/index.m3u8#第07集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10885_e25f2826/index.m3u8#第08集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10886_4205df18/index.m3u8#第09集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10887_a19974e8/index.m3u8#第10集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10888_2eb076c6/index.m3u8#第11集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10978_5083d953/index.m3u8#第12集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10893_0a1faa57/index.m3u8#第13集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10894_dcfd62c7/index.m3u8#第14集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10895_5dfcc8c7/index.m3u8#第15集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10896_89750caa/index.m3u8#第16集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10897_c37aeeeb/index.m3u8#第17集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10898_f00914e5/index.m3u8#第18集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10899_5ff0ffb9/index.m3u8#第19集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10900_15fd5f8e/index.m3u8#第20集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10901_ebe2ff41/index.m3u8#第21集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10902_0cd65f72/index.m3u8#第22集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10903_3cceee3f/index.m3u8#第23集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10907_fb5d8a1f/index.m3u8#第24集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10980_c79de392/index.m3u8#第25集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10912_b235b60f/index.m3u8#第26集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10913_4d957978/index.m3u8#第27集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10914_01eab996/index.m3u8#第28集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10915_f35a0e6d/index.m3u8#第29集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10916_789c0620/index.m3u8#第30集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10917_267c7203/index.m3u8#第31集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10918_3d37d18c/index.m3u8#第32集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10919_5b2e3e96/index.m3u8#第33集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10920_cbec77ff/index.m3u8#第34集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10921_1515340f/index.m3u8#第35集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10922_7865f15b/index.m3u8#第36集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10923_6a641bb0/index.m3u8#第37集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10924_49b711a6/index.m3u8#第38集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10925_8fb8488e/index.m3u8#第39集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10926_49d53974/index.m3u8#第40集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10927_68b41643/index.m3u8#第41集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10928_d731c97e/index.m3u8#第42集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10929_15cf31f8/index.m3u8#第43集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10930_7ce3864c/index.m3u8#第44集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10931_75ec4941/index.m3u8#第45集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10932_b0094b65/index.m3u8#第46集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10933_5838a8f0/index.m3u8#第47集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10934_cc5adb33/index.m3u8#第48集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10935_66552231/index.m3u8#第49集$http://43.248.129.14:20240/?url=https://vip.lz-cdn.com/20220428/10936_549e53c8/index.m3u8#$$$长歌行_01$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/t0036kis46j.html#长歌行_02$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/d00369b1y7c.html#长歌行_03$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/m0036xvwhhm.html#长歌行_04$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/i0036kfyhhb.html#长歌行_05$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/y0036x4ispp.html#长歌行_06$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/g0036gz0hg1.html#长歌行_07$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/l00362ps2f8.html#长歌行_08$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/b0036i9dvch.html#长歌行_09$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/g0036055isx.html#长歌行_10$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/c0036su1hxn.html#长歌行_11$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/w0036jcp5vh.html#长歌行_12$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/m0036sut988.html#长歌行_13$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/g0036furtm7.html#长歌行_14$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/w00361nzf48.html#长歌行_15$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/c0036zjf2qn.html#长歌行_16$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/r0036eelbmr.html#长歌行_17$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/o0036vmoosx.html#长歌行_18$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/t0036evfkty.html#长歌行_19$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/u0036ybn5x3.html#长歌行_20$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/e0036z1f6lj.html#长歌行_21$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/k00363hxgof.html#长歌行_22$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/v0036plpx51.html#长歌行_23$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/v0036ajs5h6.html#长歌行_24$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/g0036lf9yaq.html#长歌行_25$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/h0036e1eqsn.html#长歌行_26$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/p0036uzz4y1.html#长歌行_27$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/d00369d1rr3.html#长歌行_28$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/y00362seg8v.html#长歌行_29$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/k0036vv55ws.html#长歌行_30$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/p0036yf9swq.html#长歌行_31$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/a0036b01sgr.html#长歌行_32$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/x0036veo6zb.html#长歌行_33$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/i0036xqm59r.html#长歌行_34$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/g00367vk4u9.html#长歌行_35$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/p00369wkhm9.html#长歌行_36$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/g0036d80wbh.html#长歌行_37$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/p0036tk43ac.html#长歌行_38$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/w00365hv98w.html#长歌行_39$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/u0036qwqe6a.html#长歌行_40$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/k00360ym5ee.html#长歌行_41$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/h0036m4ak48.html#长歌行_42$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/d0036f1it5w.html#长歌行_43$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/q00360adsy7.html#长歌行_44$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/p0036aap6fo.html#长歌行_45$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/u0036t18zc5.html#长歌行_46$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/l0036m8a5hq.html#长歌行_47$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/p0036btxb2v.html#长歌行_48$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/c00369xnt6z.html#长歌行_49$https://cache.json.icu/5555.php?url=https://v.qq.com/x/cover/mzc00200c6aodyr/u003668tbq5.html#$$$第01集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf6.com/video/changgexing/第01集/index.m3u8#第02集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf6.com/video/changgexing/第02集/index.m3u8#第03集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf6.com/video/changgexing/第03集/index.m3u8#第04集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf5.com/video/changgexing/第04集/index.m3u8#第05集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf4.com/video/changgexing/第05集/index.m3u8#第06集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf6.com/video/changgexing/第06集/index.m3u8#第07集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf4.com/video/changgexing/第07集/index.m3u8#第08集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf5.com/video/changgexing/第08集/index.m3u8#第09集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf6.com/video/changgexing/第09集/index.m3u8#第10集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf6.com/video/changgexing/第10集/index.m3u8#第11集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf6.com/video/changgexing/第11集/index.m3u8#第12集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf6.com/video/changgexing/第12集/index.m3u8#第13集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf4.com/video/changgexing/第13集/index.m3u8#第14集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf4.com/video/changgexing/第14集/index.m3u8#第15集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf5.com/video/changgexing/第15集/index.m3u8#第16集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf6.com/video/changgexing/第16集/index.m3u8#第17集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf4.com/video/changgexing/第17集/index.m3u8#第18集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf6.com/video/changgexing/第18集/index.m3u8#第19集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf6.com/video/changgexing/第19集/index.m3u8#第20集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf4.com/video/changgexing/第20集/index.m3u8#第21集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf5.com/video/changgexing/第21集/index.m3u8#第22集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf6.com/video/changgexing/第22集/index.m3u8#第23集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf4.com/video/changgexing/第23集/index.m3u8#第24集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf6.com/video/changgexing/第24集/index.m3u8#第25集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf6.com/video/changgexing/第25集/index.m3u8#第26集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf6.com/video/changgexing/第26集/index.m3u8#第27集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf4.com/video/changgexing/第27集/index.m3u8#第28集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf6.com/video/changgexing/第28集/index.m3u8#第29集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf5.com/video/changgexing/第29集/index.m3u8#第30集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf4.com/video/changgexing/第30集/index.m3u8#第31集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf4.com/video/changgexing/第31集/index.m3u8#第32集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf6.com/video/changgexing/第32集/index.m3u8#第33集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf6.com/video/changgexing/第33集/index.m3u8#第34集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf6.com/video/changgexing/第34集/index.m3u8#第35集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf5.com/video/changgexing/第35集/index.m3u8#第36集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf6.com/video/changgexing/第36集/index.m3u8#第37集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf4.com/video/changgexing/第37集/index.m3u8#第38集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf4.com/video/changgexing/第38集/index.m3u8#第39集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf5.com/video/changgexing/第39集/index.m3u8#第40集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf6.com/video/changgexing/第40集/index.m3u8#第41集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf6.com/video/changgexing/第41集/index.m3u8#第42集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf6.com/video/changgexing/第42集/index.m3u8#第43集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf6.com/video/changgexing/第43集/index.m3u8#第44集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf4.com/video/changgexing/第44集/index.m3u8#第45集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf4.com/video/changgexing/第45集/index.m3u8#第46集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf5.com/video/changgexing/第46集/index.m3u8#第47集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf6.com/video/changgexing/第47集/index.m3u8#第48集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf6.com/video/changgexing/第48集/index.m3u8#第49集$http://43.248.129.14:20240/?url=https://c1.rrcdnbf6.com/video/changgexing/第49集/index.m3u8#$$$";
        for (int i = 0; i < urls.split("\\$\\$\\$").length; i++) {
            String content = spider.playerContent(froms.split("\\$\\$\\$")[i], urls.split("\\$\\$\\$")[i].split("#")[0].split("\\$")[1], new ArrayList<>());
            JsonObject map = Json.safeObject(content);
            Gson gson = new GsonBuilder().setPrettyPrinting().create();
            System.out.println("playerContent--" + gson.toJson(map));
            Assert.assertFalse(map.getAsJsonPrimitive("url").getAsString().isEmpty());
        }
    }

    @org.junit.Test
    public void searchContent() throws Exception {
        String content = spider.searchContent("阿凡达", false);
        JsonObject map = Json.safeObject(content);
        Gson gson = new GsonBuilder().setPrettyPrinting().create();
        System.out.println("searchContent--" + gson.toJson(map));
        Assert.assertFalse(map.getAsJsonArray("list").isEmpty());
    }
}