-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Build youtube-dl from source #32076
Comments
In some order ...
|
already search not found any answer, forget to click
read but need more information because >(noob)instruction
for Old PC Pentium III\Athlon Xp (no SSE2) Python 2.7 Windows xp sp3
yep, dlp is not solution in my case, because in Old PC(no SSE2) python version is under support 3.7+ |
yt-dlp wasn't the solution I meant but the unofficial Windows nightly yt-dl build won't help you if Python 3.4 is not supported. I'm fairly sure no-one here now can remember how to do what you want to do, but @Vangelis66 may have some idea (eg, where to find a later Python for your system). If you have Py 2.7 installed and a working git, you can clone the master branch (or any other commit) and run the code from the local clone, or possibly install it as a Python module. |
if you about this /~https://github.com/ytdl-patched/youtube-dl/releases In this git you fix low speed problem, some enthusiast from forum make build exe and its work with full speed, but he use modern python and its not work on win xp python 2.7 old pc.
nope, just have clean ubuntu virtualbox and my enthusiasm to try build it. |
The unofficial nightly builds use the latest code including the speed-up fixes (and tomorrow, the fix for #32066, I hope). But the single file self-extracting build uses its own Py 3.4 so probably won't work for you. There's no non-Python code in yt-dl itself since the hard work is passed to ffmpeg: thus your Py 2.7 should be able to run yt-dl as well as it runs with a new Python, if a bit slower. |
@YoshiKill: MSFN forums member @nicolaasjan builds a The binary is built against CPython 3.4.4, the last to support XP SP3... Problem is he hosts those builds on his dropbox account, direct links (which change over time) are only visible in his MSFN member signature (i.e. you need to be a member there to see them...). https://msfn.org/board/topic/184368-who-here-has-a-youtube-dl-compile-for-winxp/#comment-1236966 At the time of this writing, the latest link is
(Please, don't abuse that account's bandwidth with mirroring...). The downloaded binary has a "last modified timestamp" of 20230414, so it was built on 26035bd and thus doesn't yet contain the fix for #32066; give him a day or two to update it (the whole process is manual) and, hopefully, you should be fine... AFAIAA, no Being a total "noob" should make it a somewhat daunting task to compile the EXE, but nicolaas might be willing to break the process down to "baby" steps 😜 ... As dirkf wrote above, if py2.7 is an absolute must, you could install CPython 2.7.18 and run |
see this thread - #30261 |
I'm up to date now (211cbfd). 😀️ However, ytdl-patched is now up to date as well. 🙂 |
@YoshiKill, can't you update your Python 2.7 to Python 3.4.4? To build from source:
|
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
@Vangelis66 @nicolaasjan thanks a lot, this version work good with full speed.
yes, now i figure out that latest version that work with out SSE2 is 3.4.10, try to install and its work. @nicolaasjan about your instruction, what OS you use for build? I use Ubuntu 22.04 and in step of "Install dependencies" i have error
mostly yes, but now i try to run build correctly from issues up |
The message is saying that on Ubuntu 22.04 you need to do:
Then you can run Checking the MSFN thread I'm (as usual) in awe of the work there. If it might help, the error reported from Py 3.8 with yt-dlp (missing import |
I build As far as I know you can't build an On Ubuntu you can however build the Linux executable
It uses the system installed Python. |
This comment was marked as off-topic.
This comment was marked as off-topic.
@nicolaasjan thanks for instruction, mostly i need the way to build youtube-dl.exe for windows (xp) that is priority method to learn. So can you again, step by step tell what i need to do to build youtube-dl.exe ? I use (ubuntu) linux example only because i guess this is typical OS to build for all platforms. this is log just in case to show how it build in ubuntu and (not)run youtube-dl from /home dir
This as i said run fine then you put youtube-dl in right folders /usr/local/bin/
|
Can you tell me which step(s) in my tutorial above you have issues with? The rest speaks for itself I think. Also, make sure SSE compatible FFmpeg binaries for XP available here. |
this is hardest step but i heroically done it ;) I have problem with this step
in my case i don't understand what to do with this, run in cmd or whatever? I try run it in cmd at first time in my windows 7 virtualbox and have error, then run Then i try another way, i download windows xp for virtualbox(you can find it on web archive), run it, install python 3.4.10, download source zip youtube-dl. And all done. It build youtube-dl.exe |
Good to hear you finally succeeded in building. Now I'm curious what error you encountered in Windows 7. |
... Incidentally, when that last comment was made (22/04/2023, 05:19Z), Additionally, I should like to highlight some differences (which are not immediately obvious) between the
so, provided your |
Well, the opening post of this very issue has the following request:
Further down in the discussion:
In the MSFN thread I linked above, UK member loblo wrote (on page 4):
Last night I set out to do just that, i.e. build a CPython 2.7.18 My old laptop has Vista SP2 32-bit as OS, so I made a (custom) installation of Python-2.7.18_x86 (Windows x86 MSI installer); my main install dir is Preparing the env+dependencies: python -m ensurepip -U =>
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Looking in links: c:\users\<redacted>\appdata\local\temp\tmpjn7mdq
Collecting setuptools
Collecting pip
Installing collected packages: setuptools, pip
Successfully installed pip-19.2.3 setuptools-41.2.0 python -m pip --no-python-version-warning install -U pip setuptools wheel =>
Collecting pip
Downloading https://files.pythonhosted.org/packages/27/79/8a850fe3496446ff0d584327ae44e7500daf6764ca1a382d2d02789accf7/pip-20.3.4-py2.py3-none-any.whl (1.5MB)
|ΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫ| 1.5MB 819kB/s
Collecting setuptools
Downloading https://files.pythonhosted.org/packages/e1/b7/182161210a13158cd3ccc41ee19aadef54496b74f2817cc147006ec932b4/setuptools-44.1.1-py2.py3-none-any.whl (583kB)
|ΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫ| 583kB 1.1MB/s
Collecting wheel
Downloading https://files.pythonhosted.org/packages/27/d6/003e593296a85fd6ed616ed962795b2f87709c3eee2bca4f6d0fe55c6d00/wheel-0.37.1-py2.py3-none-any.whl
Installing collected packages: pip, setuptools, wheel
Found existing installation: pip 19.2.3
Uninstalling pip-19.2.3:
Successfully uninstalled pip-19.2.3
Found existing installation: setuptools 41.2.0
Uninstalling setuptools-41.2.0:
Successfully uninstalled setuptools-41.2.0
Successfully installed pip-20.3.4 setuptools-44.1.1 wheel-0.37.1 PyCrypto: PyPI only holds the source of that module; python -m pip --no-python-version-warning install "pycrypto@/~https://github.com/jvansteirteghem/twunnel-app/raw/master/pip/pycrypto-2.6.1-cp27-none-win32.whl" =>
Collecting pycrypto@ /~https://github.com/jvansteirteghem/twunnel-app/raw/master/pip/pycrypto-2.6.1-cp27-none-win32.whl
Downloading /~https://github.com/jvansteirteghem/twunnel-app/raw/master/pip/pycrypto-2.6.1-cp27-none-win32.whl (482 kB)
|ΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫ| 482 kB 506 kB/s
Installing collected packages: pycrypto
Successfully installed pycrypto-2.6.1 py2exe: PyPI doesn't hold anything suitable for py2.7, as far as this module is concerned 👎 ; the EoS version for CPython-2.7.18 is py2exe-0.6.9; source and binary installer (in .EXE format) for that old version are hosted only on SF; compiling from source would, again, have required python -m pip --no-python-version-warning install py2exe_py2 =>
Collecting py2exe_py2
Downloading py2exe_py2-0.6.9-cp27-none-win32.whl (134 kB)
|ΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫΫ| 134 kB 469 kB/s
Installing collected packages: py2exe-py2
Successfully installed py2exe-py2-0.6.9 Lastly, python -m pip --no-python-version-warning list -u =>
Package Version
---------- -------
pip 20.3.4
py2exe-py2 0.6.9
pycrypto 2.6.1
setuptools 44.1.1
wheel 0.37.1 Actually compiling: I downloaded latest (i.e.: File from __future__ import unicode_literals
__version__ = '2023.04.21' I decided to also enable "Lazy Extractors", to enhance launching performance, thus: in the Windows Command Prompt, I CD'ed to inside python "devscripts/make_lazy_extractors.py" "youtube_dl/extractor/lazy_extractors.py" =>
WARNING: Lazy loading extractors is an experimental feature that may not always work As the last step: python setup.py py2exe =>
(voluminous output curtailed)
...
*** binary dependencies ***
Your executable(s) also depend on these dlls which are not included,
you may or may not need to distribute them.
Make sure you have the license if you distribute any of them, and
make sure you don't distribute files belonging to the operating system.
OLEAUT32.dll - C:\Windows\system32\OLEAUT32.dll
USER32.dll - C:\Windows\system32\USER32.dll
SHELL32.dll - C:\Windows\system32\SHELL32.dll
KERNEL32.dll - C:\Windows\system32\KERNEL32.dll
ADVAPI32.dll - C:\Windows\system32\ADVAPI32.dll
WS2_32.dll - C:\Windows\system32\WS2_32.dll
GDI32.dll - C:\Windows\system32\GDI32.dll
ole32.dll - C:\Windows\system32\ole32.dll A new DIR called youtube-dl -v =>
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v']
[debug] Encodings: locale cp1253, fs mbcs, out cp737, pref cp1253
[debug] youtube-dl version 2023.04.21
[debug] Lazy loading extractors enabled
[debug] Python version 2.7.18 (CPython) - Windows-Vista-6.0.6003-SP2
[debug] exe versions: none
[debug] Proxy map: {}
Usage: youtube-dl [OPTIONS] URL [URL...]
youtube-dl: error: You must provide at least one URL.
Type youtube-dl --help to see a list of all options. I believe my detailed building guide (thanks nicolaasjan 😄 ) is of some value, at least to retrocomputing Windows communities... If there's any interest for it (e.g. testing purposes), I could attach the resultant Kind regards. |
@dirkf If it's stable enough, I will implement it in my build. |
I believe it works and may be worth trialling in your build. I have some pending updates as part of the new build but would appreciate knowing of any problems that should be fixed. One issue with the lazy extractor test (in |
Could you elaborate? In the meantime, I've uploaded the Unix and Windows binaries to Dropbox for you to do some testing, if you wish (with #29581 and #29593 included and also the Soundcloud fix #30998).
I don't quite understand that part. |
... If on Linux, you can use the time youtube.dl --ignore-config More about that here 😄 ... As usual, under Windows things are more difficult 😜 ; below, some SU+SO relevant articles: https://superuser.com/questions/228056/windows-equivalent-to-unix-time-command https://stackoverflow.com/questions/739606/how-long-does-a-batch-file-take-to-execute/739620#739620 Solutions involve MS and/or 3rd party utilities, batch files and PowerShell scripts (e.g.: Measure-Command {Start-Process -NoNewWindow ".\youtube-dl.exe" --ignore-config -Wait} ) ... The (old) I did a comparison between your previous build (2023.04.22_nolazy) and the one you linked above (2023.04.30_lazy), both built from the same timeit -s "youtube-dl --ignore-config" Results:
Usage: youtube-dl [OPTIONS] URL [URL...]
youtube-dl: error: You must provide at least one URL.
Type youtube-dl --help to see a list of all options.
Version Number: Windows NT 6.0 (Build 6003)
Exit Time: 2:45 am, Monday, May 1 2023
Elapsed Time: 0:00:04.746
Process Time: 0:00:03.790
Usage: youtube-dl [OPTIONS] URL [URL...]
youtube-dl: error: You must provide at least one URL.
Type youtube-dl --help to see a list of all options.
Version Number: Windows NT 6.0 (Build 6003)
Exit Time: 2:55 am, Monday, May 1 2023
Elapsed Time: 0:00:03.372
Process Time: 0:00:02.605 Thus, the LE-enabled second build loads (Process Time) ca. 45.5% faster compared to the default, non-LE-enabled, build... "Downstream" have further evolved/improved the LE-related code and it's been enabled by default in "their" released builds since many months 😉 ; |
Thanks! On Linux now:
time youtube-dl --ignore-config
Usage: youtube-dl [OPTIONS] URL [URL...]
youtube-dl: error: You must provide at least one URL.
Type youtube-dl --help to see a list of all options.
real 0m1,345s
user 0m1,306s
sys 0m0,037s
time youtube-dl --ignore-config
Usage: youtube-dl [OPTIONS] URL [URL...]
youtube-dl: error: You must provide at least one URL.
Type youtube-dl --help to see a list of all options.
real 0m0,356s
user 0m0,332s
sys 0m0,024s |
The pending changes that I mentioned should bring yt-dl up-to-date. |
... One last (hopefully 😜 ) bit about Lazy Extractors (LE); it appears it's a known thing, see here where pukkandan wrote:
, and I was indeed able to verify that claim with my own, LE-enabled, timeit -a -s "youtube-dl_py27 --version" =>
2023.04.21
Version Number: Windows NT 6.0 (Build 6003)
Average is for 3 runs
Exit Time: 3:28 am, Tuesday, May 2 2023
Elapsed Time: 0:00:00.577 Average: 0:00:00.576
Process Time: 0:00:00.452 Average: 0:00:00.494 In contrast, the LE-enabled timeit -a -s "youtube-dl_py34 --version" =>
2023.04.30
Version Number: Windows NT 6.0 (Build 6003)
Average is for 3 runs
Exit Time: 3:34 am, Tuesday, May 2 2023
Elapsed Time: 0:00:01.549 Average: 0:00:01.647
Process Time: 0:00:01.357 Average: 0:00:01.383 Another case of "newer isn't necessarily better" ? 😉 😄 |
Newer Python 3s are significantly faster than 3.4, maybe ~1.5x for 3.9, another ~2x for 3.11. Typically Py3s win against Py2.7 anyway when the latter has to use shims or home-grown Python code to provide compatible APIs. The size of the program may be a significant win for 2.7 in low memory systems: for Linux x86, 2.7: 3.5MB, 3.5: 4.7MB, 3.9: 4.7MB; for Linux MIPS32, 2.7: 1.7MB. |
@Vangelis66 said:
Lately, I can't build youtube-dl any more with these PR's included... 🙁 |
Checklist
Question
Hello can you help me and give (noob)instruction how to build step by step youtube-dl.exe with python 2.7 version?
The text was updated successfully, but these errors were encountered: