Advertisement
Najeebsk

YOU-GET

Apr 17th, 2022
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.10 KB | None | 0 0
  1. You-Get is a tiny command-line utility to download media contents (videos, audios, images) from the Web, in case there is no other handy way to do it.
  2.  
  3. Here’s how you use you-get to download a video from YouTube:
  4.  
  5. $ you-get 'https://www.youtube.com/watch?v=jNQXAC9IVRw'
  6. site: YouTube
  7. title: Me at the zoo
  8. stream:
  9. - itag: 43
  10. container: webm
  11. quality: medium
  12. size: 0.5 MiB (564215 bytes)
  13. # download-with: you-get --itag=43 [URL]
  14.  
  15. Downloading Me at the zoo.webm ...
  16. 100% ( 0.5/ 0.5MB) ├██████████████████████████████████┤[1/1] 6 MB/s
  17.  
  18. Saving Me at the zoo.en.srt ... Done.
  19.  
  20. And here’s why you might want to use it:
  21.  
  22. You enjoyed something on the Internet, and just want to download them for your own pleasure.
  23. You watch your favorite videos online from your computer, but you are prohibited from saving them. You feel that you have no control over your own computer. (And it’s not how an open Web is supposed to work.)
  24. You want to get rid of any closed-source technology or proprietary JavaScript code, and disallow things like Flash running on your computer.
  25. You are an adherent of hacker culture and free software.
  26.  
  27. What you-get can do for you:
  28.  
  29. Download videos / audios from popular websites such as YouTube, Youku, Niconico, and a bunch more. (See the full list of supported sites)
  30. Stream an online video in your media player. No web browser, no more ads.
  31. Download images (of interest) by scraping a web page.
  32. Download arbitrary non-HTML contents, i.e., binary files.
  33.  
  34. Interested? Install it now and get started by examples.
  35.  
  36. Are you a Python programmer? Then check out the source and fork it!
  37.  
  38. Installation
  39. Prerequisites
  40.  
  41. The following dependencies are necessary:
  42.  
  43. Python 3.2 or above
  44. FFmpeg 1.0 or above
  45. (Optional) RTMPDump
  46.  
  47. Option 1: Install via pip
  48.  
  49. The official release of you-get is distributed on PyPI, and can be installed easily from a PyPI mirror via the pip package manager. Note that you must use the Python 3 version of pip:
  50.  
  51. $ pip3 install you-get
  52.  
  53. Option 2: Install via Antigen (for Zsh users)
  54.  
  55. Add the following line to your .zshrc:
  56.  
  57. antigen bundle soimort/you-get
  58.  
  59. Option 3: Download from GitHub
  60.  
  61. You may either download the stable (identical with the latest release on PyPI) or the develop (more hotfixes, unstable features) branch of you-get. Unzip it, and put the directory containing the you-get script into your PATH.
  62.  
  63. Alternatively, run
  64.  
  65. $ [sudo] python3 setup.py install
  66.  
  67. Or
  68.  
  69. $ python3 setup.py install --user
  70.  
  71. to install you-get to a permanent path.
  72. Option 4: Git clone
  73.  
  74. This is the recommended way for all developers, even if you don’t often code in Python.
  75.  
  76. $ git clone git://github.com/soimort/you-get.git
  77.  
  78. Then put the cloned directory into your PATH, or run ./setup.py install to install you-get to a permanent path.
  79. Option 5: Homebrew (Mac only)
  80.  
  81. You can install you-get easily via:
  82.  
  83. $ brew install you-get
  84.  
  85. Option 6: pkg (FreeBSD only)
  86.  
  87. You can install you-get easily via:
  88.  
  89. # pkg install you-get
  90.  
  91. Shell completion
  92.  
  93. Completion definitions for Bash, Fish and Zsh can be found in contrib/completion. Please consult your shell’s manual for how to take advantage of them.
  94. Upgrading
  95.  
  96. Based on which option you chose to install you-get, you may upgrade it via:
  97.  
  98. $ pip3 install --upgrade you-get
  99.  
  100. or download the latest release via:
  101.  
  102. $ you-get https://github.com/soimort/you-get/archive/master.zip
  103.  
  104. In order to get the latest develop branch without messing up the PIP, you can try:
  105.  
  106. $ pip3 install --upgrade git+https://github.com/soimort/you-get@develop
  107.  
  108. Getting Started
  109. Download a video
  110.  
  111. When you get a video of interest, you might want to use the --info/-i option to see all available quality and formats:
  112.  
  113. $ you-get -i 'https://www.youtube.com/watch?v=jNQXAC9IVRw'
  114. site: YouTube
  115. title: Me at the zoo
  116. streams: # Available quality and codecs
  117. [ DASH ] ____________________________________
  118. - itag: 242
  119. container: webm
  120. quality: 320x240
  121. size: 0.6 MiB (618358 bytes)
  122. # download-with: you-get --itag=242 [URL]
  123.  
  124. - itag: 395
  125. container: mp4
  126. quality: 320x240
  127. size: 0.5 MiB (550743 bytes)
  128. # download-with: you-get --itag=395 [URL]
  129.  
  130. - itag: 133
  131. container: mp4
  132. quality: 320x240
  133. size: 0.5 MiB (498558 bytes)
  134. # download-with: you-get --itag=133 [URL]
  135.  
  136. - itag: 278
  137. container: webm
  138. quality: 192x144
  139. size: 0.4 MiB (392857 bytes)
  140. # download-with: you-get --itag=278 [URL]
  141.  
  142. - itag: 160
  143. container: mp4
  144. quality: 192x144
  145. size: 0.4 MiB (370882 bytes)
  146. # download-with: you-get --itag=160 [URL]
  147.  
  148. - itag: 394
  149. container: mp4
  150. quality: 192x144
  151. size: 0.4 MiB (367261 bytes)
  152. # download-with: you-get --itag=394 [URL]
  153.  
  154. [ DEFAULT ] _________________________________
  155. - itag: 43
  156. container: webm
  157. quality: medium
  158. size: 0.5 MiB (568748 bytes)
  159. # download-with: you-get --itag=43 [URL]
  160.  
  161. - itag: 18
  162. container: mp4
  163. quality: small
  164. # download-with: you-get --itag=18 [URL]
  165.  
  166. - itag: 36
  167. container: 3gp
  168. quality: small
  169. # download-with: you-get --itag=36 [URL]
  170.  
  171. - itag: 17
  172. container: 3gp
  173. quality: small
  174. # download-with: you-get --itag=17 [URL]
  175.  
  176. By default, the one on the top is the one you will get. If that looks cool to you, download it:
  177.  
  178. $ you-get 'https://www.youtube.com/watch?v=jNQXAC9IVRw'
  179. site: YouTube
  180. title: Me at the zoo
  181. stream:
  182. - itag: 242
  183. container: webm
  184. quality: 320x240
  185. size: 0.6 MiB (618358 bytes)
  186. # download-with: you-get --itag=242 [URL]
  187.  
  188. Downloading Me at the zoo.webm ...
  189. 100% ( 0.6/ 0.6MB) ├██████████████████████████████████████████████████████████████████████████████┤[2/2] 2 MB/s
  190. Merging video parts... Merged into Me at the zoo.webm
  191.  
  192. Saving Me at the zoo.en.srt ... Done.
  193.  
  194. (If a YouTube video has any closed captions, they will be downloaded together with the video file, in SubRip subtitle format.)
  195.  
  196. Or, if you prefer another format (mp4), just use whatever the option you-get shows to you:
  197.  
  198. $ you-get --itag=18 'https://www.youtube.com/watch?v=jNQXAC9IVRw'
  199.  
  200. Note:
  201.  
  202. At this point, format selection has not been generally implemented for most of our supported sites; in that case, the default format to download is the one with the highest quality.
  203. ffmpeg is a required dependency, for downloading and joining videos streamed in multiple parts (e.g. on some sites like Youku), and for YouTube videos of 1080p or high resolution.
  204. If you don’t want you-get to join video parts after downloading them, use the --no-merge/-n option.
  205.  
  206. Download anything else
  207.  
  208. If you already have the URL of the exact resource you want, you can download it directly with:
  209.  
  210. $ you-get https://stallman.org/rms.jpg
  211. Site: stallman.org
  212. Title: rms
  213. Type: JPEG Image (image/jpeg)
  214. Size: 0.06 MiB (66482 Bytes)
  215.  
  216. Downloading rms.jpg ...
  217. 100.0% ( 0.1/0.1 MB) ├████████████████████████████████████████┤[1/1] 127 kB/s
  218.  
  219. Otherwise, you-get will scrape the web page and try to figure out if there’s anything interesting to you:
  220.  
  221. $ you-get http://kopasas.tumblr.com/post/69361932517
  222. Site: Tumblr.com
  223. Title: kopasas
  224. Type: Unknown type (None)
  225. Size: 0.51 MiB (536583 Bytes)
  226.  
  227. Site: Tumblr.com
  228. Title: tumblr_mxhg13jx4n1sftq6do1_1280
  229. Type: Portable Network Graphics (image/png)
  230. Size: 0.51 MiB (536583 Bytes)
  231.  
  232. Downloading tumblr_mxhg13jx4n1sftq6do1_1280.png ...
  233. 100.0% ( 0.5/0.5 MB) ├████████████████████████████████████████┤[1/1] 22 MB/s
  234.  
  235. Note:
  236.  
  237. This feature is an experimental one and far from perfect. It works best on scraping large-sized images from popular websites like Tumblr and Blogger, but there is really no universal pattern that can apply to any site on the Internet.
  238.  
  239. Search on Google Videos and download
  240.  
  241. You can pass literally anything to you-get. If it isn’t a valid URL, you-get will do a Google search and download the most relevant video for you. (It might not be exactly the thing you wish to see, but still very likely.)
  242.  
  243. $ you-get "Richard Stallman eats"
  244.  
  245. Pause and resume a download
  246.  
  247. You may use Ctrl+C to interrupt a download.
  248.  
  249. A temporary .download file is kept in the output directory. Next time you run you-get with the same arguments, the download progress will resume from the last session. In case the file is completely downloaded (the temporary .download extension is gone), you-get will just skip the download.
  250.  
  251. To enforce re-downloading, use the --force/-f option. (Warning: doing so will overwrite any existing file or temporary file with the same name!)
  252. Set the path and name of downloaded file
  253.  
  254. Use the --output-dir/-o option to set the path, and --output-filename/-O to set the name of the downloaded file:
  255.  
  256. $ you-get -o ~/Videos -O zoo.webm 'https://www.youtube.com/watch?v=jNQXAC9IVRw'
  257.  
  258. Tips:
  259.  
  260. These options are helpful if you encounter problems with the default video titles, which may contain special characters that do not play well with your current shell / operating system / filesystem.
  261. These options are also helpful if you write a script to batch download files and put them into designated folders with designated names.
  262.  
  263. Proxy settings
  264.  
  265. You may specify an HTTP proxy for you-get to use, via the --http-proxy/-x option:
  266.  
  267. $ you-get -x 127.0.0.1:8087 'https://www.youtube.com/watch?v=jNQXAC9IVRw'
  268.  
  269. However, the system proxy setting (i.e. the environment variable http_proxy) is applied by default. To disable any proxy, use the --no-proxy option.
  270.  
  271. Tips:
  272.  
  273. If you need to use proxies a lot (in case your network is blocking certain sites), you might want to use you-get with proxychains and set alias you-get="proxychains -q you-get" (in Bash).
  274. For some websites (e.g. Youku), if you need access to some videos that are only available in mainland China, there is an option of using a specific proxy to extract video information from the site: --extractor-proxy/-y.
  275.  
  276. Watch a video
  277.  
  278. Use the --player/-p option to feed the video into your media player of choice, e.g. mpv or vlc, instead of downloading it:
  279.  
  280. $ you-get -p vlc 'https://www.youtube.com/watch?v=jNQXAC9IVRw'
  281.  
  282. Or, if you prefer to watch the video in a browser, just without ads or comment section:
  283.  
  284. $ you-get -p chromium 'https://www.youtube.com/watch?v=jNQXAC9IVRw'
  285.  
  286. Tips:
  287.  
  288. It is possible to use the -p option to start another download manager, e.g., you-get -p uget-gtk 'https://www.youtube.com/watch?v=jNQXAC9IVRw', though they may not play together very well.
  289.  
  290. Load cookies
  291.  
  292. Not all videos are publicly available to anyone. If you need to log in your account to access something (e.g., a private video), it would be unavoidable to feed the browser cookies to you-get via the --cookies/-c option.
  293.  
  294. Note:
  295.  
  296. As of now, we are supporting two formats of browser cookies: Mozilla cookies.sqlite and Netscape cookies.txt.
  297.  
  298. Reuse extracted data
  299.  
  300. Use --url/-u to get a list of downloadable resource URLs extracted from the page. Use --json to get an abstract of extracted data in the JSON format.
  301.  
  302. Warning:
  303.  
  304. For the time being, this feature has NOT been stabilized and the JSON schema may have breaking changes in the future.
  305.  
  306. Supported Sites
  307. Site URL Videos? Images? Audios?
  308. YouTube https://www.youtube.com/ ✓
  309. Twitter https://twitter.com/ ✓ ✓
  310. VK http://vk.com/ ✓ ✓
  311. Vine https://vine.co/ ✓
  312. Vimeo https://vimeo.com/ ✓
  313. Veoh http://www.veoh.com/ ✓
  314. Tumblr https://www.tumblr.com/ ✓ ✓ ✓
  315. TED http://www.ted.com/ ✓
  316. SoundCloud https://soundcloud.com/ ✓
  317. SHOWROOM https://www.showroom-live.com/ ✓
  318. Pinterest https://www.pinterest.com/ ✓
  319. MTV81 http://www.mtv81.com/ ✓
  320. Mixcloud https://www.mixcloud.com/ ✓
  321. Metacafe http://www.metacafe.com/ ✓
  322. Magisto http://www.magisto.com/ ✓
  323. Khan Academy https://www.khanacademy.org/ ✓
  324. Internet Archive https://archive.org/ ✓
  325. Instagram https://instagram.com/ ✓ ✓
  326. InfoQ http://www.infoq.com/presentations/ ✓
  327. Imgur http://imgur.com/ ✓
  328. Heavy Music Archive http://www.heavy-music.ru/ ✓
  329. Freesound http://www.freesound.org/ ✓
  330. Flickr https://www.flickr.com/ ✓ ✓
  331. FC2 Video http://video.fc2.com/ ✓
  332. Facebook https://www.facebook.com/ ✓
  333. eHow http://www.ehow.com/ ✓
  334. Dailymotion http://www.dailymotion.com/ ✓
  335. Coub http://coub.com/ ✓
  336. CBS http://www.cbs.com/ ✓
  337. Bandcamp http://bandcamp.com/ ✓
  338. AliveThai http://alive.in.th/ ✓
  339. interest.me http://ch.interest.me/tvn ✓
  340. 755
  341. ナナゴーゴー http://7gogo.jp/ ✓ ✓
  342. niconico
  343. ニコニコ動画 http://www.nicovideo.jp/ ✓
  344. 163
  345. 网易视频
  346. 网易云音乐 http://v.163.com/
  347. http://music.163.com/ ✓ ✓
  348. 56网 http://www.56.com/ ✓
  349. AcFun http://www.acfun.cn/ ✓
  350. Baidu
  351. 百度贴吧 http://tieba.baidu.com/ ✓ ✓
  352. 爆米花网 http://www.baomihua.com/ ✓
  353. bilibili
  354. 哔哩哔哩 http://www.bilibili.com/ ✓ ✓ ✓
  355. 豆瓣 http://www.douban.com/ ✓ ✓
  356. 斗鱼 http://www.douyutv.com/ ✓
  357. 凤凰视频 http://v.ifeng.com/ ✓
  358. 风行网 http://www.fun.tv/ ✓
  359. iQIYI
  360. 爱奇艺 http://www.iqiyi.com/ ✓
  361. 激动网 http://www.joy.cn/ ✓
  362. 酷6网 http://www.ku6.com/ ✓
  363. 酷狗音乐 http://www.kugou.com/ ✓
  364. 酷我音乐 http://www.kuwo.cn/ ✓
  365. 乐视网 http://www.le.com/ ✓
  366. 荔枝FM http://www.lizhi.fm/ ✓
  367. 懒人听书 http://www.lrts.me/ ✓
  368. 秒拍 http://www.miaopai.com/ ✓
  369. MioMio弹幕网 http://www.miomio.tv/ ✓
  370. MissEvan
  371. 猫耳FM http://www.missevan.com/ ✓
  372. 痞客邦 https://www.pixnet.net/ ✓
  373. PPTV聚力 http://www.pptv.com/ ✓
  374. 齐鲁网 http://v.iqilu.com/ ✓
  375. QQ
  376. 腾讯视频 http://v.qq.com/ ✓
  377. 企鹅直播 http://live.qq.com/ ✓
  378. Sina
  379. 新浪视频
  380. 微博秒拍视频 http://video.sina.com.cn/
  381. http://video.weibo.com/ ✓
  382. Sohu
  383. 搜狐视频 http://tv.sohu.com/ ✓
  384. Tudou
  385. 土豆 http://www.tudou.com/ ✓
  386. 阳光卫视 http://www.isuntv.com/ ✓
  387. Youku
  388. 优酷 http://www.youku.com/ ✓
  389. 战旗TV http://www.zhanqi.tv/lives ✓
  390. 央视网 http://www.cntv.cn/ ✓
  391. Naver
  392. 네이버 http://tvcast.naver.com/ ✓
  393. 芒果TV http://www.mgtv.com/ ✓
  394. 火猫TV http://www.huomao.com/ ✓
  395. 阳光宽频网 http://www.365yg.com/ ✓
  396. 西瓜视频 https://www.ixigua.com/ ✓
  397. 新片场 https://www.xinpianchang.com/ ✓
  398. 快手 https://www.kuaishou.com/ ✓ ✓
  399. 抖音 https://www.douyin.com/ ✓
  400. TikTok https://www.tiktok.com/ ✓
  401. 中国体育(TV) http://v.zhibo.tv/
  402. http://video.zhibo.tv/ ✓
  403. 知乎 https://www.zhihu.com/ ✓
  404.  
  405. For all other sites not on the list, the universal extractor will take care of finding and downloading interesting resources from the page.
  406. Known bugs
  407.  
  408. If something is broken and you-get can’t get you things you want, don’t panic. (Yes, this happens all the time!)
  409.  
  410. Check if it’s already a known problem on https://github.com/soimort/you-get/wiki/Known-Bugs. If not, follow the guidelines on how to report an issue.
  411. Getting Involved
  412.  
  413. You can reach us on the Gitter channel #soimort/you-get (here’s how you set up your IRC client for Gitter). If you have a quick question regarding you-get, ask it there.
  414.  
  415. If you are seeking to report an issue or contribute, please make sure to read the guidelines first.
  416. Legal Issues
  417.  
  418. This software is distributed under the MIT license.
  419.  
  420. In particular, please be aware that
  421.  
  422. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  423.  
  424. Translated to human words:
  425.  
  426. In case your use of the software forms the basis of copyright infringement, or you use the software for any other illegal purposes, the authors cannot take any responsibility for you.
  427.  
  428. We only ship the code here, and how you are going to use it is left to your own discretion.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement