From b4206479cbef92198d224034a213f6b6f64d6e75 Mon Sep 17 00:00:00 2001 From: John Zhen Mo Date: Thu, 1 Mar 2018 16:31:36 -0800 Subject: [PATCH] -Fixed Youtube page extraction on flagged / offensive content urls. --- .../extractor/services/youtube/YoutubeStreamExtractor.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamExtractor.java b/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamExtractor.java index 91d43b79..c5e4c5f9 100644 --- a/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamExtractor.java +++ b/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamExtractor.java @@ -538,13 +538,16 @@ public class YoutubeStreamExtractor extends StreamExtractor { private static final String CONTENT = "content"; private static final String DECRYPTION_FUNC_NAME = "decrypt"; + private static final String VERIFIED_URL_PARAMS = "&has_verified=1&bpctr=9999999999"; + private volatile String decryptionCode = ""; private String pageHtml = null; - private String getPageHtml(Downloader downloader) throws IOException, ExtractionException{ + private String getPageHtml(Downloader downloader) throws IOException, ExtractionException { + final String verifiedUrl = getCleanUrl() + VERIFIED_URL_PARAMS; if (pageHtml == null) { - pageHtml = downloader.download(getCleanUrl()); + pageHtml = downloader.download(verifiedUrl); } return pageHtml; }