Skip to content

Commit

Permalink
Fixed incorrect isInvidiousUrl check
Browse files Browse the repository at this point in the history
  • Loading branch information
litetex committed Apr 26, 2022
1 parent 69d8249 commit 1776f95
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ public interface InvidiousLinkHandlerFactory extends YoutubeLikeLinkHandlerFacto
default boolean isInvidiousUrl(final URL url) {
return Utils.removeMAndWWWFromHost(url.getHost())
.equalsIgnoreCase(Utils.getHostOrNull(getInvidiousBaseUrl()))
&& YoutubeUrlHelper.isInvidioURL(url);
|| YoutubeUrlHelper.isInvidiousURL(url);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static boolean isHooktubeURL(@Nonnull final URL url) {
return host.equalsIgnoreCase("hooktube.com");
}

public static boolean isInvidioURL(@Nonnull final URL url) {
public static boolean isInvidiousURL(@Nonnull final URL url) {
// Valid, working instances as of 2022-03
final Set<String> invInstances = new HashSet<>(Arrays.asList(
"invidious.snopyta.org",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ public interface YoutubeLinkHandlerFactory extends YoutubeLikeLinkHandlerFactory

@Override
default boolean isInvidiousUrl(final URL url) {
return YoutubeUrlHelper.isInvidioURL(url);
return YoutubeUrlHelper.isInvidiousURL(url);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* along with NewPipe. If not, see <http://www.gnu.org/licenses/>.
*/

import static org.schabi.newpipe.extractor.services.youtube.shared.YoutubeUrlHelper.isInvidioURL;
import static org.schabi.newpipe.extractor.services.youtube.shared.YoutubeUrlHelper.isInvidiousURL;
import static org.schabi.newpipe.extractor.services.youtube.shared.YoutubeUrlHelper.isYoutubeURL;

import org.schabi.newpipe.extractor.linkhandler.ListLinkHandlerFactory;
Expand Down Expand Up @@ -54,7 +54,7 @@ public boolean onAcceptUrl(final String url) {
}

final String urlPath = urlObj.getPath();
return Utils.isHTTP(urlObj) && (isYoutubeURL(urlObj) || isInvidioURL(urlObj))
return Utils.isHTTP(urlObj) && (isYoutubeURL(urlObj) || isInvidiousURL(urlObj))
&& urlPath.equals("/feed/trending");
}
}

0 comments on commit 1776f95

Please sign in to comment.