Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

httpx minimum to 0.14.2 #139

Merged
merged 1 commit into from
Nov 7, 2021
Merged

httpx minimum to 0.14.2 #139

merged 1 commit into from
Nov 7, 2021

Conversation

rking32
Copy link
Contributor

@rking32 rking32 commented Nov 7, 2021

This library uses proxies param with httpx get and post methods in these places,

return httpx.post(
self.url,
headers={"User-Agent": userAgent},
json=self.data,
timeout=self.timeout,
proxies=self.proxy
)

return httpx.get(self.url, headers={"User-Agent": userAgent}, timeout=self.timeout, cookies={'CONSENT': 'YES+1'}, proxies=self.proxy)

However, the httpx itself got those abilities after the version 0.14.2 (https://github.com/encode/httpx/releases/tag/0.14.2) PR (encode/httpx#1198)

Exception

File "/app/.local/python/lib/python3.9/site-packages/youtubesearchpython/core/requests.py", line 20, in syncPostRequest
    return httpx.post(
TypeError: post() got an unexpected keyword argument 'proxies'

@mytja
Copy link
Collaborator

mytja commented Nov 7, 2021

Question:
Why would you even have a httpx release from 1 year ago installed?!

It seems to be quite common on this library for ppl to have a release from 1 year ago... Although I will merge your PR.

@mytja mytja merged commit afcd58a into alexmercerind:main Nov 7, 2021
@mytja mytja mentioned this pull request Nov 7, 2021
@rking32
Copy link
Contributor Author

rking32 commented Nov 7, 2021

I have been using googletrans (which uses httpx 0.13.3) with this library for a long time without causing any issues. However, I recently got this weird issue and started to analyze what the heck was going on. Finally, I was able to find the cause.

Btw, Thanks for this awesome library.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants