Now that Mozilla is promising to open-source this, I eagerly await adding this feature to my own fork :)
Now that Mozilla is promising to open-source this, I eagerly await adding this feature to my own fork :)
Ingredients:
1. Termux App.
2. Termux API App.
3. Termux CLI utilities. apt install termux-api
4. Python: apt install python
5. youtube-dl: pip install youtube-dl
6. VLC App. Install from app store.
7. A set of shell functions for clipboard and application access:
alias xc='termux-clipboard-set'
alias xp='termux-clipboard-get'
open ()
{
termux-share "$@"
}
I'll generally download videos to the Download folder, which I've symlinked from the Termux home directory: lrwxrwxrwx 1 u0_a204 u0_a204 29 Apr 26 2016 Download -> /storage/emulated/0/Download/
Oh, and how did I get those functions and aliases? (alias | egrep x[cp]; typeset -f open) | sed s/^/ / | xc
(Pre-formatted for HN's code block.)With all of that, you can download and play, in one swell foop, a video (assuming you know the output format you prefer -- something you can set as a youtube-dl preference):
open $( youtube-dl -f 18 "$(xp)" | awk -F':' '/Destination/ {print $2}' )
Or you can fetcha whole slew of content and queue it up on VLC.I'd still prefer to be able to use a commandline audio player with controls rather than the GUI client. There's a very simple "play-audio" command, but it has no controls -- <ctrl>-C to end is about it, even backgrounding doesn't actually stop playback.
I've messed with the sox "play" command, but it doesn't have an assigned audio device, and I've been unable to convince it that such a thing exists (see StackExchange posts regarding Android for similar issues/discussions).
Then install youtube-dl as follows:
$ brew install youtube-dl
And download videos as follows: $ youtube-dl "https://www.youtube.com/watch?v=dQw4w9WgXcQ"The browser is such an obviously poor place to stick A/V. Other than, of course, the fact that advertisers slobber over cramming every more crap down some "channel" or other.
Thank god there's a native iOS/Android client.
Meredith L. Patterson has addressed the point of Port 80 (or 443) adequately. For the time being, we're locked into that.
My point is that handing of A/V material to a dedicated AV app is, all else considered, probably optimal. It's the 4th browser replacement mentioned in my "Tabbed Browsing" rant, elsewhere in this thread.
BTW, I'm unable to access /storage/emulated/0, it seems Termux doesnt have permission (and the app doesnt list it in its permissions). Is your phone rooted?
I've just confirmed though that I can create and delete files on /storage/emulated/0/ YMMV, is all I can say.
I wish we had these options in Canada, because mobile bandwidth is stupidly expensive over here.
This is because Internet in India sucks
$ brew install youtube-dl $ pip install youtube-dl
even if you don't use brew. Python is there out of the box.> available in the United States, Australia, Mexico, New Zealand and South Korea.
And anyway, despite the name, youtube-dl supports a whole lot more than just YouTube.
[1]: reminder: technically, streaming isn't different from download, what your computer does when watching a video in streaming is downloading. Forcing users to delete the video they have downloaded (which is exactly what's happening with streaming) so they pay the premium service for off-line use, is not a legitimate way to do business. They can do it of course, if people are willing to pay for something they can have for free it's fine, but people who don't want to pay aren't doing anything wrong.
You're not the arbiter of this.
> but people who don't want to pay aren't doing anything wrong.
Not wanting to pay isn't wrong. Circumventing the Youtube's restrictions is though.
That's exactly my point: it's not.
It may be bad for Youtube's business, but it's not morally wrong. We owe nothing to Google.
Look at 5b. Downloading Youtube videos, except with Youtube Red, is a breach of contract.
Breaking contract is wrong.
Too bad, then every single user of Youtube is violating this rule: the browser needs to download the video to play it, streaming is just the act of automatically removing the video chunk after it's played. I don't seen written anywhere that the user is forbidden to prevent the deletion of the video chunk he downloaded.
Even if Youtube updated its rules to fill this loophole, I would still be allowed to do it. In France people are protected by «l'exception de copie privée» which allow them to have their own copy of video or music which their are legally allowed to see/listen.[1] That's why we are allowed to record TV broadcast. I guess there must be a similar law in the US but I'm not really aware of the regulation there.
[1] sharing the video with somebody outside of your family is forbidden though.
It's not their (the user's) content.