pull/586/head
FongMi 1 year ago
parent 32a56296fe
commit 335ac9f378
  1. 8
      youtube/src/main/java/com/github/kiulian/downloader/extractor/ExtractorImpl.java
  2. 2
      youtube/src/main/java/com/github/kiulian/downloader/parser/ParserImpl.java

@ -1,7 +1,5 @@
package com.github.kiulian.downloader.extractor;
import android.util.Log;
import com.github.kiulian.downloader.YoutubeException;
import com.github.kiulian.downloader.downloader.Downloader;
import com.github.kiulian.downloader.downloader.request.RequestWebpage;
@ -52,11 +50,11 @@ public class ExtractorImpl implements Extractor {
if (config.has("args")) {
return config;
} else {
JsonObject object = new JsonObject();
JsonObject obj = new JsonObject();
JsonObject args = new JsonObject();
args.add("player_response", config);
object.add("args", args);
return object;
obj.add("args", args);
return obj;
}
} catch (Exception e) {
throw new YoutubeException.BadPageException("Player config contains invalid json");

@ -65,7 +65,7 @@ public class ParserImpl implements Parser {
private VideoInfo parseVideo(String videoId, YoutubeCallback<VideoInfo> callback) throws YoutubeException {
// try to spoof android
// workaround for issue https://github.com/sealedtx/java-youtube-downloader/issues/97
VideoInfo videoInfo = parseVideoWeb(videoId, callback);
VideoInfo videoInfo = parseVideoAndroid(videoId, callback);
if (videoInfo == null) {
videoInfo = parseVideoWeb(videoId, callback);
}

Loading…
Cancel
Save