Skip to content

Instantly share code, notes, and snippets.

@antiops
Created July 31, 2022 10:32
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save antiops/4db4e04bbdc3c392a1389a5037d714d9 to your computer and use it in GitHub Desktop.
Save antiops/4db4e04bbdc3c392a1389a5037d714d9 to your computer and use it in GitHub Desktop.
AutoHotKey script to automatically download TikTok videos that are copied to your clipboard
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Persistent
; Requires yt-dlp
; You might need to change the '$HOME' and '$USERNAME' if they dont work
; $HOME = 'C:\Users\YourUsername'; $USERNAME is your windows username
ClipChanged(Type) {
If InStr(Clipboard, "https://www.tiktok.com/@")
Or InStr(Clipboard, "https://tiktok.com/@") {
Run, % "yt-dlp --config-location $HOME\.config\yt-dlp.tiktok.conf " Clipboard, , Min
}
}
Try {
Run, yt-dlp, , Min
} Catch {
If !FileExist("yt-dlp.exe") {
ExitApp, 1
}
}
OnClipboardChange("ClipChanged")
Return
-w
-c
--sleep-requests 1
--windows-filenames
--embed-metadata
--embed-thumbnail
--embed-info-json
--remux-video mkv
--download-archive "$HOME\.config\yt-dlp.tiktok.archive"
--output "C:\Users\$USERNAME\Videos\TikTok\%(uploader)s - %(title)s (%(duration)ss) [%(resolution)s] [%(extractor)s-%(id)s].%(ext)s"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment