Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix URL normalization in import script

Chocobozzz4449d2695bad
diff --git a/server/tools/peertube-import-videos.ts b/server/tools/peertube-import-videos.ts
index 39e8221c0c..eaa792763a 100644
--- a/server/tools/peertube-import-videos.ts
+++ b/server/tools/peertube-import-videos.ts
@@ -333,7 +333,7 @@ function isNSFW (info: any) {
function normalizeTargetUrl (url: string) {
let normalizedUrl = url.replace(/\/+$/, '')
- if (!normalizedUrl.startsWith('http://') || !normalizedUrl.startsWith('https://')) {
+ if (!normalizedUrl.startsWith('http://') && !normalizedUrl.startsWith('https://')) {
normalizedUrl = 'https://' + normalizedUrl
}