enigma2k Posted May 27, 2014 Posted May 27, 2014 There is not, enigma2k, although I agree it would sometimes be nice. This is an issue of implementation, above anything else; if there was a good way to do it, I’d definitely look into it. I've stumbled upon another workflow that shows you the download progress. You may get an idea from there: http://www.alfredforum.com/topic/2680-search-download-and-install-mac-apps/
vitor Posted May 27, 2014 Author Posted May 27, 2014 I've stumbled upon another workflow that shows you the download progress. You may get an idea from there: http://www.alfredforum.com/topic/2680-search-download-and-install-mac-apps/ Unfortunately, that’s what I consider to not be a good way to do it. It might be fine when downloading a single application, but when downloading video after video (which I regularly do), having a GUI bar appear is really suboptimal and ugly. That is a solution I won’t pursue.
vitor Posted July 1, 2014 Author Posted July 1, 2014 Update. Some changes to the way additions are made to WatchList. Downloads are prepended, instead of appended, and are only added at the end of the download.
vitor Posted August 12, 2014 Author Posted August 12, 2014 Update. Added option to show download progress (dvp). Also fixed a bug with showing the initial download message when saving to the desktop.
lip5016 Posted October 2, 2014 Posted October 2, 2014 Update. Added option to show download progress (dvp). Also fixed a bug with showing the initial download message when saving to the desktop. Is there any way to download more than 1 link at a time without having to wait for each one to finish?
lip5016 Posted October 2, 2014 Posted October 2, 2014 Is there any way to download more than 1 link at a time without having to wait for each one to finish? also, is there a way it keeps track of it when i'm going through several links and employing download? like i noticed that just after one finishes downloading, if i had ran it again during that period, the next one in the queue will start.. was wondering if it's a "running queue" and will continually keep downloading them on it's own or if i have to be patient and do each one at a time while keeping the page open? (also, can i close the page after downloading begins?) thanks vitor!
vitor Posted October 3, 2014 Author Posted October 3, 2014 Just keep adding links normally. You don’t need to do anything else, it’ll keep a queue just fine.
vitor Posted October 21, 2014 Author Posted October 21, 2014 Update. Added option to restart downloads (⌘ modifier in dvp). This is useful if the download gets stuck for some reason (like the network connection going down), and will add the download to the back of the queue.
ghani1990 Posted October 30, 2014 Posted October 30, 2014 This is a wonderfulBut I want to download the video with a download manager such as folx or igetter Is there a solution to send the video url to one of these apps? ?
vitor Posted October 30, 2014 Author Posted October 30, 2014 Possibly. I won’t implement it, though, as that would complicate the interface disproportionally to the feature’s desirability.
ghani1990 Posted October 31, 2014 Posted October 31, 2014 Could you give me a hint on how to do it ?? and I will change it My connection is very slow and I want to use Download Accelerator. thanx (Please excuse my poor English)
vitor Posted October 31, 2014 Author Posted October 31, 2014 ghani1990 youtube-dl has a --get-url option that should get the direct url to the download file, instead of downloading it. In the Run Script node on the top right, there’s a getfile function you’ll need to change to accommodate this. It’s likely here that you should write your logic to open said url in your download accelerator. I don’t use (or have any interest in) any of those download accelerators and they’re paid apps, so this is as far as I’ll go.
vitor Posted December 4, 2014 Author Posted December 4, 2014 Update. OS X Services. You can now add DownVid actions as OS X Services, by running “installdownvidservices” (if you ever want to remove them, simply delete them from the ~/Library/Services directory). What this means is wherever you find a URL, you’ll be able to right click it and start the download right from the context menu.
meflou Posted December 6, 2014 Posted December 6, 2014 How can I change the destination folder from desktop to downloads?
scottfwalter Posted December 7, 2014 Posted December 7, 2014 Apparently youtube doesn't know what *best* quality means. Even though there was a 1080p version of a video it downloaded the 720p version: format code extension resolution note 139 m4a audio only DASH audio 49k , audio@ 48k (22050Hz), 581.15KiB (worst) 140 m4a audio only DASH audio 129k , audio@128k (44100Hz), 1.51MiB 171 webm audio only DASH audio 132k , audio@128k (44100Hz), 1.30MiB 172 webm audio only DASH audio 193k , audio@256k (44100Hz), 1.90MiB 141 m4a audio only DASH audio 255k , audio@256k (44100Hz), 2.99MiB 278 webm 256x144 DASH video 97k , webm container, VP9, video only, 593.79KiB 160 mp4 256x144 DASH video 121k , video only, 1.17MiB 242 webm 426x240 DASH video 215k , video only, 1.05MiB 133 mp4 426x240 DASH video 296k , video only, 2.63MiB 243 webm 640x360 DASH video 382k , video only, 1.89MiB 134 mp4 640x360 DASH video 354k , video only, 2.26MiB 244 webm 854x480 DASH video 614k , video only, 3.04MiB 135 mp4 854x480 DASH video 676k , video only, 4.67MiB 247 webm 1280x720 DASH video 1161k , video only, 5.82MiB 136 mp4 1280x720 DASH video 1221k , video only, 9.26MiB 248 webm 1920x1080 DASH video 2010k , video only, 10.77MiB 137 mp4 1920x1080 DASH video 2342k , video only, 18.47MiB 17 3gp 176x144 36 3gp 320x240 5 flv 400x240 43 webm 640x360 18 mp4 640x360 22 mp4 1280x720 (best) I added this flag into the getfile method to get it to download a 1080p version: -f 137/22/18/17
vitor Posted December 8, 2014 Author Posted December 8, 2014 (edited) meflou Open the Run Script node on the top right. Very near the end you’ll find a line that reads downdir="${HOME}/Desktop"; change it to downdir="${HOME}/Downloads". Alternatively, if you have WatchList and add to it via this workflow, it’ll default to that directory. scottfwalter. Not sure if the fault lies with youtube-dl or youtube, on that one. It’s more likely the former’s fault, though, so you should open a bug report. This workflow simply uses the default (supposedly the best). Edited December 8, 2014 by Vítor meflou 1
meflou Posted December 10, 2014 Posted December 10, 2014 meflou Open the Run Script node on the top right. Very near the end you’ll find a line that reads downdir="${HOME}/Desktop"; change it to downdir="${HOME}/Downloads". Alternatively, if you have WatchList and add to it via this workflow, it’ll default to that directory. When I download any file it got the format nameofvideo.mp4.part so every time I have to delete .part to be able to read the video, how can I fix this? Also I changed the path to downdir=" /Users/q/Downloads/Downloads/Videos" but still it download them to Downloads not to Videos under the folder downloads. Thank You!
vitor Posted December 10, 2014 Author Posted December 10, 2014 (edited) When I download any file it got the format nameofvideo.mp4.part That should be only temporary, until the video finishes downloading. That way you know the download hasn’t finished, and can even continue it later, if it interrupts for some reason. Also I changed the path to downdir="/Users/q/Downloads/Downloads/Videos" You have Downloads twice (…/Downloads/Downloads/…), there, don’t you mean downdir="${HOME}/Downloads/Videos"? You can use ${HOME} literally; it’ll know what it means. To make sure the directory you want to download to exists, you can open a terminal and run mkdir -p <path_to_directory>. Edited December 10, 2014 by Vítor meflou 1
vitor Posted December 15, 2014 Author Posted December 15, 2014 Update. This new version is prepared to handle the new list format in WatchList. If you use WatchList, you should update it at the same time.
vitor Posted December 15, 2014 Author Posted December 15, 2014 Update. Small fix for previous update (changes were made to WatchList, since).
jarhead Posted April 28, 2015 Posted April 28, 2015 Fantastic workflow (not surprising really coming from you Vitor)... I'm having an issue where I followed the steps to keep video & audio and it works. For some reason, it creates a second version of both the video & audio. For example, using the workflow, it downloaded a video called "Best DIY GoPro Mounts.mp4"... it also created another version entitled "Best DIY GoPro Mounts.f136.mp4". It does the same with the audio... two m4a versions one including .f141.m4a. I just added --extract-audio --keep-video --quiet The script I'm using for dv following the instructions... export PATH="/usr/local/bin:$PATH" # deal with special characters export LANG=en_GB.UTF-8 IFS=$'\n' # set notifications notification() { ./_licensed/terminal-notifier/terminal-notifier.app/Contents/MacOS/terminal-notifier -title "DownVid" -message "${1}" } # update youtube-dl if it's more than 15 days old if [[ $(find youtube-dl -mtime +15) ]]; then python youtube-dl --update fi gettitle() { # file location filename=$(python youtube-dl --no-playlist --extract-audio --keep-video --quiet --output "${downdir}/%(title)s.%(ext)s" --get-filename "${link}") # title title=$(basename ${filename%.*}) # check if url is valid if [[ -z "${filename}" ]]; then notification "The url is invalid" exit 1 else notification "Downloading “${title}”" fi } getfile() { progressfile="/tmp/downvidprogress" python youtube-dl --no-playlist --extract-audio --keep-video --quiet --newline --output "${downdir}/%(title)s.%(ext)s" "${link}" > "${progressfile}" # add metadata xmlencodedurl=$(echo "${link}" | perl -MHTML::Entities -CS -pe'$_ = encode_entities($_, q{&<>"'\''})') xattr -w com.apple.metadata:kMDItemWhereFroms '<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><array><string>'"${xmlencodedurl}"'</string></array></plist>' "${filename}" rm "${progressfile}" } # download printf "{query}" > "/tmp/downvidcurrentquery" if [[ "{query}" == "addToWatchList"* ]]; then link=$(cat "$(echo {query} | sed 's/addToWatchList //')") downdir="${HOME}/Downloads" gettitle getfile osascript -e "tell application \"Alfred 2\" to run trigger \"add_to_watchlist\" in workflow \"com.vitorgalvao.alfred.watchlist\" with argument \"${filename}\"" else link="$(cat {query})" downdir="${HOME}/Desktop" gettitle getfile fi notification "Downloaded “${title}”"
jarhead Posted April 28, 2015 Posted April 28, 2015 Fantastic workflow (not surprising really coming from you Vitor)... I'm having an issue where I followed the steps to keep video & audio and it works. For some reason, it creates a second version of both the video & audio. For example, using the workflow, it downloaded a video called "Best DIY GoPro Mounts.mp4"... it also created another version entitled "Best DIY GoPro Mounts.f136.mp4". It does the same with the audio... two m4a versions one including .f141.m4a. I just added --extract-audio --keep-video --quiet The script I'm using for dv following the instructions... export PATH="/usr/local/bin:$PATH" # deal with special characters export LANG=en_GB.UTF-8 IFS=$'\n' # set notifications notification() { ./_licensed/terminal-notifier/terminal-notifier.app/Contents/MacOS/terminal-notifier -title "DownVid" -message "${1}" } # update youtube-dl if it's more than 15 days old if [[ $(find youtube-dl -mtime +15) ]]; then python youtube-dl --update fi gettitle() { # file location filename=$(python youtube-dl --no-playlist --extract-audio --keep-video --quiet --output "${downdir}/%(title)s.%(ext)s" --get-filename "${link}") # title title=$(basename ${filename%.*}) # check if url is valid if [[ -z "${filename}" ]]; then notification "The url is invalid" exit 1 else notification "Downloading “${title}”" fi } getfile() { progressfile="/tmp/downvidprogress" python youtube-dl --no-playlist --extract-audio --keep-video --quiet --newline --output "${downdir}/%(title)s.%(ext)s" "${link}" > "${progressfile}" # add metadata xmlencodedurl=$(echo "${link}" | perl -MHTML::Entities -CS -pe'$_ = encode_entities($_, q{&<>"'\''})') xattr -w com.apple.metadata:kMDItemWhereFroms '<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><array><string>'"${xmlencodedurl}"'</string></array></plist>' "${filename}" rm "${progressfile}" } # download printf "{query}" > "/tmp/downvidcurrentquery" if [[ "{query}" == "addToWatchList"* ]]; then link=$(cat "$(echo {query} | sed 's/addToWatchList //')") downdir="${HOME}/Downloads" gettitle getfile osascript -e "tell application \"Alfred 2\" to run trigger \"add_to_watchlist\" in workflow \"com.vitorgalvao.alfred.watchlist\" with argument \"${filename}\"" else link="$(cat {query})" downdir="${HOME}/Desktop" gettitle getfile fi notification "Downloaded “${title}”" Per Scott's suggestion, adding -f 137/22/18/17 to the workflow got rid of the numbered versions and the workflow is now working correctly.
vitor Posted April 28, 2015 Author Posted April 28, 2015 Fantastic workflow (not surprising really coming from you Vitor)... Thank you for the kind words. Per Scott's suggestion, adding -f 137/22/18/17 to the workflow got rid of the numbered versions and the workflow is now working correctly. Glad you got it working. I took the chance to update the instructions, as they were slightly out-of-date.
jarhead Posted April 28, 2015 Posted April 28, 2015 Thank you for the kind words. Glad you got it working. I took the chance to update the instructions, as they were slightly out-of-date. I noticed from the youtube-dl readme file, as of April 26, 2015, youtube-dl uses -f bestvideo+bestaudio/best as the default. Is there a way to tell if the workflow is using the most current version of youtube-dl? Thanks.
vitor Posted April 28, 2015 Author Posted April 28, 2015 (edited) Is there a way to tell if the workflow is using the most current version of youtube-dl? You can go into the workflow’s directory and run python youtube-dl -U to update. However, every time you run the workflow it checks if the version you have in it (the actual file) is over 15 days old, and if it is it updates it, so you should never be too far behind. Rest assured, the only operations it performs to achieve this are checking how old the file is (using common local CLI tools) and that same youtube-dl -U (youtube-dl --update, in this case) command to update, so it isn’t “phoning home” or anything like that (well, unless youtube-dl itself is doing something nasty, but I seriously doubt that). Edited April 28, 2015 by Vítor
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now