Solved PeerTube CLI
-
-
-
@imc67 I thought the CLI was something that we install on the desktop and not the server itself? Are you looking to automate something via the CLI + cron ? That might need some specialized package support. Let me know your use case so I can fix up the package accordingly.
-
@girish I was thinking about this for example: https://docs.joinpeertube.org/#/maintain-tools?id=peertube-import-videosjs
It must be possible to install it on a different server but it's rather download 1TB of YT videos to 'a server' and upload it again to the PeerTube app. That's why I thought about having CLI in the app.
There is also an example of Cron jobs, is that possible in the app?
-
@imc67 I wonder if we should talk to the upstream project on providing CLI as a separate release package. There is some discussion at https://github.com/Chocobozzz/PeerTube/issues/2347 . Should we leave a note there and see what he says?
-
I managed to get the CLI installed but installing plugins is still a mystery. This is because the CLI can only be installed by
cd
into the CLI workdir. And then to install it has to somehow install into the release package. Not sure how this is done. -
Hi @girish , I discovered PeerTube since it was announced here and was very enthusiastic because it fits in our needs. However during the past 6 weeks I'm beginning to loose faith in this project.
The project has a very slow "beat", they write they have only 1 (paid) developer. We had to wait 5 weeks to get an essential bug (not able to config) solved. After your last update it looked fine and I started to setup everything but then discovered a "stupid" bug again: videos don't play on iPad (https://github.com/Chocobozzz/PeerTube/issues/2941)! The developer knows this for at least 3 weeks but there seems no investigation/progress. Most of our viewers use iPad so we can't start (again) ...
There is also a very annoying issue that themes are alternating switching during browsing, so 1 click you're in dark mode and the next one in light mode (https://github.com/Chocobozzz/PeerTube/issues/3007). Beside that there are 350 other open issues ...I spent hours to find an alternative (I know Cloudron always have two apps of the same "kind") and found: https://platform.avideo.com/AVideo_OpenSource (https://github.com/WWBN/AVideo/blob/master/README.md) I will create an App request with this info.
Kind regards,
Marcel.
-
@imc67 said in PeerTube CLI:
I will create an App request with this info.
-
@imc67 They seem to have fixed the iPad issue - https://github.com/Chocobozzz/PeerTube/commit/b6a8cfc5714c93d0ecf6154e5d3a25b33b50b8cd
-
@girish this morning they released 2.4.0 adding many features and solving even more bugs of which 2 of them where blocking for us
-
@imc67
Yup, got a notification for it, very nice!
-
@imc67 BTW, did you manage to import your videos or is it in hold?
-
@girish I uploaded (via YT URL) 1 video just to test. Then discovered the, for us blocking issues and since then waiting for the update.
However, I remember that importing a YT playlist by URL didn’t seem to work (nothing happened). So I really prefer a build in CLI to do this.
-
@imc67 said in PeerTube CLI:
@girish this morning they released 2.4.0 adding many features and solving even more bugs of which 2 of them where blocking for us
Friendly reminder
-
@imc67 Noted
I will get to this next week though since we are rolling out 5.6 this week. But I am very interested in getting that app to stable state asap.
-
Also interested in the cli to be able to relaunch transcoding jobs
example :
sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-transcoding-job -- --generate-hls -v c249320b-5263-4b2b-b1e8-14d07403079c -
@girish friendly reminder
-
@imc67 I pushed a new package with youtube-dl and the CLI installed. Do you require the cron support?
-
I tried (in the 0.7 version) the following command:
sudo -u root NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-transcoding-job -- -v b8b791eb-9e38-4c4f-b797-0347662bb45f
but this error returns:
sudo: npm: command not found
Is the path in the command ok?
-
peertube as many other apps should ideally run with the
cloudron
user, so maybe try that user instead of root. -
@nebulon same result
sudo -u cloudron NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-transcoding-job -- -v db21c654-6ca3-470e-b6a0-0f31bbcb3c37 sudo: npm: command not found
-
Ah sudo apparently does not carry over the env bits for this. So instead use
gosu cloudron:cloudron npm ...
that should do. -
@nebulon said in PeerTube CLI:
gosu cloudron:cloudron
getting one step closer but still an error:
gosu cloudron:cloudron NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-transcoding-job -- -v db21c654-6ca3-470e-b6a0-0f31bbcb3c37 error: exec: "NODE_CONFIG_DIR=/var/www/peertube/config": stat NODE_CONFIG_DIR=/var/www/peertube/config: no such file or directory
-
NODE_CONFIG_DIR
is already properly set in the environment pointing to/app/code/server/config
so remove that from your commandline. -
@nebulon again one step closer, but...
/app/code/server# gosu cloudron:cloudron NODE_ENV=production npm run create-transcoding-job -- -v db21c654-6ca3-470e-b6a0-0f31bbcb3c37 error: exec: "NODE_ENV=production": executable file not found in $PATHwith the current size.
-
All my docs go unread
it's just
peertube
-
Oh haha, great https://docs.cloudron.io/apps/peertube/
-
@girish stupid me!
-
it seems to work here :
and transcoding works too :
the "solution" is to disable HLS
Requires ffmpeg >= 4.1
Generate HLS playlists and fragmented MP4 files resulting in a better playback than with the current default player:
Resolution change is smoother Faster playback in particular with long videos More stable playback (less bugs/infinite loading)
If you also enabled WebTorrent support, it will multiply videos storage by 2
-
@rmdes HLS seems to be messy.
is ffmpeg not >=4.1 by default?
does HLS being enabled mean the fragmented MP4 and original are in place? That already means 2x the original.
What is it about WebTorrent that 2x that even more?
-
@robi I have no idea about all 3 questions
-
Fresh update with the latest version on a fresh cloudron :
when I follow the doc here : https://docs.cloudron.io/apps/peertube/ to import a video from cli
I getpeertube import --url https://domain.com --username user --password bloodypass --target-url https://www.youtube.com/watch?v=xxxx --tmpdir /tmp
the shell returns this :
--username field is required
--password field is requiredAnything changed perhaps for the cli & latest peertube version ?
-
So the peertube cli has now a neat feature to remember instances it is being used to upload from the cli :
peertube auth :
add [options] remember your accounts on remote instances for easier use
del <url> unregisters a remote instance
list lists registered remote instances
set-default <url> set an existing entry as default
help [command] display help for commandExamples:
$ peertube auth add -u https://peertube.cpy.re -U "PEERTUBE_USER" --password "PEERTUBE_PASSWORD" $ peertube auth add -u https://peertube.cpy.re -U root $ peertube auth list $ peertube auth del https://peertube.cpy.re
When I try to use it, I get this :
node:internal/process/promises:246 triggerUncaughtException(err, true /* fromPromise */); ^ [Error: ENOENT: no such file or directory, mkdir '/root/.config'] { errno: -2, code: 'ENOENT', syscall: 'mkdir', path: '/root/.config' }
-
@rmdes looks like it now requires a config file. Obviously on Cloudron that path is not writeable. Have you checked if the config file may be specified via environment variable or commandline argument?
-
@nebulon I tried to find this information but up to now I have nothing
-
@nebulon from what I can see here : https://docs.joinpeertube.org/maintain-tools?id=remote-tools
or better here : https://docs.joinpeertube.org/maintain-tools?id=server-toolsThere is nothing that indicate how to specify this on the command line.
-
@rmdes is there a -C option?
-
Just debugged this a bit . It seems the CLI uses
application-config
npm package which writes configs to https://www.npmjs.com/package/application-config#config-location . -
@rmdes it seems the CLI is broken: upstream issue is https://github.com/Chocobozzz/PeerTube/issues/4858 . I will make a new package with the patch since it makes the CLI unusable without it.