As far as I’ve seen, they don’t provide any advantage over a string with spaces, which doesn’t work well either when you’ve got values with spaces:
<span style="color:#323232;">not_what_you_think=( "a b" "c" "d" )
</span><span style="color:#323232;">for sneaky in ${not_what_you_think[@]}; do
</span><span style="color:#323232;"> echo "This is sneaky: ${sneaky}"
</span><span style="color:#323232;">done
</span>
<span style="color:#323232;">This is sneaky: a
</span><span style="color:#323232;">This is sneaky: b
</span><span style="color:#323232;">This is sneaky: c
</span><span style="color:#323232;">This is sneaky: d
</span>
That’s actually very helpful, thanks. I’ve been working on another project to open certain URLs in specific browsers/profiles, and wanted to be sure that I wasn’t missing a more obvious design pattern. The project is here if you’re curious.
Honestly, because I didn’t know (a) that ff2mpv even existed, or that (b) mpv could play YouTube URLs directly. So thanks! I learnt two things today :-)
It was still a fun project though 'cause I learnt how to write a Firefox extension and get the browser to launch programs on-click, so not a waste of time!
I don’t think I have it in me to put together a video, but I can describe it if you like.
Once you install the extension and follow the setup instructions, you just go to a YouTube page. The extension adds an ugly button to the top-left of the page that says “bypass”. When you click it, Firefox launches yt-dlp [the URL you’re at] -o - | mpv - which basically just downloads the video and streams the output through the mpv video player. So now you’re watching just the video, with no web page necessary.
Is there another way to do this? This hack was the only way I could figure out how to get Firefox to invoke an external binary, but if there’s a more conventional way to do it, I’d like to know 'cause I have another more complicated project in need of a pattern much like this one.
I was thinking of experimenting with a Firefox extension that upon hitting a YouTube page, it just launches yt-dlp [url] && mpv [downloaded file]. Is there any interest here in that sort of thing?
There’s a couple angles you can take on this. My favourite is from the dotCommunist Manifesto:
Society confronts the simple fact that when everyone can possess every intellectual work of beauty and utility—reaping all the human value of every increase of knowledge—at the same cost that any one person can possess them, it is no longer moral to exclude.
Essentially, this argues that the unethical position is the one that creates the false scarcity.
Another less extreme position would be that many countries allow for exemptions for format shifting: if you buy a CD with some music, you’re legally permitted to rip it so long as you don’t distribute copies. One could argue that someone in your position is operating within the spirit of these laws… provided that you haven’t torrented the videos since that necessarily includes some partial distribution.
Finally, the least generous interpretation would point out that you didn’t buy the videos in the first place, but rather a licence to let Vudu stream them to you. Given that you don’t own anything, you’re not morally entitled to own it in a different format. This is why many people have rejected the streaming model.
As someone in camp #1, I think you’re a-ok ethically, but I thought you might want a broader perspective.