Jump to content


Photo

DownVid — Download videos from popular sources

workflow video download youtube

  • Please log in to reply
80 replies to this topic

#1 Vítor

Vítor

    Advanced Member

  • Member
  • PipPipPip
  • 645 posts

Posted 16 April 2013 - 11:26 PM

This workflow gets a URL from your clipboard, and uses youtube‐dl to download the main video (supports youtube and others) to your Desktop, with the highest quality possible.

Copy a link to your clipboard, run “dv”, and you’re done.
X1gl21M.png
It’ll show you a notification when it starts downloading, and another one when it’s finished.

If you have WatchList, it’ll show you an extra option, to automatically add the downloaded video to your watchlist (in which case the video will be saved to your Downloads directory).
yhxff0b.png

To see the download progress, run “dvp”.
3S377x8.png
 

But how are you checking if another workflow is installed?
Well, I’m not, here’s how it works. WatchList keeps an ordered text file, in order to be able to work. What DownVid does is simply check if this file exists; if it does, it’ll show you that extra option, and if you pick it it’ll prepend that file’s name to the list, that’s it. This information is neither sent to or saved anywhere, it just checks when you run it. If you don’t have WatchList, this won’t impact your experience in any way.

Why don’t you get the URL from my browser’s open tab, instead of having me copy it?
Well, that is actually how this worked, and that version was scrapped soon after being done. What happened is that while using it naturally, I’ve realised that it’s counter‐intuitive, at least to the way I need it to work. With PinAdd (that served as the base for the previous version), I usually run the script after I’ve seen the page, but with videos I’ll run it before, and I’ve realised most of the time I won’t even open the page, I just right‐click and copy a link, so this actually works better with that method.

Download | Source

License
All the code in the workflow’s root directory is licensed under The Unlicense (Public Domain, essentially). Applications and libraries inside the “_licensed” directory are not public domain, and are accompanied by their respective licenses.

Works well with
WatchList


Edited by Vítor, 12 August 2014 - 02:21 AM.

  • DimerHunton, Racer, Sridhar Katakam and 1 other like this

#2 JustLovely

JustLovely

    Newbie

  • New Member
  • Pip
  • 1 posts

Posted 17 April 2013 - 03:02 AM

Just tested this and this works fantastically! Thanks for this great workflow! =)


Edited by JustLovely, 17 April 2013 - 03:02 AM.


#3 Racer

Racer

    Advanced Member

  • Member
  • PipPipPip
  • 277 posts

Posted 17 April 2013 - 05:54 AM

This workflow gets a URL from your clipboard, and uses youtube‐dl to download the main video (supports youtube and others) to your Desktop, with the highest quality possible.

Copy a link to your clipboard, run “dv”, and you’re done.
wltW4Am.png
It’ll show you a notification when it starts downloading, and another one when it’s finished.

Wait, why don’t you get the URL from my browser’s open tab, instead of having me copy it?
Well, that is actually how this worked, and I scrapped that version not even an hour ago, at the time of this post. Seriously, and if you prefer that version, just ask and I’ll give you a download link — it’s working fully (albeit with limited testing). What happened is that while using it naturally, I’ve realised that it’s counter‐intuitive, at least to the way I need it to work. With PinAdd (that served as the base for the previous version), I usually run the script after I’ve seen the page, but with videos I’ll run it before, and I’ve realised most of the time I won’t even open the page, I just right‐click and copy a link, so this actually works better with that method.

Here’s how it looks.
zOAoiuT.png

Download
https://github.com/v....alfredworkflow

Source
https://github.com/v.../master/DownVid

License
I don’t care, do whatever you want with this. If you make any changes that could benefit the script, I’d certainly appreciate if you’d share them (perhaps I could incorporate them), but it’s not at all required.

Youtube‐dl’s license is very permissive (essentially public domain), which is the main reason I’ve picked it — it’s very similar to mine, which means that if you want to make any changes to this workflow in part or in whole and redistribute it, you’re absolutely free to do so, you don’t even have to credit anything or anyone.

Is there a youtube downloader for audio only workflow? I searched but couldn't find one.

Peace


#4 Vítor

Vítor

    Advanced Member

  • Member
  • PipPipPip
  • 645 posts

Posted 17 April 2013 - 02:11 PM

Is there a youtube downloader for audio only workflow? I searched but couldn't find one.

 
You can change this one pretty easily to do that, as youtube‐dl supports a --extract-audio option. If you need any help doing that, I can point you in the right direction.



#5 Racer

Racer

    Advanced Member

  • Member
  • PipPipPip
  • 277 posts

Posted 17 April 2013 - 03:25 PM

You can change this one pretty easily to do that, as youtube‐dl supports a --extract-audio option. If you need any help doing that, I can point you in the right direction.

I need help.

Peace


#6 Vítor

Vítor

    Advanced Member

  • Member
  • PipPipPip
  • 645 posts

Posted 17 April 2013 - 06:51 PM

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. If you don’t have it, install XCode’s CLI tools (homebrew needs this).
2. Open a terminal.
3. Install homebrew (again, if you don’t have it), by doing

ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"

4. Install ffmpeg by running

brew install ffmpeg

5. After is finishes, you can close the terminal.
6. Open the workflow, and after that double-click “Run Script”.

7. At the top of the code that appears, paste this

export PATH="/usr/local/bin:$PATH"

8. 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 coice).
9. If you want to always download only the audio, change

getfile() {
	python youtube-dl --quiet --output "${downdir}/%(title)s.%(ext)s" "${link}"
}

to

getfile() {
	python youtube-dl --extract-audio --quiet --output "${downdir}/%(title)s.%(ext)s" "${link}"
}

If you want to keep both the audio and video, change it to

getfile() {
	python youtube-dl --extract-audio --keep-video --quiet --output "${downdir}/%(title)s.%(ext)s" "${link}"
}

10. You can now save. You’re done.

Steps 1 and 4 can take some time, particularly 4 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.


Edited by Vítor, 03 June 2013 - 01:42 AM.


#7 Vítor

Vítor

    Advanced Member

  • Member
  • PipPipPip
  • 645 posts

Posted 18 April 2013 - 03:12 PM

Update.

The upload JSON was pointing to the wrong files, so you’ll need to download it again to receive further updates.

Edited by Vítor, 18 April 2013 - 03:13 PM.


#8 Racer

Racer

    Advanced Member

  • Member
  • PipPipPip
  • 277 posts

Posted 18 April 2013 - 03:35 PM

I think I will just convert the video with osx built in encoder. Definitely faster.

Peace


#9 Vítor

Vítor

    Advanced Member

  • Member
  • PipPipPip
  • 645 posts

Posted 18 April 2013 - 03:47 PM

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.


Edited by Vítor, 18 April 2013 - 03:48 PM.


#10 Racer

Racer

    Advanced Member

  • Member
  • PipPipPip
  • 277 posts

Posted 18 April 2013 - 04:05 PM

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.


After setting it up what do you have to every time for the workflow to work?

I don't DL YouTube vids often so i could just use your workflow, then convert natively I guess.

Peace


#11 Vítor

Vítor

    Advanced Member

  • Member
  • PipPipPip
  • 645 posts

Posted 18 April 2013 - 05:20 PM

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.



#12 Racer

Racer

    Advanced Member

  • Member
  • PipPipPip
  • 277 posts

Posted 18 April 2013 - 06:45 PM

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.

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.

From your first post I got the impression i had to do a little bit of the 13 steps after the setup. Well, ill give it a shot.

Peace


#13 Vítor

Vítor

    Advanced Member

  • Member
  • PipPipPip
  • 645 posts

Posted 23 April 2013 - 01:08 AM

Update.

If you have WatchList, you can now add a file directly to it after download (check the original post for details).


Edited by Vítor, 23 April 2013 - 01:09 AM.


#14 npeeps

npeeps

    Member

  • Member
  • PipPip
  • 20 posts

Posted 24 April 2013 - 08:58 PM

Thank you for this amazing extension! I've followed the very detailed steps in setting up the audio extraction but I'm having trouble with it not behaving the way the downvid one works. It doesn't seem to recognize that there is something in the clipboard (i.e. doesn't let me hit enter after entering the keyword).

 

Any help would be appreciated!  Thanks again!



#15 Vítor

Vítor

    Advanced Member

  • Member
  • PipPipPip
  • 645 posts

Posted 25 April 2013 - 01:34 AM

Thank you for this amazing extension! I've followed the very detailed steps in setting up the audio extraction but I'm having trouble with it not behaving the way the downvid one works. It doesn't seem to recognize that there is something in the clipboard (i.e. doesn't let me hit enter after entering the keyword).
 
Any help would be appreciated!  Thanks again!

 
If it doesn’t let you hit enter (as opposed to letting you do it but just not downloading the file), then check the script filter and see if the dropdown on the first line is set to “no argument”.

If you want, you can also post your workflow and I’ll take a look.



#16 npeeps

npeeps

    Member

  • Member
  • PipPip
  • 20 posts

Posted 25 April 2013 - 04:40 PM

 
If it doesn’t let you hit enter (as opposed to letting you do it but just not downloading the file), then check the script filter and see if the dropdown on the first line is set to “no argument”.

If you want, you can also post your workflow and I’ll take a look.

Thanks for your response! The "no argument" worked, but I'm now not getting audio in the resulting file.

 

I've posted the workflow here. Thank you for your support!

 

http://www.dropbox.c....alfredworkflow



#17 Vítor

Vítor

    Advanced Member

  • Member
  • PipPipPip
  • 645 posts

Posted 25 April 2013 - 05:02 PM

I think I found the issue; it was actually a problem with the instructions. What happened is that on instruction 11 I’m telling you to read youtube‐dl from a different place where I told you to save it on step 2 (likely because I’ve saved it to a different location to test it before posting the instructions, and forgot to change that).
 
I’ve updated the instructions; see step 11, it now has the corrected code.
 
If it still fails (or even if it succeeds), let me know, maybe there’s something else missing.



#18 npeeps

npeeps

    Member

  • Member
  • PipPip
  • 20 posts

Posted 25 April 2013 - 05:33 PM

I think I found the issue; it was actually a problem with the instructions. What happened is that on instruction 11 I’m telling you to read youtube‐dl from a different place where I told you to save it on step 2 (likely because I’ve saved it to a different location to test it before posting the instructions, and forgot to change that).
 
I’ve updated the instructions; see step 11, it now has the corrected code.
 
If it still fails (or even if it succeeds), let me know, maybe there’s something else missing.

Thanks for the reply! It runs the script now, but no file is put out (the notifications both come up though).

 

Sorry if this is turning into a hassle for you now!



#19 albertkinng

albertkinng

    Member

  • Member
  • PipPip
  • 54 posts

Posted 25 April 2013 - 06:46 PM

WOW. AMAZING! 



#20 Vítor

Vítor

    Advanced Member

  • Member
  • PipPipPip
  • 645 posts

Posted 25 April 2013 - 07:18 PM

WOW. AMAZING! 

 

Thank you. Glad you liked it.

 

Thanks for the reply! It runs the script now, but no file is put out (the notifications both come up though).

 

Sorry if this is turning into a hassle for you now!

 

No problem. I just noticed something else, you didn’t do steps 7, 8, and 9. It has to be done as a Terminal command, not a script, or else youtube‐dl won’t do the conversion.





Also tagged with one or more of these keywords: workflow, video, download, youtube

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users