Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,21 @@ data:
modified_arg="$zurg_mount/$arg"
echo "Detected update on: $arg"
echo "Absolute path: $modified_arg"
# remove any backslashes from the path
abs_path=$(echo "$modified_arg" | sed 's/\\//g')

##### START Added by ElfHosted for auto DMM symlinking ###
echo "Symlinking $modified_arg to /storage/symlinks/real-debrid-blackhole/$arg"
echo "Symlinking $abs_path to /storage/symlinks/real-debrid-blackhole/$arg"

# Ensure blackhole exists
mkdir -p /storage/symlinks/real-debrid-blackhole/movies
mkdir -p /storage/symlinks/real-debrid-blackhole/shows

# Copy to the RD blackhole, preserving the directory structure
cp -rs "$modified_arg/"* "/storage/symlinks/real-debrid-blackhole/$(echo $arg | cut -f1 -d/)/"
cp -rsv "$abs_path"/ "/storage/symlinks/real-debrid-blackhole/$(echo $arg | cut -f1 -d/)/"
##### END Added by ElfHosted for auto DMM symlinking ###

encoded_arg=$(echo -n "$modified_arg" | python3 -c "import sys, urllib.parse as ul; print (ul.quote_plus(sys.stdin.read()))")
encoded_arg=$(echo -n "$abs_path" | python3 -c "import sys, urllib.parse as ul; print (ul.quote_plus(sys.stdin.read()))")

if [ -z "$encoded_arg" ]; then
echo "Error: Encoded argument is empty. Check the input or encoding process."
Expand Down