Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Solved PeerTube CLI

    PeerTube
    5
    39
    579
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • imc67
      imc67 translator @girish last edited by

      @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?

      1 Reply Last reply Reply Quote 1
      • girish
        girish Staff last edited by girish

        @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?

        1 Reply Last reply Reply Quote 1
        • girish
          girish Staff last edited by

          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.

          imc67 1 Reply Last reply Reply Quote 0
          • imc67
            imc67 translator @girish last edited by imc67

            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 1 Reply Last reply Reply Quote 1
            • imc67
              imc67 translator @imc67 last edited by

              @imc67 said in PeerTube CLI:

              I will create an App request with this info.

              https://forum.cloudron.io/topic/2944/avideo-platform

              1 Reply Last reply Reply Quote 1
              • girish
                girish Staff last edited by

                @imc67 They seem to have fixed the iPad issue - https://github.com/Chocobozzz/PeerTube/commit/b6a8cfc5714c93d0ecf6154e5d3a25b33b50b8cd

                imc67 1 Reply Last reply Reply Quote 2
                • imc67
                  imc67 translator @girish last edited by

                  @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 1 Reply Last reply Reply Quote 2
                  • girish
                    girish Staff last edited by

                    @imc67 👍 Yup, got a notification for it, very nice!

                    1 Reply Last reply Reply Quote 0
                    • girish
                      girish Staff last edited by

                      @imc67 BTW, did you manage to import your videos or is it in hold?

                      imc67 1 Reply Last reply Reply Quote 0
                      • imc67
                        imc67 translator @girish last edited by

                        @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.

                        1 Reply Last reply Reply Quote 0
                        • imc67
                          imc67 translator @imc67 last edited by

                          @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 😀

                          girish 1 Reply Last reply Reply Quote 0
                          • girish
                            girish Staff @imc67 last edited by

                            @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.

                            imc67 1 Reply Last reply Reply Quote 0
                            • rmdes
                              rmdes last edited by

                              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

                              from : https://github.com/Chocobozzz/PeerTube/issues/3121

                              1 Reply Last reply Reply Quote 0
                              • imc67
                                imc67 translator @girish last edited by

                                @girish friendly reminder

                                1 Reply Last reply Reply Quote 1
                                • girish
                                  girish Staff last edited by

                                  @imc67 I pushed a new package with youtube-dl and the CLI installed. Do you require the cron support?

                                  1 Reply Last reply Reply Quote 1
                                  • imc67
                                    imc67 translator last edited by

                                    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?

                                    1 Reply Last reply Reply Quote 0
                                    • nebulon
                                      nebulon Staff last edited by

                                      peertube as many other apps should ideally run with the cloudron user, so maybe try that user instead of root.

                                      imc67 1 Reply Last reply Reply Quote 1
                                      • imc67
                                        imc67 translator @nebulon last edited by

                                        @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
                                        
                                        1 Reply Last reply Reply Quote 0
                                        • nebulon
                                          nebulon Staff last edited by

                                          Ah sudo apparently does not carry over the env bits for this. So instead use gosu cloudron:cloudron npm ... that should do.

                                          imc67 1 Reply Last reply Reply Quote 1
                                          • imc67
                                            imc67 translator @nebulon last edited by

                                            @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
                                            
                                            1 Reply Last reply Reply Quote 0
                                            • nebulon
                                              nebulon Staff last edited by

                                              NODE_CONFIG_DIR is already properly set in the environment pointing to /app/code/server/config so remove that from your commandline.

                                              imc67 1 Reply Last reply Reply Quote 0
                                              • imc67
                                                imc67 translator @nebulon last edited by

                                                @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.
                                                
                                                1 Reply Last reply Reply Quote 0
                                                • girish
                                                  girish Staff last edited by

                                                  All my docs go unread 🙂 it's just peertube

                                                  imc67 1 Reply Last reply Reply Quote 1
                                                  • nebulon
                                                    nebulon Staff last edited by

                                                    Oh haha, great https://docs.cloudron.io/apps/peertube/

                                                    1 Reply Last reply Reply Quote 0
                                                    • imc67
                                                      imc67 translator @girish last edited by

                                                      @girish stupid me!

                                                      1 Reply Last reply Reply Quote 0
                                                      • rmdes
                                                        rmdes last edited by rmdes

                                                        it seems to work here :
                                                        e7e48dfb-76d8-42d3-a9d0-c52d63219dc4-image.png

                                                        and transcoding works too :
                                                        32b8181f-75a6-41a4-9763-2413fb69dc31-image.png

                                                        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

                                                        robi 1 Reply Last reply Reply Quote 2
                                                        • robi
                                                          robi @rmdes last edited by

                                                          @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?

                                                          Life of Gratitude.
                                                          Life of Advanced Technology

                                                          rmdes 1 Reply Last reply Reply Quote 0
                                                          • rmdes
                                                            rmdes @robi last edited by

                                                            @robi I have no idea about all 3 questions 😕

                                                            rmdes 1 Reply Last reply Reply Quote 0
                                                            • rmdes
                                                              rmdes @rmdes last edited by

                                                              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 get

                                                              peertube 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 required

                                                              Anything changed perhaps for the cli & latest peertube version ?

                                                              rmdes girish 2 Replies Last reply Reply Quote 0
                                                              • rmdes
                                                                rmdes @rmdes last edited by

                                                                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 command

                                                                Examples:

                                                                $ 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'
                                                                }
                                                                

                                                                2290608d-fca4-4144-9db7-f122191320ca-image.png

                                                                nebulon 1 Reply Last reply Reply Quote 0
                                                                • nebulon
                                                                  nebulon Staff @rmdes last edited by

                                                                  @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?

                                                                  rmdes 2 Replies Last reply Reply Quote 1
                                                                  • rmdes
                                                                    rmdes @nebulon last edited by

                                                                    @nebulon I tried to find this information but up to now I have nothing 😕

                                                                    1 Reply Last reply Reply Quote 0
                                                                    • rmdes
                                                                      rmdes @nebulon last edited by

                                                                      @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-tools

                                                                      There is nothing that indicate how to specify this on the command line.

                                                                      robi 1 Reply Last reply Reply Quote 0
                                                                      • robi
                                                                        robi @rmdes last edited by

                                                                        @rmdes is there a -C option?

                                                                        Life of Gratitude.
                                                                        Life of Advanced Technology

                                                                        1 Reply Last reply Reply Quote 0
                                                                        • girish
                                                                          girish Staff last edited by

                                                                          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 .

                                                                          1 Reply Last reply Reply Quote 0
                                                                          • girish
                                                                            girish Staff @rmdes last edited by

                                                                            @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.

                                                                            1 Reply Last reply Reply Quote 2
                                                                            • First post
                                                                              Last post
                                                                            Powered by NodeBB