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.
Force IPv4 via the Python API #22765
Comments
Have you even read it? youtube-dl/youtube_dl/YoutubeDL.py Line 264 in 824fa51 |
|
Okay, but what is the value to set to the parameter, to force youtube-dl to use IPv4 for the download ? Using "4" output the following error:
|
|
Do you manage reading English at all?
|
|
Please update the documentation then. "--force-ipv4" is the option used for the CLI. Searching for something similar here doesn't find anything and thus is confusing. The option to choose between IPv4 and IPv6 are either "--force-ipvN" or "4" and "6". Suddenly in the API you need to give an IP address, which lack consistency. At least adding some clarification that this option indeed force IPv4 or IPv6 depending on the IP you set would be much better. For anyone else reading this and wanting to force IPv4, use '0.0.0.0' as your IP address. |
|
@orion40 Thank you! You have helped me figure out how to force IPv4. |
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.08.02
[debug] Python version 3.7.3 (CPython) - Linux-4.19.0-5-amd64-x86_64-with-debian-10.1
[debug] exe versions: ffmpeg 4.1.4-1, ffprobe 4.1.4-1
[debug] Proxy map: {}
I am trying to use the youtube-dl python API. However according to the options listed here, it is not possible to do so programmatically. A quick glance at the source code didn't help find such option.
There is however the option
--force-ipv4available with the program itself. It should be possible to also do so with python, maybe like this:yt_dl_opts = { 'format': 'bestaudio/best' 'forceip':'4' }And so this would work as if the option
-4was supplied to youtube-dl. Of course it should also be possible to select IPv6 too.If the option is indeed available with the API, then it should be listed in the documentation.
Thanks you for your time.