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

Need help with a little improvement. #2334

Closed
vanilla38 opened this issue Feb 6, 2014 · 2 comments
Closed

Need help with a little improvement. #2334

vanilla38 opened this issue Feb 6, 2014 · 2 comments

Comments

@vanilla38
Copy link

@vanilla38 vanilla38 commented Feb 6, 2014

Hello, like 6 month ago i added a custom option to youtube-dl (bindaddress) in order to bind an ip address to youtube-dl video info get and video download, fo this i added this in init.py:

    commandLineConf = sys.argv[1:]
    argv = systemConf + userConf + commandLineConf
    opts, args = parser.parse_args(argv)

    if opts.bindaddress:
        true_socket = socket.socket
        def bound_socket(*a, **k):
            sock = true_socket(*a, **k)
            sock.bind(("%s" % opts.bindaddress, 0))
            return sock
        socket.socket = bound_socket    

    if opts.verbose:
        write_string(u'[debug] System config: ' + repr(_hide_login_info(systemConf)) + '\n')
        write_string(u'[debug] User config: ' + repr(_hide_login_info(userConf)) + '\n')
        write_string(u'[debug] Command-line args: ' + repr(_hide_login_info(commandLineConf)) + '\n')

return parser, opts, args

def _real_main(argv=None):

I updated youtube-dl 2 days ago and ofc, this custom functionality does not work anymore, i know that this option works untill this commit: 79d09f4

maybe someone knows how o reimport it ? or another way to bind my ip addresses to youtube-dl.

Thanks.

@scfc
Copy link
Contributor

@scfc scfc commented Sep 20, 2017

There is now the option --source-address that should cover your use case. IMHO this issue can be closed.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Sep 20, 2017

Yep, --source-address works just the same as the original poster's patch. Anyway thanks for the idea and the code!

@yan12125 yan12125 closed this Sep 20, 2017
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
3 participants
You can’t perform that action at this time.