-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename already downloaded files to "path-restrict": "ascii"
and continue downloading where it left off?
#6985
Comments
While there is a I think you'd be best off using a third-party tool to rename your files by replacing any characters not in |
I used this in bash.
But there are 3 more underscores in the filename than what you get with gallery-dl's It's the emoji. They're being substituted with 4 underscores, instead of just 1 underscore with gallery-dl's Please help me remove those 3 additional underscores . Thanks. |
Replacing echo "$file" | sed -e 's/[^A-Za-z0-9.]/_/g' with python -c 'import sys, re; print(re.sub(r"[^0-9A-Za-z_.]", "_", sys.argv[1]), end="")' "$file" to let Python do the replacement should help. edit: You might want to quote the
|
Create this file in test directory - Using your command,
New filename - If I just do
It looks like
17 characters. But
|
Works in my machine ™️ $ touch '💞.txt'
$ ls
💞.txt
$ for file in * ; do mv -- "$file" "$(python -c 'import sys, re; print(re.sub(r"[^0-9A-Za-z_.]", "_", sys.argv[1]), end="")' "$file")" ; done
$ ls
_.txt
$ ls | wc -c
6 # 5 characters + newline $ python -c 'import sys, re; print(re.sub(r"[^0-9A-Za-z_.]", "_", sys.argv[1]), end="")' '💞.txt' | wc -c
5 |
This looks like the start of an ANSI escape sequence, but I might be wrong. |
Thanks @mikf it works! Had to update bash. |
Yup, ANSI escape sequence. |
I downloaded a lot but only discovered the
"path-restrict": "ascii"
option much later.Is there a way to tell gallery-dl to rename all files in a given directory to
"path-restrict": "ascii"
(including.part
files) and then continue the download where it left off?Thanks!
The text was updated successfully, but these errors were encountered: