-
Posts
8,494 -
Joined
-
Last visited
-
Days Won
708
Content Type
Blogs
Gallery
Downloads
Events
Profiles
Forums
Articles
Media Demo
Posts posted by vitor
-
-
After setting it up what do you have to every time for the workflow to work?
Nothing, that is the point. If you follow my instructions you’ll end up with a modified version of this workflow. You then just need to call it, and it’ll do everything — download the video and get the audio.
-
After making some tests, I was able to reproduce the problem. The bad news is that there is currently no way to avoid that in Alfred unless the workflow goes back to its previous, slower, mode of operation. You can understand why, then, I’m a bit thorn on this.
The problem arises from how Alfred operates, even though it’s a feature, not a bug. You’ll notice it’s not the tags themselves that get truncated, it’s the full text you type into the workflow. This happens when the script filter didn’t have time to update with everything you typed. So we need to either give it a moment before pressing return, or go back to the previous version. Needless to say, I find neither of those options optimal, but unfortunately it is also out of my control, as this is something having to do with the way workflows in Alfred work.
The optimal solution, however, would be to not have that limitation at all, and I’ve started a thread with that request, where you can voice your opinion — the more interest there is, the more likely this is to be considered/implemented. There’s also another thread with a similar request, that you can follow. -
I think I will just convert the video with osx built in encoder. Definitely faster.
I disagree. If that’s the kind of thing you do so often that you want a workflow, that doing it that way is definitely slower.
The method I’ve outlined takes longer to setup, granted, but you only have to do that once, and in the long run it’s way faster, if only because it’ll be a one step process with a single keyword, instead of a multiple step process where you have to type the keyword, wait for it to download (which varies from video to video), start another process to convert it, wait for that to finish, and delete the video. It’s a small tedious process multiple times, versus a big tedious process once.
Perceived speed is often better than actual speed, psychologically (if only to us, users of software like Alfred). “Set it and forget it” is arguably the better option — that is why workflows are great.
-
I very much second this request, although my interpretation on how it should work is slightly different.
-
There are many workflows that need configuring before being used (mainly the ones that need some type of account login/setting). However, there's no practical way of implementing that via Alfred. I find making users edit settings manually or having a separate option that'll always show in the results, for an action you typically only run once, to be non-optimal experiences.
For this purpose, I have two workflows that employ a script filter, that does something like thisif (settings_file_exists) show xml with text — “configure your account” arg — <some_string_to_let_the_script_know_it_is_a_configuration> {query} else show xml with text — “do your action” arg — {query}
Even though this works well with DownVid, since only the configuration is needed (the else part takes no input); with PinAdd, not so much.
The problem here is that since PinAdd takes {query} as the xml’s arg, if your computer is slow at the moment or you type too fast and then press return, Alfred will act immediately, without waiting for the xml to rebuild/re‐output with the updated {query}. Realistically, I only need the xml to build once, and then take the full, correct, untruncated {query} as the argument, where requested.
Perhaps script filters aren’t build around this idea, but there is clearly a need for it, as currently you only get one of the worlds — either you can show different options depending on the case but you can’t really type some action to be passed through (script filters), or you can get the action perfectly but without having options (keyword input).
My suggestion is then, perhaps instead of creating more options in script filters for specific cases, maybe create a separate category like “keyword filter” or “keyword conditional” or some better name. What this would do is allow you to specify some code to run as soon as you enter its name (much like script filters do), but this code would run only once, outputting some predefined xml, and would take a full argument passed through, much like the keyword input. -
Update.
The upload JSON was pointing to the wrong files, so you’ll need to download it again to receive further updates.
-
Change the second line to be
ls *.png | grep -v icon.png | xargs -I {} mv {} ${HOME}/Desktop/
-
Here are the instructions on how to change this workflow to get the audio from videos, instead of (or in addition to) the video.
I warn you that it may be a lengthy process (it’s not difficult, it just takes a while, specially if you do not have some things installed).
youtube-dl uses ffmpeg to extract the audio, so you likely need to install it, but I cover that in the instructions.
1. Open a terminal.
2. Install homebrew (if you don’t have it). It might ask you to install XCode’s CLI tools.ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
3. Install ffmpeg (again, if you don’t have it) by running
brew install ffmpeg
4. After it finishes, you can close the terminal.
5. Open the workflow, and after that double-click the topmost “Run Script” node.
6. At the top of the code that appears, paste thisexport PATH="/usr/local/bin:$PATH"
7. Now you’ll have to make a choice. Keep in mind that it’ll still download the video, but it’ll then extract the audio from it and delete the video (or not, that’s the choice).
8. If you want to always download only the audio, change (a few lines under getfile() {)python youtube-dl --no-playlist --newline --output "${downdir}/%(title)s.%(ext)s" "${link}" > "${progressfile}"
to
python youtube-dl --extract-audio --no-playlist --newline --output "${downdir}/%(title)s.%(ext)s" "${link}" > "${progressfile}"
If you want to keep both the audio and video, change it to
python youtube-dl --extract-audio --keep-video --no-playlist --newline --output "${downdir}/%(title)s.%(ext)s" "${link}" > "${progressfile}"
9. You can now save. You’re done.
Steps 2 and 3 can take some time, particularly 3 since it will download and compile from source (ffmpeg can take some time).
If you have any difficulty with any of the steps, please state what problems you’re having, and we can work from there. -
Thank you. There’s no need for credit, though, I outlined the steps, but you’re the one who built it.
-
Before reporting an issue with downloading, open a terminal then copy and paste the following code and press ↩:
PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}" brew upgrade yt-dlp
Then try again. If the download still fails, return to the same terminal window and run:
yt-dlp "YOUR-URL-HERE"
Replacing YOUR-URL-HERE (but keep the double quotes) with the URL that is failing. Then report the error on the yt-dlp issue tracker, as they’re the ones who’ll be able to fix the issue. The workflow relies on that tool for the downloads. -
Update.
Fixed a bug where it wouldn't delete files with single quotes in the name.
-
Usage
Download video from a plethora of online sources via the dv keyword. Download audio with da. Your clipboard and frontmost browser tab are checked for links.- ↩: Download.
- ⌘↩: Download full playlist.
- ⌥↩: Toggle adding to Watch List.
Alternatively, download with the Universal Action.
Check download progress via the dp keyword.- ⌘↩: Restart download.
- ⌃↩: Cancel.
⤓ Install on the Alfred Gallery | Source
- Damoeire, rgrtht, Sridhar Katakam and 8 others
- 11
-
Update.
Nothing major, it now gets rid of temporary files after each run (from the way it works now, adding this won’t slow it down). I prefer to leave caches and settings as clean as possible.
-
Wow, Vitor, it's crazy quick now!
I love it. I love it. I love it. I love it... THANKS!
Thanks for the update and the insight. The new version is definitely faster.
Thank you all, it’s good to know the difference is as noticeable as I hoped it’d be.
I think squiggly brackets would work but something quicker to type would be perhaps splitting the description from tags with a forward slash,
e.g. pin onetag anothertag / This is my description, and if there is no slash then there is no description.
Agreed, something quicker would be more convenient, as would be having a single separator. My only worry is to not set something that could possibly be used as a tag, that’s why I’m a fan of repeated characters for this (something like “||” or even “,,”). I’ll do some tests.
-
Thank you, thank you, thank you
I replace pbcopy to pbpaste and
change "Argument required" to "No Argument" in keyword section
Super!
Yes, I had forgotten that part. Glad you could figure it out. After you finish setting it up (maybe add an icon to it), you can share it here, if you want to.
-
I apologise, there’s a mistake there, I use “pbcopy” so much that I always write it the few times I meant to type “pbpaste”.
python webkit2png "$(pbpaste)" mv *.png ${HOME}/Desktop/
It should work now.
-
Tip.
If you change the first line to readpython webkit2png "$(pbcopy)"
then you don’t even need to type or paste the url in, just write “w2p”, and when you press return, it’ll get the URL from your clipboard.
-
Update.
It now outputs notifications (it’s nice to know the action you’ve selected got through).
When deleting files, instead of simply moving them to the trash, it uses applescript to delete them. This will give you both that satisfying “send to trash” sound and will give you greater flexibility, like having access to the Put Back option in the trash, or being able to press ⌘+Z to get the files to their original locations (you need to do it once for each file). -
Either way, it’s done. Now it’d be funny to see people coming to this thread and thinking “wait, what mistake, what was the mistake?”.
-
I tried :-/ Seems I'm no longer able to change it.
I’d say it’s because the thread is closed, but for that to be the case we shouldn’t be able to post replies, either. Maybe it’s just how the forum’s software works.
-
Ugh, maybe it's a good thing this is being closed. I just noticed that spelling mistake in the title. It'll bug me every time I look at it now
That made me laugh. If you go to your top post, pick Edit, and then Use Full Editor, you can correct the title.
-
Minor update. It now supports notifications.
-
Minor update. Some changes to the way it outputs notifications.
-
PinAdd — Takes arguments as tags, and adds your browser’s frontmost tab as a pinboard bookmark
in Share your Workflows
Posted
Sure. I’ve update the top post, in case anyone else wants it. The download link is right at the end.