@Test public void checkErrorInCreateInfo() throws IOException { YoukuExtractor youkuExtractor = new YoukuExtractor(); mExpectedException.expect(ExtractException.class); mExpectedException.expectMessage("Youku said: Sorry, this video is private"); VideoInfoImpl videoInfoImpl = youkuExtractor.createInfo(Mockhelper. mockResponse(TestConstant.YOUKU_ERROR_URL_1, TestConstant.YOUKU_ERROR_JSON_1)); assertEquals(null, videoInfoImpl); }
@Override @Nullable VideoInfoImpl createInfo(@NonNull Response response) throws IOException { JsonObject data = getData(response.body().string()); if (data == null) return null; checkError(data); String title = getTitle(data); Map<Integer, Stream> streamMap = getSegMap(data); LogUtil.d(TAG, "hd length:" + streamMap.keySet().size()); return new VideoInfoImpl(mUrl, streamMap, title, mId); }
YoukuExtractor extends Extractor { @Override @Nullable VideoInfoImpl createInfo(@NonNull Response response) throws IOException { JsonObject data = getData(response.body().string()); if (data == null) return null; checkError(data); String title = getTitle(data); Map<Integer, Stream> streamMap = getSegMap(data); LogUtil.d(TAG, "hd length:" + streamMap.keySet().size()); return new VideoInfoImpl(mUrl, streamMap, title, mId); } }
YoukuExtractor extends Extractor { @Override @Nullable VideoInfoImpl createInfo(@NonNull Response response) throws IOException { JsonObject data = getData(response.body().string()); if (data == null) return null; checkError(data); String title = getTitle(data); Map<Integer, Stream> streamMap = getSegMap(data); LogUtil.d(TAG, "hd length:" + streamMap.keySet().size()); return new VideoInfoImpl(mUrl, streamMap, title, mId); }  }
YoukuExtractor extends Extractor { @Override @Nullable VideoInfoImpl createInfo(@NonNull Response response) throws IOException { JsonObject data = getData(response.body().string()); if (data == null) return null; checkError(data); String title = getTitle(data); Map<Integer, Stream> streamMap = getSegMap(data); LogUtil.d(TAG, "hd length:" + streamMap.keySet().size()); return new VideoInfoImpl(mUrl, streamMap, title, mId); }   }
YoukuExtractor extends Extractor { @Override @Nullable VideoInfoImpl createInfo(@NonNull Response response) throws IOException { JsonObject data = getData(response.body().string()); if (data == null) return null; checkError(data); String title = getTitle(data); Map<Integer, Stream> streamMap = getSegMap(data); LogUtil.d(TAG, "hd length:" + streamMap.keySet().size()); return new VideoInfoImpl(mUrl, streamMap, title, mId); }   static final String VALID_URL; static final String TEST_URL; }