Merge branch 'dev' into yt-webm-opus

This commit is contained in:
kapodamy 2019-10-12 14:01:50 -03:00 committed by GitHub
commit 3c6e93c96a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 15 deletions

View File

@ -66,12 +66,6 @@ public class YoutubeStreamExtractor extends StreamExtractor {
} }
} }
public class GemaException extends ContentNotAvailableException {
GemaException(String message) {
super(message);
}
}
public class SubtitlesException extends ContentNotAvailableException { public class SubtitlesException extends ContentNotAvailableException {
SubtitlesException(String message, Throwable cause) { SubtitlesException(String message, Throwable cause) {
super(message, cause); super(message, cause);
@ -584,12 +578,6 @@ public class YoutubeStreamExtractor extends StreamExtractor {
String errorMessage = errorElement.text(); String errorMessage = errorElement.text();
if (errorMessage == null || errorMessage.isEmpty()) { if (errorMessage == null || errorMessage.isEmpty()) {
errorReason = null; 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 { } else {
errorReason = new StringBuilder(errorMessage); errorReason = new StringBuilder(errorMessage);
errorReason.append(" "); errorReason.append(" ");
@ -670,8 +658,6 @@ public class YoutubeStreamExtractor extends StreamExtractor {
} catch (Parser.RegexException e) { } catch (Parser.RegexException e) {
String errorReason = getErrorMessage(); String errorReason = getErrorMessage();
switch (errorReason) { switch (errorReason) {
case "GEMA":
throw new GemaException(errorReason);
case "": case "":
throw new ContentNotAvailableException("Content not available: player config empty", e); throw new ContentNotAvailableException("Content not available: player config empty", e);
default: default:

View File

@ -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. * @return Error message; null if there is no error message.
*/ */