#!/bin/bash
clear
youtube-dl -U
echo " "
echo "YouTube Downloader Script"
echo "A video file will be created in the folder where this script is located"
echo " "
echo "Please paste a URL and hit [ENTER]:"
read URL
youtube-dl $URL
Edit: youtube-dl -U only works if it was manually installed, so leave that out if you installed from apt or whatever
Can't find the link now but I remember a computer educator in the UK describing how he taught the command-line to a bunch of seniors.
They had been complaining about how difficult it was to follow all the crazy windows popping up everywhere and never knowing which button to click. This is actually a problem for many seniors.
One day he installed Linux on a PC, booted into the console, and told them that this was "story mode". He gave them a list of commands along with mnemonics, and talked about how in "story mode" you always had a list of all the commands you typed so you always knew what you'd been doing.
If you are looking for something to give your family members, almost everyone I know uses the open-source tool jdownloader [0] to download youtube videos.
It's a ponderous java monster but it works great and comes with a huge plugin collection for numerous sites.
The fact that it has a gui makes it really accessibly to non-technical people.
There seems to be talk about AdWare in the installer but I personally never had that problem and you can get around that by downloading the executable .jar.
Another jdownloader user here. I have similar misgivings about its trustworthiness, but so far I haven't found any concrete reasons to distrust it other than that vague sense of unease. It's just so damn useful though!
> Not a single family member would touch this here.
> It's sad but understandable.
I can understand why many people will avoid using commandlines. The part I don't understand is how they're quite comfortable when those commandlines are surrounded by "Forward", "Back", "Stop" and "Reload" buttons; or when they have an "I'm feeling lucky" button underneath.
In the case of this discussion, the typical user flow would be something like:
- Double click browser
- Enter special string of text "youtube.com" in URL box and hit enter
- Enter strings of text into YouTube search box to find videos
Present this user with a CLI like youtube-dl, and they'll complain that they don't like the idea of copy/pasting special strings into boxes.
youtube-dl actually has quite sane defaults too; e.g. "youtube-dl https://......" will Just Work (TM). Switches are only needed for fancier stuff (e.g. "Download highest quality Free format and extract the audio track")
> You think that if I tell my parents this, they'll suddenly start using the command line?
Probably not, but that doesn't really matter as it was never the intention (if it were, there's probably a better place to write it than Hacker News).
I was offering software developers a perspective which demonstrates that the GUI/CLI distinction is mostly artificial, and that a CLI doesn't automatically mean "hard to use". After all, as others have pointed out, people managed just fine on DOS back in the day (where "managed just fine" == "shouting at machine for not doing things right", just like today).
> This is userfriendly and easy.
I don't like applying the phrase "userfriendly" to a piece of software, as it depends just as much on the user.
For example, I'm a user of youtube-dl, and I find it incredibly userfriendly: when I use it in scripts, I just write "youtube-dl" followed by flags for the appropriate behaviour. In contrast, your solution sounds really unfriendly to me. First my script would need to open a browser, and since the downloader is part of an addon, I wouldn't be able to use PhantomJS like I usually would. Instead, I'd probably have to go off and learn Selenium, assuming that Selenium drivers can use browser addons? If not, I might have to write a custom XUL app (not done that in a while!), and make sure it's compatible with the addon. Does XUL even work on a headless machine (in my case, RaspberryPi with SSH access)?
You are of course right with the part about user-friendliness but you do realize that most of the internet population did not understand what you tried to say with most of the sentences? ;)
So yes, it depends on the users just as well as your target group.
I'm not sure what your assumption that the difference is mostly artificial bases on since just the difference in the physical act is already overwhelming.
Well, there are lots of ways people interact with browsers; that was just an example. Personally I don't type "google.com", "youtube.com" either, I use Conkeror's web shortcuts.
Still, the point is that it's not much different than running a commandline, e.g. something like:
- Click Gnome Do icon
- type "youtube-dl " and paste URL
- Click the "run" suggestion
- Click on Home launcher
- Watch filename until ".f123." bit disappears from the extension
Yes. This exactly. I know many that don't type in url or even search on YouTube. They just click around. One time a family member asked if all the videos after they watched mine(I sent direct link) were mine as well. They apparently watched 5+ videos thinking they were mine but just happened to be displayed in sidebar and other.
As it was pointed out the first time youtube-dl was on Hacker News, our user base seems to be split regarding that behavior. When you copy a URL from a playlist, the URL includes both the video id and the playlist id.
Some people want to download the whole playlist when passing a URL from one of the videos (because otherwise it's hard to get an URL that contains just the playlist). Some other people just want to download the video they are currently watching.
That's why we have the --no-playlist option, which you can use and even stick in the configuration file. There's also --yes-playlist to override the configuration file if you need to.
Why not drop to a "did you want the playlist, or just this video?" prompt?
Side-benefit: force care to be taken to be explicit if used in a script.
Personally, without reading any docs the first thing I did was paste in just a video ID (i.e. not the entire URL) so it seems natural to me that including both would be ambiguous.
It's debatable whether that should be the default or not; compare it to, say, printing diagnostic info by default and requiring a special `--download` option.
One thing I always change from the default behaviour is video quality: by default it wastes a ton of bandwidth and disk space getting "HD" versions. I can understand why that's the default, but I don't particularly care about resolution, as it's a pretty negligible contributor to quality compared to the actual content of the video.
> youtube-dl actually has quite sane defaults too; e.g. "youtube-dl https://......" will Just Work (TM).
Are you sure that this is true? Starting many updates ago, but continuing into the present (I just updated to 2016.04.06 to be sure), I encountered a weird situation where
works. I have no problem with the second working, but don't understand why the first fails. It seems to be fine for other video services; only YouTube requires this URL-processing step.
$ youtube-dl https://www.youtube.com/watch?v=wbKJt1NQtZE
[youtube] wbKJt1NQtZE: Downloading webpage
[youtube] wbKJt1NQtZE: Downloading video info webpage
[youtube] wbKJt1NQtZE: Extracting video information
[youtube] wbKJt1NQtZE: Downloading MPD manifest
WARNING: Requested formats are incompatible for merge and will be merged into mkv.
[download] Destination: True Detective - My Least Favorite Life - Lera Lynn Scene-wbKJt1NQtZE.f136.mp4
[download] 19.3% of 35.60MiB at 1.51MiB/s ETA 00:18
Seems to work for me. I always double-quote the parameter anyway (I never trust the shell to handle my strings...)
I just tried `youtube-dl wbKJt1NQtZE` and that works too. I didn't know the "v" parameter could be given like that!
Very strange. Perhaps it's some setup- or platform-dependent thing; I will file an issue. Thanks for checking!
EDIT: Very strange; I thought I'd give a try to what seemed a throwaway comment in your post, about quoting the string, and that fixed it. Thanks!
Without the double quotes (which seemed to be unnecessary for you), I still get:
$ youtube-dl https://www.youtube.com/watch?v=wbKJt1NQtZE
Usage: youtube-dl [OPTIONS] URL [URL...]
youtube-dl: error: You must provide at least one URL.
Type youtube-dl --help to see a list of all options.
I guess that some alias is grabbing some part of the URL string.
Interesting! It seems that my `echo` is eating any substrings involving `?`.
$ bash --version
GNU bash, version 4.3.42(1)-release (x86_64-apple-darwin13.4.0)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ echo a ? = =?
a =
> I can understand why many people will avoid using commandlines. The part I don't understand is how they're quite comfortable when those commandlines are surrounded by "Forward", "Back", "Stop" and "Reload" buttons; or when they have an "I'm feeling lucky" button underneath.
Are you sure you apprehend the differences between the look and feel of a browser and that of a command line?
My mom did teach me DOS, and programming, and a lot of other things – but these days she doesn't have that kind of patience anymore. If things don't work right away, out the window they go. For a lot of people the patience with technology decreases as they age.
Absolutely. I'm also an example of that. 15 years ago it was difficult to see my PC tower closed and without the entrails exposed, I was always trying strange Linux distributions and stuff like BSD or BeOS, and I configured everything I could in OSs and programs.
Now, if my hardware fails I just call tech support, I mostly use Windows, I almost never spend more than 5 minutes configuring anything, and any program I need to compile from sources is basically a no-no except if it's something I really need or can't avoid. In fact I'm so lazy that I tend not to install games that aren't on Steam, after being spoiled by Steam anything harder than double clicking to install game in each of my PCs seems like too much work to me.
In other aspects I don't think I'm so different from 15 years ago, this laziness with technology may be the aspect where I think age has manifested the most!
Not to be morbid, but at some point in my mid-late 20's I considered how many Sunday afternoons I have left in my life. The thought made me a lot less likely to want to spend them dealing with xorg.conf or fiddling with drivers. Though for me, the solution has been to use plain-vanilla desktop Ubuntu on a laptop that ships with it (XPS 13).
It has nothing to do with lazyness for me.
When I was young I wasn't getting money for tinkering with hardware, neither for programming. Nowdays I get lots of money for programming...guess which of the 2 I'm doing more
For me it's about time. When I was a kid / teenager I had tons of free time for experimenting, and I didn't really care much for school. Now that I'm employed, I feel like those 8 hours are in fact the whole day. So I have less patience for things that are only tangential to the goal I'm trying to achieve.
This is true, while my mom never taught me too much she still did plenty in DOS. My dad on the other hand... He has an iPhone but would be happy with a flip phone, he uses the exact same amount of functionality that both phones carry, only difference being he has to touch his screen.
Off topic but just want to say, Apple knows there are many people like this, and the 16GB models are designed for them. I tire of seeing whines about 16GB being not enough. We the tech people are siloed in our own bubble and we often can't comprehend the existence of such people, unless they are our family members/close friends.
Well I don't mind him having a modernized phone, at least he gets a GPS. Not sure if he's ever used it, he probably could, he just likes to be simple I guess. As for the 16GB my only peeve against Apple (I'm an Android user though) is no availability to add in an SD card, even if it can't be used as "permanent" storage SD cards hold their value for being portable and transferable. It wont affect me as much though since I'm an Android user.
I'm inclined to agree with you though, except hard drive space is a lot cheaper these days, for about $10 I can have a 32 GB USB 3.0 thumb drive. Eventually the cheaper iPhone options should just carry a minimal 32GB if they decide to stop overcharging for more space. Videos and images are only going to increase in file size over the years to account for 4K adaptability, granted that might take quite a while.
My parents bought me my C64. I'll always be thankful for that and therefore will remain calm helping them out in this mad digital world they don't understand at all.
I also want to thank my parents for buying me C64, my first computer, especially during the time when my family wasn't doing so well financially; I can't ever be upset about giving tech support to my parents.
It reminds me of a C64 TV ad of a student who had to drop out of college because he didn't have computer skills to be competitive (https://www.youtube.com/watch?v=jDcZeGbElnM). Somehow, it all seems relevant now, as C64 gave me a start on programming.
Sure, but that's not the point, the point is most people are intimidated by a command line and don't want to have to learn it to accomplish the thing they're trying to do
Not a single family member would touch this here.
It's sad but understandable.