Error mirroring a youtube channel

I have freshly installed peertube on a raspberryPi4 (debian10-buster) and it works fine.

I have installed the peertube-cli following the instructions in / root / PeerTube of the same raspberryPi4

I’m trying to download some videos from youtube but it gives me an error that I don’t understand what it means. I put the command and the logs.

root@peertube:~/PeerTube# ./YouDownload.sh 
info: Will download and upload 105 videos.

Cannot process video. {
  info: {
    duration: null,
    _type: 'url_transparent',
    ie_key: 'Youtube',
    description: null,
    uploader: null,
    title: '🌱 CONSTRUIR SEMILLEROS AUTO-RIEGO 🌱 - Huertos Urbanos e Invernaderos',
    url: 'dipQK_mcafE',
    view_count: 6228,
    id: 'dipQK_mcafE',
    _duration_raw: null,
    _duration_hms: null
  },
  url: 'https://videos.tormentasolar.win',
  err: Error: expected 200 "OK", got 500 "Internal Server Error"
      at Object.searchVideoWithSort (/root/PeerTube/dist/shared/extra-utils/search/videos.js:36:10)
      at /root/PeerTube/dist/server/tools/peertube-import-videos.js:118:38
      at Generator.next (<anonymous>)
      at fulfilled (/root/PeerTube/node_modules/tslib/tslib.js:114:62)
      at processTicksAndRejections (internal/process/task_queues.js:97:5)
  ----
      at Test._assertStatus (/root/PeerTube/node_modules/supertest/lib/test.js:296:12)
      at /root/PeerTube/node_modules/supertest/lib/test.js:80:15
      at Test._assertFunction (/root/PeerTube/node_modules/supertest/lib/test.js:311:11)
      at Test.assert (/root/PeerTube/node_modules/supertest/lib/test.js:201:21)
      at localAssert (/root/PeerTube/node_modules/supertest/lib/test.js:159:12)
      at /root/PeerTube/node_modules/supertest/lib/test.js:156:5
      at Test.Request.callback (/root/PeerTube/node_modules/superagent/lib/node/index.js:905:3)
      at IncomingMessage.<anonymous> (/root/PeerTube/node_modules/superagent/lib/node/index.js:1127:20)
      at IncomingMessage.emit (events.js:326:22)
      at endReadableNT (_stream_readable.js:1241:12)
      at processTicksAndRejections (internal/process/task_queues.js:84:21)
}
^C
root@peertube:~/PeerTube# 

Here the command

#!/bin/bash
PEERTUBE_URL=videos.tormentasolar.win
PEERTUBE_USER=maxlinux2000
PEERTUBE_PASSWORD=MySecretPass
TARGET_URL=https://www.youtube.com/c/HuertoAdictos/videos
node dist/server/tools/peertube-import-videos.js \
    -u "$PEERTUBE_URL" \
    -U "$PEERTUBE_USER" \
    --password "$PEERTUBE_PASSWORD" \
    --target-url "$TARGET_URL" \
    -C "huertoadictos"

Here the log server:

error[15/2/2021 17:58:41] Error in controller.

{
  "err": "TypeError [ERR_INVALID_URL]: Invalid URL: \n    at onParseError (internal/url.js:257:9)\n    at new URL (internal/url.js:333:5)\n    at Object.sanitizeUrl (/var/www/peertube/versions/peertube-v3.0.1/dist/server/helpers/core-utils.js:108:23)\n    at /var/www/peertube/versions/peertube-v3.0.1/dist/server/controllers/api/search.js:127:34\n    at Generator.next (<anonymous>)\n    at fulfilled (/var/www/peertube/versions/peertube-v3.0.1/node_modules/tslib/tslib.js:111:62)\n    at runMicrotasks (<anonymous>)\n    at processTicksAndRejections (internal/process/task_queues.js:97:5)"
}

info[15/2/2021 17:58:41] 192.168.0.23 - - [15/Feb/2021:16:58:41 +0000] "GET /api/v1/search/videos?search=%F0%9F%8C%B1%20CONSTRUIR%20SEMILLEROS%20AUTO-RIEGO%20%F0%9F%8C%B1%20-%20Huertos%20Urbanos%20e%20Invernaderos&sort=-match HTTP/1.0" 500 - "-" "-"

warn[15/2/2021 17:58:50] Incorrect request parameters

{
  "path": "/api/v1/jobs/undefined?start=0&count=10&sort=-createdAt&jobType=activitypub-follow",
  "err": {
    "state": {
      "value": "undefined",
      "msg": "Invalid value",
      "param": "state",
      "location": "params"
    }
  }
}

info[15/2/2021 17:58:50] 192.168.0.103 - - [15/Feb/2021:16:58:50 +0000] "GET /api/v1/jobs/undefined?start=0&count=10&sort=-createdAt&jobType=activitypub-follow HTTP/1.0" 400 100 "https://videos.tormentasolar.win/admin/system/jobs" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0"

I think something is missing from me, but I can’t see it.
The same channel from youtube-dl can be downloaded without problems, and the installed version is the latest:

root@peertube:~/PeerTube# ./node_modules/youtube-dl/bin/youtube-dl --version
2021.02.10
root@peertube:~/PeerTube#

where am i going wrong?

regards
MaX

Hello,

Your search index URL does not seem valid. But there is also an issue in the script I fixed in https://github.com/Chocobozzz/PeerTube/commit/d7764e2eb7e2255a42465c8b06df9a77e3710d81

Please update your CLI tools and retry