output template support for %(channel_id)s
See original GitHub issuePlease follow the guide below
- You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
- Put an
x
into all the boxes [ ] relevant to your issue (like that [x]) - Use Preview tab to see how your issue will actually look like
Make sure you are using the latest version: run youtube-dl --version
and ensure your version is 2016.06.02. If it’s not read this FAQ entry and update. Issues with outdated version will be rejected.
- I’ve verified and I assure that I’m running youtube-dl 2016.06.02
Before submitting an issue make sure you have:
- At least skimmed through README and most notably FAQ and BUGS sections
- Searched the bugtracker for similar issues including closed ones
What is the purpose of your issue?
- Bug report (encountered problems with youtube-dl)
- Site support request (request for adding support for a new site)
- Feature request (request for a new functionality)
- Question
- Other
The output template should have a way to reference the YouTube channel id, i.e.
%(channel_id)s
Currently, %(uploader_id)s
falls back to rendering the channel id if the uploader doesn’t have a name, but there’s no way to force this behavior if the uploader does have a name.
Note: If this feature is already available somewhere in youtube-dl, then I could not find it in the documentation, so documentation should be added or improved.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:18 (9 by maintainers)
Top Results From Across the Web
output template support for %(channel_id)s #9676 - GitHub
The output template should have a way to reference the YouTube channel id, i.e.. %(channel_id)s. Currently, %(uploader_id)s falls back to ...
Read more >Getting channel ID for channels in Teams
Solved: Hi I am trying to Post A Message in a (MS Teams) Team, when a file is posted in a specific Channel....
Read more >Broadcast Channel ID - After Effects Templates - Motion Array
Broadcast Channel ID is a neat and well organized After Effects template with absolutely everything you need to create up to date and...
Read more >Outputs 1 - learnYAGPDB
This output message is called the custom command response. The response is sent in the same channel that the custom command is triggered....
Read more >Add output channel to device interface - MATLAB addoutput
This MATLAB function adds the output channel channelID of device deviceID to the specified DataAcquisition interface, d, configured for the specified ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Here is the complete code which fixes this issue if someone would like to propagate it to the master. All changes in ‘extractor/youtube.py’. Line numbers are based on youtube-dl-master as of 12/23/2016, but should be obvious from context. The two changes (listed in reverse order in order to keep original line numbers valid) are as follows:
extractor/youtube.dl, INSERT at line 1716: ________‘channel_id’: video_channel_id,
extractor/youtube.dl, INSERT at line 1413: ________# channel_id ________mobj = re.search(r’itemprop=“channelId” content=“(UC[-_A-Za-z0-9]{21}[AQgw])”', video_webpage) ________if mobj is not None: ____________video_channel_id = mobj.group(1) ________else: ____________self._downloader.report_warning(‘unable to extract channelId’) ____________video_channel_id = None
With this change, you can specify %(channel_id)s in your output template, and you will consistently get the “UC…” identifier for both single item and playlist-oriented downloads.
It’s useful for downloaded videos because you can use the output template to specify folder names in the full path leading to the target filename.
You say that having the name “makes organization a lot easier,” but as I noted above, I find exactly the opposite to be true for my application. When the downloaded files are managed by a file management program, it is better to have a unique folder identifier which has a well-understood fixed-width format, and is composed from a very limited ASCII character set (many channel names use e.g. Japanese, combining Unicode characters, etc.)