Custom option --bind-address #755

Closed
opened 2026-02-20 23:12:10 -05:00 by deekerman · 1 comment
Owner

Originally created by @vanilla38 on GitHub (Jul 10, 2013).

Hello, since I use tortoise svn i cannot make a pull request so I share it this way:

I made a new option --bind-address which let you choose what address you will use to download with youtube-dl, of course, this address should be available for your computer.

in init.py @ line 152, add this:

general.add_option('--bind-address', dest='bindaddress', default=None, help='Use the specified ip address', metavar='CUSTOMIP')

Then in init.py @ line 350 after: opts, args = parser.parse_args(argv)
add this:

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

Finally still in init.py, add this @ line 590:
'bindaddress': opts.bindaddress,

Sorry for this way of posting but i'm not familiar with Git.

Originally created by @vanilla38 on GitHub (Jul 10, 2013). Hello, since I use tortoise svn i cannot make a pull request so I share it this way: I made a new option --bind-address which let you choose what address you will use to download with youtube-dl, of course, this address should be available for your computer. in **init**.py @ line 152, add this: general.add_option('--bind-address', dest='bindaddress', default=None, help='Use the specified ip address', metavar='CUSTOMIP') Then in **init**.py @ line 350 after: opts, args = parser.parse_args(argv) add this: 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 Finally still in **init**.py, add this @ line 590: 'bindaddress': opts.bindaddress, Sorry for this way of posting but i'm not familiar with Git.
Author
Owner

@phihag commented on GitHub (Jan 10, 2015):

Starting from youtube-dl 2015.01.10.1, you can make use of the --source-address option. See our FAQ if you need help updating.

@phihag commented on GitHub (Jan 10, 2015): Starting from youtube-dl 2015.01.10.1, you can make use of the [`--source-address` option](https://github.com/rg3/youtube-dl/blob/master/README.md#network-options). See [our FAQ](https://yt-dl.org/update) if you need help updating.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl-ytdl-org#755
No description provided.