✨ feat(systemd): downloadPinterest service and script
using gallerydl
This commit is contained in:
parent
f5bc67386a
commit
dc1cf35403
3 changed files with 45 additions and 0 deletions
11
.config/systemd/user/downloadPinterest.service
Normal file
11
.config/systemd/user/downloadPinterest.service
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Description=Download Pinterest Boards
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
ExecStart=/home/matt/.local/bin/downloadPinterest
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=default.target
|
10
.config/systemd/user/downloadPinterest.timer
Normal file
10
.config/systemd/user/downloadPinterest.timer
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Run Pinterest Downloader Sync Weekly
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnCalendar=*-*-* 17:00:00
|
||||||
|
Persistent=true
|
||||||
|
Unit=downloadPinterest.service
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
24
.local/bin/downloadPinterest
Executable file
24
.local/bin/downloadPinterest
Executable file
|
@ -0,0 +1,24 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
image_folder="$HOME/Images/"
|
||||||
|
video_folder="$HOME/Videos/"
|
||||||
|
|
||||||
|
notify() {
|
||||||
|
notify-send "Pinterest Sync" "$1" -i ~/.local/share/icons/Catppuccin-SE/64x64/mimetypes/application-x-partial-download.svg --app-name=Pinterest
|
||||||
|
}
|
||||||
|
|
||||||
|
if ! command -v gallery-dl &>/dev/null; then
|
||||||
|
notify "Error: gallery-dl is not installed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
notify "Started syncing..."
|
||||||
|
|
||||||
|
while [ "$1" != "" ]; do
|
||||||
|
gallery-dl -d "$image_folder" --download-archive "$image_folder/pinterest/downloads.sqlite3" "$1" --filter "extension not in ('mp4', 'gif')"
|
||||||
|
gallery-dl -d "$video_folder" --download-archive "$video_folder/pinterest/downloads.sqlite3" "$1" --filter "extension in ('mp4', 'gif')"
|
||||||
|
notify "Synced $1"
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
notify "Pinterest Sync Complete"
|
Loading…
Add table
Reference in a new issue