From c1f839e4f8e8c2472ce3a72dd14e30e82b8e7777 Mon Sep 17 00:00:00 2001 From: evermind Date: Fri, 20 Sep 2024 14:37:03 +0200 Subject: [PATCH] RUMBLE: fix extraction of video id for older java versions --- .../extractor/services/rumble/RumbleParsingHelper.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/rumble/RumbleParsingHelper.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/rumble/RumbleParsingHelper.java index c5b54c76ee..01942f1e22 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/rumble/RumbleParsingHelper.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/rumble/RumbleParsingHelper.java @@ -220,13 +220,13 @@ public static synchronized Map> getMinimalHeaders() { } public static String getEmbedVideoId(final String rb) { - final String VALID_URL = "https?://(?:www\\.)?rumble\\.com/embed/(?:[0-9a-z]+\\.)?(?[0-9a-z]+)"; - final String EMBED_REGEX = "(?:<(?:script|iframe)[^>]+\\bsrc=|[\"']embedUrl[\"']\\s*:\\s*)[\"'](?" + VALID_URL + ")"; + final String VALID_URL = "https?://(?:www\\.)?rumble\\.com/embed/(?:[0-9a-z]+\\.)?([0-9a-z]+)"; // id is group 1 + final String EMBED_REGEX = "(?:<(?:script|iframe)[^>]+\\bsrc=|[\"']embedUrl[\"']\\s*:\\s*)[\"']" + VALID_URL; Pattern pattern = Pattern.compile(EMBED_REGEX); Matcher matcher = pattern.matcher(rb); if (matcher.find()) { // Remove v (first character) from the id - return matcher.group(2).substring(1); + return matcher.group(1).substring(1); } else { return null; }