diff --git a/backend/config.py b/backend/config.py index 810720e..dee5a37 100644 --- a/backend/config.py +++ b/backend/config.py @@ -27,6 +27,7 @@ providers["svt"] = "https://svtplay.se" providers["youtube"] = "https://www.youtube.com/watch?v=" providers["twitch"] = "https://twitch.tv" providers["twitter"] = "https://twitter.com" +providers["pornhub"] = "https://www.pornhub.com/view_video.php?viewkey=" nextcloud_server = os.environ.get("NEXTCLOUD_SERVER") if nextcloud_server is not None: diff --git a/backend/stream.py b/backend/stream.py index 52f8d4a..52cc916 100755 --- a/backend/stream.py +++ b/backend/stream.py @@ -67,7 +67,9 @@ class UpstreamHandler: path = handler.request.path if self.provider.startswith("nextcloud"): path = path.removesuffix("/").removesuffix("download").removesuffix("/") - elif self.provider.startswith("youtube"): + elif self.provider.startswith("youtube") or self.provider.startswith( + "pornhub" + ): path = path.removeprefix("/") self.upstream = config.providers[self.provider] + path if not self.direct: