博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
烈焰重击_重复重击提示
阅读量:2515 次
发布时间:2019-05-11

本文共 1973 字,大约阅读时间需要 6 分钟。

烈焰重击

I'm sure you wont be surprised when I tell you it's my job to automate things in our my household.  My wife is tech savvy but she relies on me to make tech matters easy for everyone; I guess it's flattering that she trusts me to do that.  One easy task she's trusted me with is make it easy to grab music from YouTube so she can put it on her phone or rock to on AudioShield.  I could probably point her to numerous sites that do that conversion but most are filled with disgusting ads and malware.  Since I love , I set out to create a bash script my wife could use to download as much music as she wanted!

我敢肯定,当我告诉您将自己家里的东西自动化是我的工作时,您不会感到惊讶。 我的妻子精通技术,但是她依靠我来使每个人都可以轻松解决技术问题。 我猜她相信我能做到这一点很讨人喜欢。 她信任我的一项简单任务就是轻松从YouTube抓取音乐,以便将其放在手机上或放在AudioShield上。 我可能会指出她是进行转换的众多网站,但大多数网站都充满了令人恶心的广告和恶意软件。 由于我喜欢 ,因此我着手创建一个bash脚本,我的妻子可以使用该脚本下载所需的任意音乐!

Almost a decade ago I wrote about but even that's a bit annoying for most people.  I could make a web interface but that seemed like too much I created a bash script to repeatedly ask for a YouTube link which to download and convert to MP3:

大约十年前,我写过一篇关于但这对大多数人来说还是有点烦人。 我可以创建一个Web界面,但这似乎太多了,我创建了一个bash脚本来反复询问要下载并转换为MP3的YouTube链接:

while true; do    read -p "What is the YouTube link? " answer    youtube-dl --extract-audio --audio-format mp3 $answerdone;

The script repeatedly asks for a YouTube link, downloads and converts to mp3, then asks for YouTube link again.  I created a desktop shortcut for this script to make usage even easier.  An easy script to make music download easy!

该脚本反复询问YouTube链接,下载并转换为mp3,然后再次询问YouTube链接。 我为此脚本创建了一个桌面快捷方式,以使使用更加容易。 一个简单的脚本,使音乐下载变得容易!

Of course the script could use some validation (i.e. that it's a link from YouTube) but I trust that we'll paste a valid link.  The key takeaway is that while true; do ...done will allow you to create repeated loop in a bash script!

当然,脚本可以使用一些验证(即,这是来自YouTube的链接),但是我相信我们会粘贴有效的链接。 关键要点是, while true; do ...done while true; do ...done将允许您在bash脚本中创建重复循环!

翻译自:

烈焰重击

转载地址:http://lkvwd.baihongyu.com/

你可能感兴趣的文章
spring中的ResourceBundleMessageSource使用和测试示例
查看>>
css规范 - bem
查看>>
电梯调度程序的UI设计
查看>>
转自 zera php中extends和implements的区别
查看>>
Array.of使用实例
查看>>
【Luogu】P2498拯救小云公主(spfa)
查看>>
如何获取网站icon
查看>>
几种排序写法
查看>>
java 多线程的应用场景
查看>>
dell support
查看>>
转:Maven项目编译后classes文件中没有dao的xml文件以及没有resources中的配置文件的问题解决...
查看>>
MTK android 设置里 "关于手机" 信息参数修改
查看>>
单变量微积分笔记6——线性近似和二阶近似
查看>>
补几天前的读书笔记
查看>>
HDU 1829/POJ 2492 A Bug's Life
查看>>
CKplayer:视频推荐和分享插件设置
查看>>
CentOS系统将UTC时间修改为CST时间
查看>>
redis常见面试题
查看>>
导航控制器的出栈
查看>>
玩转CSS3,嗨翻WEB前端,CSS3伪类元素详解/深入浅出[原创][5+3时代]
查看>>