Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request: Per service configuration #3101

Open
gh0stl4b opened this issue Jun 18, 2014 · 6 comments
Open

request: Per service configuration #3101

gh0stl4b opened this issue Jun 18, 2014 · 6 comments
Assignees
Labels

Comments

@gh0stl4b
Copy link

@gh0stl4b gh0stl4b commented Jun 18, 2014

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:

[all]
--no-part

[youtube]
-o "%(uploader)s\%(title)s.%(ext)s"

[youtube:playlists]
-o "%(uploader)s\%(playlist)s\%(title)s.%(ext)s"
--ignore-errors

[soundcloud]
--audio-format m4a

[udemy]
--username MyUsername
--password MyPassword

[twitch]
--username MyUsername
--password MyPassword

I hope you get the basic gist.
Thank you :)

@gh0stl4b gh0stl4b changed the title request: Per service configuration request: Per service configuration request Jun 18, 2014
@gh0stl4b gh0stl4b changed the title request: Per service configuration request request: Per service configuration Jun 18, 2014
@jaimeMF jaimeMF added the request label Jan 8, 2015
@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Sep 3, 2015

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 flags

There are indeed lots of implementation issues, but I think it's a good start. A fixed set of flags is simply not flexible enough.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Sep 3, 2015

@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).

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Sep 4, 2015

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
@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Sep 4, 2015

I think that adding a --include-config to read an specific file would be enough. Even even if we added support for a python script, supporting the simple config would be easier to create for users.

@gh0stl4b
Copy link
Author

@gh0stl4b gh0stl4b commented Dec 14, 2015

Any news on whether this is actually gonna get made? Or should I start to learn python and make pull requests? 😅

@jaimeMF jaimeMF self-assigned this Mar 18, 2016
@dstftw dstftw marked this as a duplicate of #13694 Jul 21, 2017
@dstftw dstftw mentioned this issue Jul 21, 2017
4 of 8 tasks complete
@Macellatore
Copy link

@Macellatore Macellatore commented Oct 13, 2019

Any updates on this?
The feature would come in handy, expecially when dealing with different services on a regular basis.

@KenMacD KenMacD mentioned this issue May 4, 2020
3 of 3 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.