{"id":13587702,"url":"https://github.com/ddelange/yt","last_synced_at":"2025-09-17T09:32:07.145Z","repository":{"id":52575266,"uuid":"199849786","full_name":"ddelange/yt","owner":"ddelange","description":"Fine-tuning the use of youtube-dl / yt-dlp for audio and videophiles","archived":false,"fork":false,"pushed_at":"2023-12-22T19:46:29.000Z","size":32,"stargazers_count":47,"open_issues_count":0,"forks_count":5,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-02-14T21:55:15.241Z","etag":null,"topics":["bash","download-songs","download-videos","facebook-downloader","instagram-downloader","soundcloud-downloader","youtube-dl","youtube-downloader"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ddelange.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-31T12:15:15.000Z","updated_at":"2024-08-01T16:33:42.256Z","dependencies_parsed_at":"2023-12-22T20:58:01.183Z","dependency_job_id":"12e89c98-a59c-4952-8036-93841f62d380","html_url":"https://github.com/ddelange/yt","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddelange%2Fyt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddelange%2Fyt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddelange%2Fyt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddelange%2Fyt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ddelange","download_url":"https://codeload.github.com/ddelange/yt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233364610,"owners_count":18665168,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","download-songs","download-videos","facebook-downloader","instagram-downloader","soundcloud-downloader","youtube-dl","youtube-downloader"],"created_at":"2024-08-01T15:06:19.478Z","updated_at":"2025-09-17T09:32:01.823Z","avatar_url":"https://github.com/ddelange.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# yt - fine-tuning the use of youtube-dl / yt-dlp\nDownload music or video from e.g. YouTube, Soundcloud, Instagram, Facebook. For a full list of supported sites and services, see https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md.\n\n![yt](https://user-images.githubusercontent.com/14880945/62221781-86e1b400-b3b2-11e9-873f-2dd323bcf154.gif)\n\n## Description\n[yt](https://github.com/ddelange/yt) is a pure-bash command-line tool that optimizes the use of [yt-dlp](https://github.com/yt-dlp/yt-dlp) for audio and videophiles with comprehensive and customizable presets, empirically tested on multiple streams. Maintains a download archive, to prevent duplicates when periodically downloading YouTube playlists or Soundcloud sets. Parses title (\"%(artist)s - %(title)s\") and retrieves a thumbnail, and injects these into file metadata. Adds the url id of the source to the filename, attempts to bypass geographical restrictions, and more.\n\n#### Features include, but are not limited to:\n- Parallel downloads\n- Audio mode (default)\n- Video mode (MKV `-vcodec copy` | MP4 AV1 | MP4 AVC)\n- HDR video (MKV)\n- Playlist mode (currently each playlist is download sequentially)\n- Custom audio bitrate, video resolution, destination folder\n- Embedded subtitle tracks\n- Embedded metadata like chapter information and description\n\nThe audio streams in converted (video) files from `yt` will generally be of higher quality compared to [online alternatives](https://www.google.nl/search?q=youtube+to+mp3+online), while maintaining a comparable file size. This is achieved by preferring WAV/OPUS source streams, and by converting using the [Fraunhofer FDK AAC codec library](https://trac.ffmpeg.org/wiki/Encode/AAC#fdk_aac) or when available the Mac OS Audiotoolbox (even better) at a bitrate of 256kbit/s (sufficient to encode a full 44.1kHz stream without losing detail at higher frequencies, see benchmark [here](https://gist.github.com/ScribbleGhost/54ad17da006e8bba4a1612bd6a64571c?permalink_comment_id=4691994#gistcomment-4691994)).\n[![yt vs online](https://user-images.githubusercontent.com/14880945/62381156-246feb80-b54b-11e9-8445-3890c091d0c3.gif)](https://github.com/alexkay/spek)\n\n## Installation\nDependencies are installations of `yt-dlp`, `atomicparsley`, and `ffmpeg` preferably compiled using `--enable-audiotoolbox` on Mac and `--with-fdk-aac` on other operating systems. Note that fdk-aac is GPL-incompatible, so this will produce an unredistributable distribution.\n\n#### OSX\nTo install `yt` and its dependencies:\n```bash\nbrew install ddelange/brewformulae/yt\n```\n\nOr manually (if you wish to avoid Homebrew, and install the dependencies yourself):\n- Compile `ffmpeg` [including](https://trac.ffmpeg.org/wiki/CompilationGuide/macOS#Additionaloptions) `--with-fdk-aac`.\n- [Install](https://github.com/yt-dlp/yt-dlp#installation) `yt-dlp`.\n- Install [`atomicparsley`](https://github.com/wez/atomicparsley).\n- Put [`yt`](yt/yt) in your path:\n    ```bash\n    git clone https://github.com/ddelange/yt.git ./yt\n    cd ./yt \u0026\u0026 bash ./install.sh\n    yt --help  # check that all is well\n    ```\n\n#### Debian/Ubuntu\nOn Linux, you can use [Homebrew](https://docs.brew.sh/Homebrew-on-Linux) as well:\n```bash\nbrew install ddelange/brewformulae/yt\n```\n\nOr manually (if you wish to avoid Homebrew, and install the dependencies yourself):\n- Compile `ffmpeg` including `--with-fdk-aac`. See example instructions, pick your favorite: [[1]](https://seanthegeek.net/455/how-to-compile-and-install-ffmpeg-4-0-on-debian-ubuntu/) [[2]](https://gist.github.com/rafaelbiriba/7f2d7c6f6c3d6ae2a5cb)\n- [Install](https://github.com/yt-dlp/yt-dlp#installation) `yt-dlp`.\n- Install [`atomicparsley`](https://github.com/wez/atomicparsley).\n- Put [`yt`](yt/yt) in your path:\n    ```bash\n    git clone https://github.com/ddelange/yt.git ./yt\n    cd ./yt \u0026\u0026 bash ./install.sh\n    yt --help  # check that all is well\n    ```\n\n#### Windows\nEasiest would be using the [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/about), and using instructions above. But since `yt-dlp` has dedicated Windows distributions available, you could try the following:\n\n[untested, assumes you're running Bash for Windows]\n- [Compile](https://github.com/jb-alvarado/media-autobuild_suite#information) `ffmpeg` including the `non-free tools` (which will contain `libfdk-aac`).\n- Install `yt-dlp`:\n    - [either] Assuming python / python3 and pip / pip3 are installed, run `sudo pip3 install yt-dlp` or `sudo pip3 install yt-dlp` respectively.\n    - [or] Download [yt-dlp.exe](https://github.com/yt-dlp/yt-dlp/releases/latest) and place it in any location on your [PATH](https://en.wikipedia.org/wiki/PATH_%28variable%29).\n- Make sure `yt-dlp` is recognized by your shell by typing `yt-dlp --version`.\n- Put [`yt`](yt/yt) in your path.\n\n## Usage\n\ntl;dr:\n- Type `yt` to download m4a audio files for the (space separated) URL(s) fetched from clipboard (see also `-c`).\n- Type `yt -vmM` to download video into mp4, up to 1080p, preferably with AVC codec for better compatibility.\n- Type `yt -vHP 2160` to download best quality video into mkv, up to 4K HDR if available.\n\n```\nNAME\n      yt  -  fine-tuning the use of youtube-dl / yt-dlp. Download music or video from e.g.\n      YouTube,  Soundcloud,  Instagram,  Facebook.  For a full list of supported sites and\n      services, see https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md.\n\nSYNOPSIS\n      yt [OPTIONS] -- [URL] [URL...]\n\nDESCRIPTION\n      yt is a bash function that  optimizes the use of  yt-dlp  for audio and  videophiles\n      with comprehensive and customizable presets, empirically tested on multiple streams.\n      Maintains a  download archive,  to prevent duplicates when  periodically downloading\n      YouTube playlists or Soundcloud sets.  Parses title  (\"%(artist)s - %(title)s\")  and\n      retrieves a thumbnail, and injects these into file metadata.  Adds the url id of the\n      source to the filename, and attempts to bypass geographical restrictions.\n\nOPTIONS\n      -h, --help\n            Print this help text and exit.\n\n      -s\n            Enable silent mode (send stdout to /dev/null).\n\n      -S\n            Enable sequential mode.  Default behaviour: parallel mode.  The MAXPROCS (env)\n            var sets parallelism  (default 4).  To download YouTube playlists in parallel,\n            use e.g. \"yt -v -- $(yt-dlp --get-id --flat-playlist \u003cplaylist-url\u003e)\".\n\n      -f\n            Force download, even when already recorded in --download-archive.\n\n      -v\n            Enable video mode. Defaults to audio mode. Only mono and stereo are supported.\n\n      -c\n            Fetch space separated  URLs from clipboard,  additional to the manually passed\n            URLs. Auto-enables when no URLs are manually passed.\n\n      -D POSIX_PATH\n            Set the destination path.  Used for both the (intermediate) output and for the\n            download archive. Defaults to  \"~/Music/yt\"  and  \"~/Movies/yt\"  for audio and\n            video mode respectively. Override defaults with YT_MUSIC_DIR and YT_VIDEO_DIR.\n\n      -p\n            Enable playlist mode. When a video URL contains a reference to a playlist, the\n            whole playlist will be  downloaded.  Will only download URLs that have not yet\n            been recorded in the download archive.\n\n      -k\n            Keep original audio additionally.  In most cases, this will keep e.g. OPUS for\n            YouTube, or LAME MP3 / WAV for Soundcloud URLs.  Ignored when -v is specified.\n\n      -a KBITS_PER_SECOND\n            Set the output audio bitrate. Defaults to 256kbit/s.\n\n      -r HERTZ\n            Set the output audio sampling rate. Defaults to 44100Hz.\n\n      -P PIXELS\n            Set the maximum pixels of the video output.  Ignored when -v is not specified.\n            Defaults to 1920px. Constraint is dropped when no formats comply. For portrait\n            and landscape videos,  this corresponds to the  height and width respectively.\n\n      -F FRAMES\n            Set the maximum framerate in frames per second. Defaults to 42. Ignored when\n            -v is not specified. Constraint is dropped when no formats comply.\n\n      -m\n            Use MP4 when merging audio/video streams, keeping video codecs if possible and\n            converting audio to 256kbit/s AAC (resolving full 44.1KHz stream). If no merge\n            is needed,  the (single) source file is kept  and no conversion is  performed.\n            Default behaviour:  copy downloaded audio/video streams into an MKV container,\n            using OPUS audio codec and  VP9 video codec for small filesizes.  Ignored when\n            -v is not specified. For YouTube this will yield a maximum resolution of 1080.\n            Sometimes,  AV1 streams will only be available up to a certain resolution.  In\n            this case, specifying -M might yield higher resolution.\n\n      -M\n            Prefer the older AVC codec over AV1. Results in bigger file-sizes, but  better\n            playback compatibility. Ignored when -v and -m are not specified.\n\n      -H\n            Prefer HDR streams. Tested on YouTube videos. Overrides -m.\n\n      -A\n            Embed all available audio streams. Ignored when -v is not specified.\n\nBSD 3-Clause License\n\nCopyright (c) 2019, ddelange\nAll rights reserved.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddelange%2Fyt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fddelange%2Fyt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddelange%2Fyt/lists"}