I've got something that I want to do 5 or 6 times per day that would be nice to be able to automate.
There are various sites (twitter is one example) where I want to download the raw video. There are various sites that permit this, such as https://twdown.net/index.php
So, my idea is that I would like AutoHotkey to monitor the clipboard and trigger if a certain matching entry appears in the clipboard.
So for twitter / x, this would be if the clipboard ever contains a url starting with "https://twitter.com" or "https://x.com" and then also the string "/i/" somewhere else in that string (which indicates an image or video string):
regex: "^https://(twitter\.com|x\.com).*/i/"
Then, AutoHotkey would take over and would open https://twdown.net/index.php, then put the clipboard contents into the only input box there, press Download, then get the highest quality video on the page that opens and download that.
I think AutoHotkey is probably the best approach to doing this; any help would be appreciated.
Trigger a download when url is in the clipoard Topic is solved
Re: Trigger a download when url is in the clipoard Topic is solved
You can monitor the clipboard using OnClipboardChange.
This only does the first half of what you want:
This only does the first half of what you want:
Code: Select all
#Requires AutoHotkey v1.1.35+
#Persistent
OnClipboardChange("MonitorClipboard")
MonitorClipboard(dataType) {
; 0 = clipboard is empty.
; 1 = clipboard contains text.
; 2 = clipboard contains non-text such as a picture.
if (dataType = 1) {
if (A_Clipboard ~= "^https://(twitter\.com|x\.com).*/i/") {
Run https://twdown.net/index.php
; UIA might help with setting the input box, and pressing the download button.
; https://www.autohotkey.com/boards/viewtopic.php?f=6&t=104999
}
}
}
-
- Posts: 639
- Joined: 03 Dec 2018, 20:02
Re: Trigger a download when url is in the clipoard
There are tons of Twitter video downloader extensions. Not everything is best done using AutoHotkey.
https://chromewebstore.google.com/search/twitter%20video%20download
https://chromewebstore.google.com/search/twitter%20video%20download
Re: Trigger a download when url is in the clipoard
Thanks for the great answers, I guess it might be easier to do with the extension, and that's probably good enough, though I still want to try with the monitor clipoard code, as that would offer me the best situation of all, just right-clicking on a video and copying the video url and then AutoHotkey doing the rest would be fantastic (plus I can think of a lot of uses for clipboar monitoring).
Who is online
Users browsing this forum: AlFlo, Bing [Bot] and 139 guests