mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2024-12-15 06:40:33 +05:30
Merge branch 'dev' into yt-webm-opus
This commit is contained in:
commit
3c6e93c96a
@ -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:
|
||||||
|
@ -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.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user