Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
request: Per service configuration #3101
Comments
|
Would it be a good idea to use a Python script as the configuration file? For example: # file ~/.config/youtube-dl/config.py
def YoutubeDLFlags(url, ie_key, other_flags):
flags = []
if ie_key == 'YouTube':
flags.extend(['-f', 'bestvideo[ext!=webm]+bestaudio[ext!=webm]'])
elif ie_key == 'Youku':
flags.extend(['--proxy', 'hostname:port'])
return flagsThere are indeed lots of implementation issues, but I think it's a good start. A fixed set of flags is simply not flexible enough. |
|
@yan12125 Could you explain why a simple config file with sections is not enough? For the example you posted all you would need is: [YouTube]
format = bestvideo[ext!=webm]+bestaudio[ext!=webm]
[Youku]
proxy = hostname:port(I like not using leading dashes, but it could be made optional to support the old format). |
|
Sorry for a bad example. Python scripts could solve #6745 as well. In my case, I use a different set of flags when developing youtube-dl. For example: import os.path
def YoutubeDLFlags(url, ie_key, other_flags):
if os.path.exists('./youtube_dl/__main__.py'):
return ['-v', '--write-pages']
flags = []
if ie_key == 'YouTube':
flags.extend(['-f', 'bestvideo[ext!=webm]+bestaudio[ext!=webm]'])
elif ie_key == 'Youku':
flags.extend(['--proxy', 'hostname:port'])
return flags |
|
I think that adding a |
|
Any news on whether this is actually gonna get made? Or should I start to learn python and make pull requests? |
|
Any updates on this? |
I love having the option to configure youtube-dl globaly, but it would be great to be able to specify options per service, so like one directory for YouTube, another for SoundCloud and another for Twitch.
I would presume it should look something like this:
I hope you get the basic gist.
Thank you :)