Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. JavaScript
    5. Dateiliste aus FTP Folder und Subfolder auslesen

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    Dateiliste aus FTP Folder und Subfolder auslesen

    This topic has been deleted. Only users with topic management privileges can see it.
    • paul53
      paul53 @gcaruso last edited by

      @gcaruso
      Was enthält die Datei video/folder_listing.txt ?

      G 1 Reply Last reply Reply Quote 0
      • G
        gcaruso @paul53 last edited by

        @paul53
        Keine Ahnung. Ich weiß nicht wo diese Datei gespeichert wird.
        Hier mein Script:

        var Client = require('ftp');
        var fs = require('fs');
         
          var c = new Client();
          c.on('ready', function() {
            c.list(function(err, list) {
              if (err) throw err;
              console.log(list);
              c.end();
            });
          });
          // connect to localhost:21
        c.connect({
          host: "192.168.***.***",
          user: "*************",
          password: "**************"
        });
        
        1 Reply Last reply Reply Quote 0
        • paul53
          paul53 @gcaruso last edited by

          @gcaruso sagte:

          die Directory Struktur sieht so aus: video-> 2020-> 08-> 10 (video->Jahr->Monat->Tag).

          Daraus kann man doch eine Pfadangabe für die letzten 20 Tage konstruieren ? Dich interessieren nur die MP4-Dateien ?

          G 1 Reply Last reply Reply Quote 0
          • G
            gcaruso @paul53 last edited by

            @paul53
            Paul du bist ein Genie. Ich habe die txt Datei gefunden. Wird in den Ordner 'video' gespeichert.

            Hier den inhalt:
            folder_listing.txt

            Ja ich brauche nur die mp4 als liste die ich im VIS anzeigen kann und einzel auswehlen.

            paul53 1 Reply Last reply Reply Quote 0
            • paul53
              paul53 @gcaruso last edited by

              @gcaruso sagte:

              Hier den inhalt:

              Bietet der Inhalt nicht das, was Du suchst ? Muss natürlich für eine Anzeige in Vis noch aufbereitet werden.

              G 2 Replies Last reply Reply Quote 0
              • G
                gcaruso @paul53 last edited by

                @paul53
                Ja genau. Das ist was ich brauche. Ich werde jetzt versuchen die Datei aufzubereiten. Onkel google hilft bestimmt.
                Nochmal vielen vielen Dank für deine Hilfe Paul.

                1 Reply Last reply Reply Quote 0
                • G
                  gcaruso @paul53 last edited by gcaruso

                  @paul53
                  Hallo Paul, ich habe es soweit hinbekommen das ich die liste auf ein String objekt (liste als json format) in iobroker regelmäßig speichere und in VIS durch ein json table widjet zeigen lasse.
                  Ich würde jetzt gerne haben das beim klicken auf eine Zeil den "Path String" vom gedruckte Zeil in eine String Objekt geschrieben wird. Hast du eine Idee wie?
                  Danke für deine Hilfe.

                  So sieht die Liste aus:

                  [{"Path":"var/www/*****/video/2020/07/23/#####_01_20200723053600.mp4","Daum":"23.07.2020 05:36:00"},{"Path":"var/www/*****/video/2020/07/23/#####_01_20200723055209.mp4","Daum":"23.07.2020 05:52:09"},{"Path":"var/www/*****/video/2020/07/23/#####_01_20200723055825.mp4","Daum":"23.07.2020 05:58:25"},{"Path":"var/www/*****/video/2020/07/23/#####_01_20200723061428.mp4","Daum":"23.07.2020 06:14:28"},{"Path":"var/www/*****/video/2020/07/23/#####_01_20200723062306.mp4","Daum":"23.07.2020 06:23:06"},{"Path":"var/www/*****/video/2020/07/23/#####_01_20200723063638.mp4","Daum":"23.07.2020 06:36:38"},{"Path":"var/www/*****/video/2020/07/23/#####_01_20200723063730.mp4","Daum":"23.07.2020 06:37:30"},{"Path":"var/www/*****/video/2020/07/23/#####_01_20200723063804.mp4","Daum":"23.07.2020 06:38:04"},{"Path":"var/www/*****/video/2020/07/23/#####_01_20200723064410.mp4","Daum":"23.07.2020 06:44:10"},{"Path":"var/www/*****/video/2020/07/23/#####_01_20200723065834.mp4","Daum":"23.07.2020 06:58:34"},{"Path":"var/www/*****/video/2020/07/23/#####_01_20200723070022.mp4","Daum":"23.07.2020 07:00:22"},{"Path":"var/www/*****/video/2020/07/23/#####_01_20200723070458.mp4","Daum":"23.07.2020 07:04:58"},{"Path":"var/www/*****/video/2020/07/23/#####_01_20200723071824.mp4","Daum":"23.07.2020 07:18:24"},{"Path":"var/www/*****/video/2020/07/23/#####_01_20200723072833.mp4","Daum":"23.07.2020 07:28:33"},{"Path":"var/www/*****/video/2020/07/23/#####_01_20200723073011.mp4","Daum":"23.07.2020 07:30:11"},{"Path":"var/www/*****/video/2020/07/23/#####_01_20200723074134.mp4","Daum":"23.07.2020 07:41:34"},{"Path":"var/www/*****/video/2020/07/23/#####_01_20200723074207.mp4","Daum":"23.07.2020 07:42:07"},{"Path":"var/www/*****/video/2020/07/23/#####_01_20200723075437.mp4","Daum":"23.07.2020 07:54:37"},{"Path":"var/www/*****/video/2020/07/23/#####_01_20200723080158.mp4","Daum":"23.07.2020 08:01:58"},{"Path":"var/www/*****/video/2020/07/23/#####_01_20200723080340.mp4","Daum":"23.07.2020 08:03:40"},{"Path":"var/www/*****/video/2020/07/23/#####_01_20200723080432.mp4","Daum":"23.07.2020 08:04:32"},{"Path":"var/www/*****/video/2020/07/23/#####_01_20200723080626.mp4","Daum":"23.07.2020 08:06:26"},{"Path":"var/www/*****/video/2020/07/23/#####_01_20200723080714.mp4","Daum":"23.07.2020 08:07:14"},{"Path":"var/www/*****/video/2020/07/23/#####_01_20200723082433.mp4","Daum":"23.07.2020 08:24:33"},{"Path":"var/www/*****/video/2020/07/23/#####_01_20200723082849.mp4","Daum":"23.07.2020 08:28:49"},{"Path":"var/www/*****/video/2020/07/23/#####_01_20200723084243.mp4","Daum":"23.07.2020 08:42:43"},]
                  

                  und so wird angezeigt:
                  json_table.PNG

                  paul53 1 Reply Last reply Reply Quote 0
                  • paul53
                    paul53 @gcaruso last edited by

                    @gcaruso sagte:

                    Hast du eine Idee wie?

                    Nein, mit Vis kenne ich mich nicht aus.

                    G 1 Reply Last reply Reply Quote 0
                    • G
                      gcaruso @paul53 last edited by

                      @paul53
                      OK danke trotzdem

                      E 1 Reply Last reply Reply Quote 0
                      • E
                        Eisbaer721 @gcaruso last edited by

                        Hallo @gcaruso
                        Ich möchte das auch so ähnlich machen wie du.
                        Ich habe auch in ein FTP Verzeichnis meine .mp4 Dateien von der Kamera gespeichert.
                        Leider bin ich nicht so fit in der Programmierung. Das meiste habe ich bisher über Blockly geregelt. 🙂
                        Könntest du mal mal bitte dein Skript ganz zeigen?
                        Ist das alles?

                        var Client = require('ftp');
                        var fs = require('fs');
                         
                          var c = new Client();
                          c.on('ready', function() {
                            c.list(function(err, list) {
                              if (err) throw err;
                              console.log(list);
                              c.end();
                            });
                          });
                          // connect to localhost:21
                        c.connect({
                          host: "192.168.***.***",
                          user: "*************",
                          password: "**************"
                        });
                        

                        z.B: Wo wird dieser Befehl eingetragen?

                        javascript.1	2020-08-09 10:10:28.895	info	(29206) script.js.FTP_Auslesen: [{'type':'d','name':'video','sticky':false,'rights':{'user':'rwx','group':'rwx','other':'rwx'},'acl':false,'owner':'*********','group':'**********','size':4096,'date'
                        
                        
                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post

                        Support us

                        ioBroker
                        Community Adapters
                        Donate

                        451
                        Online

                        31.8k
                        Users

                        80.0k
                        Topics

                        1.3m
                        Posts

                        3
                        13
                        1167
                        Loading More Posts
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes
                        Reply
                        • Reply as topic
                        Log in to reply
                        Community
                        Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                        The ioBroker Community 2014-2023
                        logo