News for hackers. Stuff that matters.
Re:Mozilla Acquires Pocket by apetresc on Monday February 27, 2017 @02:19PM (#13747024)
Something I've always wished Pocket would do is download an offline copy of videos I add to the list (using, say, youtube-dl [1]), so I can watch them on the subway, etc. But they never did this, presumably either for legal reasons, or because it was a giant waste of bandwidth considering a huge percentage of Pocketed articles never get read.

Now that Mozilla is promising to open-source this, I eagerly await adding this feature to my own fork :)

-- [1]: https://rg3.github.io/youtube-dl/

Re:Mozilla Acquires Pocket by dredmorbius on Tuesday February 28, 2017 @01:07AM (#13751653)
If you're on Android, I've found a set of tricks which work for this pretty well.

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).

Re:Mozilla Acquires Pocket by bartvk on Tuesday February 28, 2017 @01:21AM (#13751708)
Seconding this for macOS. If you haven't installed Homebrew, do so: https://brew.sh/

Then install youtube-dl as follows:

  $ brew install youtube-dl
And download videos as follows:

  $ youtube-dl "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
Re:Mozilla Acquires Pocket by dredmorbius on Tuesday February 28, 2017 @02:52AM (#13752088)
The lack of a true, independent, freestanding multimedia application which can handle this sort of thing -- building and managing queues, interrupting, deleting, sorting, etc. -- puzzles me.

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.

Re:Mozilla Acquires Pocket by bartvk on Tuesday February 28, 2017 @02:59AM (#13752129)
Well, Google has a history of preferring HTML above all other interfaces. Only when someone else comes along and offers a better native interface, they jump in.

Thank god there's a native iOS/Android client.

Re:Mozilla Acquires Pocket by dredmorbius on Tuesday February 28, 2017 @03:59AM (#13752366)
It's not the transport that's the problem, it's the app.

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.

Re:Mozilla Acquires Pocket by ikurei on Tuesday February 28, 2017 @05:36AM (#13752738)
I've played a bit with terminals on Android, but I only had real success using ssh. This seems very convenient, I'll play around with termux, thanks!

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?

Re:Mozilla Acquires Pocket by dredmorbius on Wednesday March 01, 2017 @01:19AM (#13761668)
I've attempted rooting the phone, but don't believe I've succeeded. One of my major gripes about the whole Android ecosystem (and a massively significant one). Samsung Tab A.

I've just confirmed though that I can create and delete files on /storage/emulated/0/ YMMV, is all I can say.

Re:Mozilla Acquires Pocket by baby on Monday February 27, 2017 @02:30PM (#13747141)
It also kind of sucks with javascript when it downloads the page offline. Pages that use Mathjax or something for LaTeX never display correctly so I can enver read them offline :/
Re:Mozilla Acquires Pocket by wirddin on Monday February 27, 2017 @02:52PM (#13747325)
This problem got solved when YouTube started allowing offline videos. Idk if it is available in your country, but in India you don't need to be a paying customer to save offline videos.
Re:Mozilla Acquires Pocket by m-p-3 on Monday February 27, 2017 @05:11PM (#13748839)
India usually get those offline features much more faster than other countries for some reason.

I wish we had these options in Canada, because mobile bandwidth is stupidly expensive over here.

Re:Mozilla Acquires Pocket by thewhitetulip on Monday February 27, 2017 @11:18PM (#13751122)
> India usually get those offline features

This is because Internet in India sucks

Re:Mozilla Acquires Pocket by sah2ed on Tuesday February 28, 2017 @08:31AM (#13753562)
... plus with a population of ~1.25 billion people, it's an incredibly large market to overlook.
Re:Mozilla Acquires Pocket by pcnix on Monday February 27, 2017 @03:40PM (#13747748)
That's only on mobile afaik. How do you deal with it on the desktop?
Re:Mozilla Acquires Pocket by bartvk on Tuesday February 28, 2017 @01:22AM (#13751714)
On macOS, do something like this:

  $ brew install youtube-dl
Re:Mozilla Acquires Pocket by vetinari on Tuesday February 28, 2017 @07:29AM (#13753255)
On macOS, the following works as well:

    $ pip install youtube-dl
even if you don't use brew. Python is there out of the box.
Re:Mozilla Acquires Pocket by Aissen on Tuesday February 28, 2017 @04:20AM (#13752453)
There are many apps that do that. A Pocket competitor, Spool, used to that. It was then acqui-hired by Facebook and shutdown. At least they had the decency of sending us our data by email.
Re:Mozilla Acquires Pocket by dunham on Monday February 27, 2017 @05:34PM (#13749081)
You could script this with a bookmarking service like pinboard.in (anything with an API) and a cron job.
Re:Mozilla Acquires Pocket by tertius on Monday February 27, 2017 @02:33PM (#13747164)
See Youtube red.
Re:Mozilla Acquires Pocket by alainv on Monday February 27, 2017 @02:40PM (#13747223)
Youtube Red is not available in most of the world:

> available in the United States, Australia, Mexico, New Zealand and South Korea.

Re:Mozilla Acquires Pocket by tertius on Tuesday February 28, 2017 @11:58AM (#13755162)
I guess they'll have to wait.
Re:Mozilla Acquires Pocket by apetresc on Monday February 27, 2017 @02:56PM (#13747362)
My conscience is assuaged by the fact that I am already paying for Google Play Music, which would include YouTube Red at no additional cost, if I lived a few miles away on the other side of the Canada-USA border.

And anyway, despite the name, youtube-dl supports a whole lot more than just YouTube.

Re:Mozilla Acquires Pocket by mplewis on Monday February 27, 2017 @02:40PM (#13747224)
That's a paid service. Youtube-DL is free and open source.
Re:Mozilla Acquires Pocket by dbbk on Monday February 27, 2017 @02:43PM (#13747245)
It is YouTube's prerogative to offer that feature for their paid service.
Re:Mozilla Acquires Pocket by stymaar on Tuesday February 28, 2017 @03:18AM (#13752196)
And it's the user's prerogative to build and use tools to circumvent artificial[1] limitations.

[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.

Re:Mozilla Acquires Pocket by tertius on Tuesday February 28, 2017 @11:57AM (#13755153)
> is not a legitimate way to do business.

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.

Re:Mozilla Acquires Pocket by stymaar on Wednesday March 01, 2017 @08:59AM (#13763634)
> 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.

Re:Mozilla Acquires Pocket by tertius on Wednesday March 01, 2017 @02:53PM (#13767612)
https://www.youtube.com/static?template=terms

Look at 5b. Downloading Youtube videos, except with Youtube Red, is a breach of contract.

Breaking contract is wrong.

Re:Mozilla Acquires Pocket by stymaar on Wednesday March 01, 2017 @05:55PM (#13769407)
> Downloading Youtube videos, except with Youtube Red, is a breach of contract.

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.

Re:Mozilla Acquires Pocket by slrz on Wednesday March 01, 2017 @02:57PM (#13767661)
What restrictions?
Re:Mozilla Acquires Pocket by haukilup on Monday February 27, 2017 @03:01PM (#13747410)
It sure is their prerogative. It's unfortunate their paid service is not available to most of the world.
Re:Mozilla Acquires Pocket by andrepd on Tuesday February 28, 2017 @10:04AM (#13754185)
So is the user's prerogative to use their downloaded content in any way they want, in this case not consuming immediately but saving for later.
Re:Mozilla Acquires Pocket by tertius on Tuesday February 28, 2017 @11:58AM (#13755158)
> So is the user's prerogative to use their downloaded content in any way they want, in this case not consuming immediately but saving for later.

It's not their (the user's) content.