metube icon indicating copy to clipboard operation
metube copied to clipboard

dont delete file

Open Goten87 opened this issue 3 years ago • 13 comments

when i click the trashcan in the webui the file still stays on my local server is there a way then when i press that trashcan on compleeted/failed items it will delete the item also in my folder

also a beter way to download to a other pc is needed now it opens the file in a player i want it to popup a where to save window when you click the name of the download

Goten87 avatar Jan 17 '22 15:01 Goten87

Regarding the trashcan, I personally prefer it this way, but perhaps there can be an additional icon for removing it from the server. Regarding downloading the file, you can right-click the link and select "Save link as.." to save it.

alexta69 avatar Jan 17 '22 17:01 alexta69

Yeah a way to delete from server will be nice Well I sayed about the save function becose I have other people using it in house as well who are not realy technical that’s why I wanted it to be more easy

Goten87 avatar Jan 17 '22 19:01 Goten87

I agree that the trashcan should delete the file from the server, or at least an environmental var to control the behavior.

xorguy avatar Feb 05 '22 17:02 xorguy

In my environment, I'm more concerned about temporary files (.part/.ytdl) which generated after download failures, or audio/video merge failures. Is there a way to delete them automatically, or delete them while click trashcan?

PikuZheng avatar Feb 10 '22 11:02 PikuZheng

In my environment, I'm more concerned about temporary files (.part/.ytdl) which generated after download failures, or audio/video merge failures. Is there a way to delete them automatically, or delete them while click trashcan?

MeTube tries to delete the temp files in case of an error. Maybe there are some cases where it doesn't work, MeTube relies on yt-dlp to tell it which temp files exist.. I hope the check is correct. Perhaps it's worth it to review the code and see if anything is being missed.

alexta69 avatar Feb 10 '22 19:02 alexta69

To download the file instead of opening it in player, you can add this into nginx config:

    location ~* ^/.+\.(?:mp4|mp3)$ {
       ...

       add_header Content-disposition "attachment; filename=$1";
       default_type application/octet-stream;

       set $upstream_app metube;
       set $upstream_port 8081;
       set $upstream_proto http;
       proxy_pass $upstream_proto://$upstream_app:$upstream_port;
    }

buzzdev avatar Feb 15 '22 10:02 buzzdev

I don’t think the project uses nginx to host website

Goten87 avatar Feb 15 '22 11:02 Goten87

Perhaps it will work if you host MeTube behind an NGINX reverse proxy...

alexta69 avatar Feb 15 '22 11:02 alexta69

@Goten87 you don't wont to expose this project directly to internet, you'd better use a reverse proxy. It might be nginx, where the config snippet is from.

I use SWAG for that matter: https://docs.linuxserver.io/general/swag They even have a ready made proxy conf for metube.

The mimetype is anyway handled by a webserver, however i am not that familiar with the metube internals, but perhaps the correct header could also be set on its internal webserver.

buzzdev avatar Feb 15 '22 11:02 buzzdev

@buzzdev can i use that without a hostname (i want it to be /metube for example) is this posible or do i need a domein name to use it also i will not let it go to the outside of my network sins its for internal use only

Goten87 avatar Feb 16 '22 13:02 Goten87

@Goten87 i have them under docker-compose and they use the internal service names (if that's what you mean). The swag has an example config for metube in subdir or subdomain. https://github.com/linuxserver/reverse-proxy-confs/blob/master/metube.subdomain.conf.sample https://github.com/linuxserver/reverse-proxy-confs/blob/master/metube.subfolder.conf.sample

I use subdomain in my docker-compose.yml:

version: "2.1"
services:
  metube:
    image: ghcr.io/<user>/<image> # i use my own image on ghcr
    container_name: metube
    restart: unless-stopped
    #user: "1000:1000"
    ports:
      - "8081:8081"
    #volumes:
    #  - /your/dir/downloads:/downloads
    environment:
      - OUTPUT_TEMPLATE=%(channel)s-%(id)s.%(ext)s

  swag:
    image: ghcr.io/linuxserver/swag
    container_name: swag
    cap_add:
      - NET_ADMIN
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Bratislava
      - URL=<your_domain>
      - SUBDOMAINS=<your_subdomain>
      - ONLY_SUBDOMAINS=true #optional
      - VALIDATION=http
      - EMAIL=<[email protected]> #optional
      - STAGING=false #optional
      #- CERTPROVIDER= #optional
      #- DNSPLUGIN=cloudflare #optional
      # - DUCKDNSTOKEN=<token> #optional
      #- EXTRA_DOMAINS=<extradomains> #optional
    volumes:
      - /your/dir/swag/config:/config
    ports:
      - 443:443
      - 80:80 # optional
    restart: unless-stopped

buzzdev avatar Feb 16 '22 14:02 buzzdev

well my modem right now is a little derp sins it cannot see the names of devices so i cannot go to for example to test-server it will not work at all

Goten87 avatar Feb 16 '22 14:02 Goten87

Another vote for deleting the actual file from the server. The GUI should represent the files available, if I delete a completed download one would expect the file to also be removed.

LukePWilkins avatar Sep 05 '22 22:09 LukePWilkins

Yes, the fact that the delete function does not do its job is a bit annoying. I will write a script (shell/bash) to automatically find, copy and move as well as set user and group rights. I will make it available this week - if it is user-friendly! °)

MTrage avatar Oct 11 '22 22:10 MTrage

Please add the ability to delete files from the server

baerni avatar Nov 12 '22 15:11 baerni

+1 I expected the delete button to actual delete file from disk. A different button should "hide" past downloads from list if thats the intent.

TheLinuxGuy avatar Nov 21 '22 07:11 TheLinuxGuy

An alternative is to not define the volume (in docker-compose.yml) to store the downloaded files. Then, I update my container images via a cronjob with

docker compose down
docker volume prune -f
docker compose pull
docker compose up -d

This is not ideal, but it regularly clears metube's /downloads volume and therefore the downloaded files.

schklom avatar Dec 07 '22 16:12 schklom