{"id":17101259,"url":"https://github.com/hackerb9/getsong","last_synced_at":"2026-05-11T05:57:23.447Z","repository":{"id":199842047,"uuid":"703874743","full_name":"hackerb9/getsong","owner":"hackerb9","description":"Wrapper for yt-dlp that makes searching and downloading songs easier","archived":false,"fork":false,"pushed_at":"2023-10-12T07:24:39.000Z","size":26,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-29T01:56:16.478Z","etag":null,"topics":["bash","closed-captions","download","imfeelinglucky","lyrics","search","wrapper","youtube","yt-dlp"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hackerb9.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}},"created_at":"2023-10-12T05:07:23.000Z","updated_at":"2024-11-25T12:56:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"1e9c5bd9-30ad-4d92-8c65-168c32ae4eac","html_url":"https://github.com/hackerb9/getsong","commit_stats":null,"previous_names":["hackerb9/getsong"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackerb9%2Fgetsong","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackerb9%2Fgetsong/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackerb9%2Fgetsong/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackerb9%2Fgetsong/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hackerb9","download_url":"https://codeload.github.com/hackerb9/getsong/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245153896,"owners_count":20569408,"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","closed-captions","download","imfeelinglucky","lyrics","search","wrapper","youtube","yt-dlp"],"created_at":"2024-10-14T15:24:31.528Z","updated_at":"2026-05-11T05:57:23.391Z","avatar_url":"https://github.com/hackerb9.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# getsong\nGiven a song name, artist, lyrics or whatever, search for and download a song using yt-dlp.\n\n* Handles multiple arguments (including embedded spaces) correctly. \n* Uses youtube.com URL, instead of yt-dlp's ytsearch.\n* Allows `-c` to restrict search to videos with closed captions (manually generated lyrics/subtitles).\n* Can read search terms from a file, downloading one song per line.\n* If `xsel` is installed, will search for whatever words are currently highlighted by the mouse cursor and download that song.\n* Can download videos instead by changing the script's name: `ln -s getsong getvideo`\n\n## Installation\n\nIt's just a bash script. Download it, make it executable, and put it in your PATH. \n\n```bash\nwget https://raw.githubusercontent.com/hackerb9/getsong/main/getsong\nchmod +x getsong\nsudo mv getsong /usr/local/bin/\n```\n\n## Usage\n\nUsage: **getsong** [ _-c_ ] [ _keywords_ ... ]\n\n\u003cul\u003e\n   \n   _-c_: filter to only results with closed captions (subtitles)\n   \n   _keywords_: a song title, lyrics, artist name, or anything, really.\n\n\u003c/ul\u003e\n\nIf no keywords are specified, then the X selection (the\nlast text highlighted by the mouse) will be used.\n\nIf you redirect a file to stdin, then getsong will perform a search for\nevery song listed in the file, one per line. \n\n## Examples\n\nSearch YouTube for a term and download the audio:\n\n    getsong genjer\n\nSearch and download audio that matches two phrases:\n\n    getsong \"Mr. Orange\" \"Dengue Fever\"\n\nLimit search to only results with \"closed captions\" (i.e., lyrics or other subtitles manually generated by the uploader):\n\n    getsong -c \"A week ago last Thursday\"\n\n## Seeing lyrics on the command line as audio plays\n\nThe `mpv` program displays subtitles on the terminal if no video window was opened. While playing, one can hit the \u003ckbd\u003ej\u003c/kbd\u003e key to see the subtitles. Alternately, one can use a command line argument `--sid=1`:\n\n```bash\n$ mpv --vo null --sid=1 makeba.mka\n (+) Audio --aid=1 --alang=eng (opus 2ch 48000Hz)\n (+) Subs  --sid=1 --slang=eng 'English - en' (webvtt-webm)\nAO: [pipewire] 48000Hz stereo 2ch floatp\n\"Ooohe\" Makeba, Makeba\nma qué bella Can I get a\nA: 00:00:40 / 00:03:43 (18%)\n```\n\n## Caveats\n\nNote, that the `-c` option makes captions a requirement, not just a preference. Ideally, we'd get an error message if no captioned version exists, but instead YouTube mangles and ignores the search terms until it finds an incorrect video that _does_ have closed captions.\n\nAnother possible issue: YouTube doesn't look at the quality or even quantity of the captions, only whether they exist or not. Occasionally, the \"lyrics\" to a song will be a single subtitle which reads, unhelpfully, \"🎜 (singing) 🎝\". In those cases, using the 2nd result (`--playlist-items 2:2`) usually helps.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackerb9%2Fgetsong","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhackerb9%2Fgetsong","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackerb9%2Fgetsong/lists"}