diff --git a/README.md b/README.md index 170d2f56..ba7d5195 100644 --- a/README.md +++ b/README.md @@ -812,6 +812,7 @@ you can also zip a selection of files or folders by clicking them in the browser cool trick: download a folder by appending url-params `?tar&opus` or `?tar&mp3` to transcode all audio files (except aac|m4a|mp3|ogg|opus|wma) to opus/mp3 before they're added to the archive * super useful if you're 5 minutes away from takeoff and realize you don't have any music on your phone but your server only has flac files and downloading those will burn through all your data + there wouldn't be enough time anyways +* and url-param `&nodot` skips dotfiles/dotfolders; they are included by default if your account has permission to see them * and url-params `&j` / `&w` produce jpeg/webm thumbnails/spectrograms instead of the original audio/video/images (`&p` for audio waveforms) * can also be used to pregenerate thumbnails; combine with `--th-maxage=9999999` or `--th-clean=0` diff --git a/copyparty/authsrv.py b/copyparty/authsrv.py index 06507344..ccbe5fd5 100644 --- a/copyparty/authsrv.py +++ b/copyparty/authsrv.py @@ -896,6 +896,7 @@ class VFS(object): flt: set[str], uname: str, dirs: bool, + dots: int, scandir: bool, wrap: bool = True, ) -> Generator[dict[str, Any], None, None]: @@ -904,7 +905,7 @@ class VFS(object): # if single folder: the folder itself is the top-level item folder = "" if flt or not wrap else (vpath.split("/")[-1].lstrip(".") or "top") - g = self.walk(folder, vrem, [], uname, [[True, False]], 1, scandir, False) + g = self.walk(folder, vrem, [], uname, [[True, False]], dots, scandir, False) for _, _, vpath, apath, files, rd, vd in g: if flt: files = [x for x in files if x[0] in flt] diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 9fa05b0a..db18bb1f 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -1779,6 +1779,7 @@ class HttpCli(object): set(), self.uname, True, + 1, not self.args.no_scandir, wrap=False, ) @@ -5014,6 +5015,9 @@ class HttpCli(object): packer = StreamZip ext = "zip" + dots = 0 if "nodot" in self.uparam else 1 + scandir = not self.args.no_scandir + fn = self.vpath.split("/")[-1] or self.host.split(":")[0] if items: fn = "sel-" + fn @@ -5025,9 +5029,7 @@ class HttpCli(object): maxn = vn.flags.get("zipmaxn_v") or 0 nf = 0 nb = 0 - fgen = vn.zipgen( - vpath, rem, set(items), self.uname, False, not self.args.no_scandir - ) + fgen = vn.zipgen(vpath, rem, set(items), self.uname, False, dots, scandir) t = "total size exceeds a limit specified in server config" t = vn.flags.get("zipmaxt") or t if maxs and maxn: @@ -5051,9 +5053,7 @@ class HttpCli(object): self.log(repr(cdis)) self.send_headers(None, mime=mime, headers={"Content-Disposition": cdis}) - fgen = vn.zipgen( - vpath, rem, set(items), self.uname, False, not self.args.no_scandir - ) + fgen = vn.zipgen(vpath, rem, set(items), self.uname, False, dots, scandir) # for f in fgen: print(repr({k: f[k] for k in ["vp", "ap"]})) cfmt = "" if self.thumbcli and not self.args.no_bacode: