From 06f2144e4daa10382737e829eab07e814265f889 Mon Sep 17 00:00:00 2001 From: Tobias Groza Date: Sat, 5 Oct 2019 14:59:05 +0200 Subject: [PATCH] [YouTube] Remove GEMA exception handling (#202) --- .../youtube/extractors/YoutubeStreamExtractor.java | 14 -------------- .../newpipe/extractor/stream/StreamExtractor.java | 2 +- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java index 4670234e3..a8a30013f 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java @@ -66,12 +66,6 @@ public class YoutubeStreamExtractor extends StreamExtractor { } } - public class GemaException extends ContentNotAvailableException { - GemaException(String message) { - super(message); - } - } - public class SubtitlesException extends ContentNotAvailableException { SubtitlesException(String message, Throwable cause) { super(message, cause); @@ -584,12 +578,6 @@ public class YoutubeStreamExtractor extends StreamExtractor { String errorMessage = errorElement.text(); if (errorMessage == null || errorMessage.isEmpty()) { errorReason = null; - } else if (errorMessage.contains("GEMA")) { - // Gema sometimes blocks youtube music content in germany: - // https://www.gema.de/en/ - // Detailed description: - // https://en.wikipedia.org/wiki/GEMA_%28German_organization%29 - errorReason = new StringBuilder("GEMA"); } else { errorReason = new StringBuilder(errorMessage); errorReason.append(" "); @@ -670,8 +658,6 @@ public class YoutubeStreamExtractor extends StreamExtractor { } catch (Parser.RegexException e) { String errorReason = getErrorMessage(); switch (errorReason) { - case "GEMA": - throw new GemaException(errorReason); case "": throw new ContentNotAvailableException("Content not available: player config empty", e); default: diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamExtractor.java index e34007672..46ffe8a8a 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamExtractor.java @@ -270,7 +270,7 @@ public abstract class StreamExtractor extends Extractor { } /** - * Should analyse the webpage's document and extracts any error message there might be. (e.g. GEMA block) + * Should analyse the webpage's document and extracts any error message there might be. * * @return Error message; null if there is no error message. */