{"action":"created","issue":{"url":"https://api.github.com/repos/rg3/youtube-dl/issues/16126","repository_url":"https://api.github.com/repos/rg3/youtube-dl","labels_url":"https://api.github.com/repos/rg3/youtube-dl/issues/16126/labels{/name}","comments_url":"https://api.github.com/repos/rg3/youtube-dl/issues/16126/comments","events_url":"https://api.github.com/repos/rg3/youtube-dl/issues/16126/events","html_url":"https://github.com/rg3/youtube-dl/pull/16126","id":312257924,"number":16126,"title":"Expose template variables to --exec","user":{"login":"joncody","id":20081527,"avatar_url":"https://avatars1.githubusercontent.com/u/20081527?v=4","gravatar_id":"","url":"https://api.github.com/users/joncody","html_url":"https://github.com/joncody","followers_url":"https://api.github.com/users/joncody/followers","following_url":"https://api.github.com/users/joncody/following{/other_user}","gists_url":"https://api.github.com/users/joncody/gists{/gist_id}","starred_url":"https://api.github.com/users/joncody/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joncody/subscriptions","organizations_url":"https://api.github.com/users/joncody/orgs","repos_url":"https://api.github.com/users/joncody/repos","events_url":"https://api.github.com/users/joncody/events{/privacy}","received_events_url":"https://api.github.com/users/joncody/received_events","type":"User","site_admin":false},"labels":[{"id":342097282,"url":"https://api.github.com/repos/rg3/youtube-dl/labels/do-not-merge","name":"do-not-merge","color":"e11d21","default":false},{"id":394545246,"url":"https://api.github.com/repos/rg3/youtube-dl/labels/pending-fixes","name":"pending-fixes","color":"006b75","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-04-08T00:52:24Z","updated_at":"2018-04-08T16:35:37Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/rg3/youtube-dl/pulls/16126","html_url":"https://github.com/rg3/youtube-dl/pull/16126","diff_url":"https://github.com/rg3/youtube-dl/pull/16126.diff","patch_url":"https://github.com/rg3/youtube-dl/pull/16126.patch"},"body":"## Please follow the guide below\r\n\r\n- You will be asked some questions, please read them **carefully** and answer honestly\r\n- Put an `x` into all the boxes [ ] relevant to your *pull request* (like that [x])\r\n- Use *Preview* tab to see how your *pull request* will actually look like\r\n\r\n---\r\n\r\n### Before submitting a *pull request* make sure you have:\r\n- [x] At least skimmed through [adding new extractor tutorial](https://github.com/rg3/youtube-dl#adding-support-for-a-new-site) and [youtube-dl coding conventions](https://github.com/rg3/youtube-dl#youtube-dl-coding-conventions) sections\r\n- [x] [Searched](https://github.com/rg3/youtube-dl/search?q=is%3Apr&type=Issues) the bugtracker for similar pull requests\r\n- [x] Checked the code with [flake8](https://pypi.python.org/pypi/flake8)\r\n\r\n### In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under [Unlicense](http://unlicense.org/). Check one of the following options:\r\n- [ ] I am the original author of this code and I am willing to release it under [Unlicense](http://unlicense.org/)\r\n- [x] I am not the original author of this code but it is in public domain or released under [Unlicense](http://unlicense.org/) (provide reliable evidence)\r\n\r\n### What is the purpose of your *pull request*?\r\n- [ ] Bug fix\r\n- [x] Improvement\r\n- [ ] New extractor\r\n- [x] New feature\r\n\r\n---\r\n\r\n### Description of your *pull request* and other information\r\n\r\nExplanation of your *pull request* in arbitrary form goes here. Please make sure the description explains the purpose and effect of your *pull request* and is worded well enough to be understood. Provide as much context and examples as possible.\r\n\r\n================================================================================\r\n\r\nI wanted to be able to download playlists and set the correct track number, title, album, artist, and year automatically so this simple, minor addition exposes the info object to the `--exec` argument.  The `info` object is a copy of the `information` object with its string values formatted via `compat.compat_shlex_quote` - this way we can now leverage `cmd % info` as opposed to `cmd.replace` and access `info`'s properties like so `--exec \"id3v2 -T %(playlist_index)s -t %(title)s -a 'artist' -A 'album' -y year %(filepath)s\"`.\r\n\r\nExample:\r\n```bash\r\nmkdir -p ~/Music/Orjan\\ Nilsen/No\\ Saint\\ Out\\ Of\\ Me/ && cd ~/Music/Orjan\\ Nilsen/No\\ Saint\\ Out\\ Of\\ Me/\r\nyoutube-dl -v --continue --no-part --xattrs -x --audio-format mp3 --audio-quality 0 --add-metadata --xattrs -o \"%(playlist_index)s - %(title)s.%(ext)s\" --exec \"id3v2 -T %(playlist_index)s -t %(title)s -a 'Orjan Nilsen' -A 'No Saint Out Of Me' -y 2015 %(filepath)s\" PL6l8d10atvR6hym1YRQtUfVgw53yg50CR\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/rg3/youtube-dl/issues/comments/379563470","html_url":"https://github.com/rg3/youtube-dl/pull/16126#issuecomment-379563470","issue_url":"https://api.github.com/repos/rg3/youtube-dl/issues/16126","id":379563470,"user":{"login":"dstftw","id":1908898,"avatar_url":"https://avatars2.githubusercontent.com/u/1908898?v=4","gravatar_id":"","url":"https://api.github.com/users/dstftw","html_url":"https://github.com/dstftw","followers_url":"https://api.github.com/users/dstftw/followers","following_url":"https://api.github.com/users/dstftw/following{/other_user}","gists_url":"https://api.github.com/users/dstftw/gists{/gist_id}","starred_url":"https://api.github.com/users/dstftw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dstftw/subscriptions","organizations_url":"https://api.github.com/users/dstftw/orgs","repos_url":"https://api.github.com/users/dstftw/repos","events_url":"https://api.github.com/users/dstftw/events{/privacy}","received_events_url":"https://api.github.com/users/dstftw/received_events","type":"User","site_admin":false},"created_at":"2018-04-08T16:35:37Z","updated_at":"2018-04-08T16:35:37Z","author_association":"COLLABORATOR","body":"There are no such thing as **right key**. **Any key** may be **missing** breaking your code completely since every key apart from title is **optional**. That's not redundant, that how it must work. I don't need semi broken functionality. If you want this feature to get merged you'll have to implement it properly.\r\n\r\n>Additional keys? There was only one key prior to my implementation, and it was information['filepath']\r\n\r\nThere were **no keys** prior to this PR. At all. This is what you are **adding right now**. And since you're adding it bother to add **all keys** mentioned in output template section. Again as said I don't need semi working options."}}
{"actor":{"display_login":"dstftw"}}