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

Proxy error httpx #308

Open
Local22221 opened this issue Jan 26, 2025 · 5 comments
Open

Proxy error httpx #308

Local22221 opened this issue Jan 26, 2025 · 5 comments
Labels
bug Something isn't working

Comments

@Local22221
Copy link

Bug report

Version Info

  • Ytmdl version: 2024.08.15.1
  • Youtube-dl version: PUT VERSION HERE

How Ytmdl was installed?

pip

Console Log

Traceback (most recent call last):
C:\Users\Lockie>ytmdl Hello
 ==> Searching to see if already present in C:\Users\Lockie\Music
 ==> Searching Youtube for Hello
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\Lockie\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\Scripts\ytmdl.exe\__main__.py", line 7, in <module>
  File "C:\Users\Lockie\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\ytmdl\main.py", line 614, in entry
    extract_data()
  File "C:\Users\Lockie\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\ytmdl\main.py", line 609, in extract_data
    main(args)
  File "C:\Users\Lockie\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\ytmdl\main.py", line 275, in main
    link, yt_title = search(song_name=song_name, args=args)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Lockie\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\ytmdl\core.py", line 52, in search
    data = yt.search(song_name, not args.disable_metaadd,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Lockie\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\ytmdl\yt.py", line 264, in search
    results = VideosSearch(query, limit=lim).result()["result"]
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Lockie\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\youtubesearchpython\search.py", line 148, in __init__
    self.sync_create()
  File "C:\Users\Lockie\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\youtubesearchpython\core\search.py", line 29, in sync_create
    self._makeRequest()
  File "C:\Users\Lockie\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\youtubesearchpython\core\search.py", line 51, in _makeRequest
    request = self.syncPostRequest()
              ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Lockie\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\youtubesearchpython\core\requests.py", line 20, in syncPostRequest
    return httpx.post(
           ^^^^^^^^^^^
TypeError: post() got an unexpected keyword argument 'proxies'```

## Description
Reinstalled twice, not very experienced with programming stuff, ytmdl fails when trying to download music. The error occurs when I try to search for a song, and it appears to be related to a TypeError with the httpx.post(). The error message states that an unexpected keyword argument proxies was passed. How do I fix this?
@Local22221 Local22221 added the bug Something isn't working label Jan 26, 2025
@CarloDePieri
Copy link

CarloDePieri commented Jan 26, 2025

I can confirm this.

Arch linux
python: 3.13.1
ytmdl: 2024.08.15.1 (installed from the Aur repo, see the PKGBUILD here; I even tried directly from pip in a venv with no luck)
yt-dlp: 2025.01.26 (installed from the Arch repo, it works on its own)

@Local22221
Copy link
Author

I fixed it myself! You have to downgrade httpx to version 0.27! see https://stackoverflow.com/questions/79277656/error-post-got-an-unexpected-keyword-argument-proxies

@Local22221
Copy link
Author

I can confirm this.

Arch linux python: 3.13.1 ytmdl: 2024.08.15.1 (installed from the Aur repo, see the PKGBUILD here; I even tried directly from pip in a venv with no luck) yt-dlp: 2025.01.26 (installed from the Arch repo, it works on its own)

Yep, solution below, Case closed.

@CarloDePieri
Copy link

I can confirm this.
Arch linux python: 3.13.1 ytmdl: 2024.08.15.1 (installed from the Aur repo, see the PKGBUILD here; I even tried directly from pip in a venv with no luck) yt-dlp: 2025.01.26 (installed from the Arch repo, it works on its own)

Yep, solution below, Case closed.

Good job finding the breaking dependency update.
Pinning httpx<0.28 is definitely not fixing the problem though, it's barely a workaround.

The core problem is the dependency on a library which has been archived since mid '22. We need at least to pin httpx for the time being.

@sam1425
Copy link

sam1425 commented Feb 7, 2025

for pipx installs
pipx runpip ytmdl install --force-reinstall 'httpx<0.28'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants