-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
[rh:curl_cffi] Support curl-cffi 0.7.X #10093
base: master
Are you sure you want to change the base?
[rh:curl_cffi] Support curl-cffi 0.7.X #10093
Conversation
curl_cffi_version = tuple(int_or_none(group_or_none(n), default=0) for n in curl_cffi.__version__.split('.')) | ||
|
||
if curl_cffi_version != (0, 5, 10) and not ((0, 7, 0) <= curl_cffi_version < (0, 8, 0)): | ||
print(curl_cffi_version) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print(curl_cffi_version) |
debug leftover
def group_or_none(n): | ||
r = re.match(r'\d+', n) | ||
if r: | ||
return r.group() | ||
|
||
|
||
curl_cffi_version = tuple(int_or_none(group_or_none(n), default=0) for n in curl_cffi.__version__.split('.')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the input string was not numeric, a match object with a pattern of r'(\d+)?'
will return an empty string when group()
is called, then int_or_none
will default to 0
def group_or_none(n): | |
r = re.match(r'\d+', n) | |
if r: | |
return r.group() | |
curl_cffi_version = tuple(int_or_none(group_or_none(n), default=0) for n in curl_cffi.__version__.split('.')) | |
curl_cffi_version = tuple(int_or_none(re.match(r'(\d+)?', n).group(), default=0) for n in curl_cffi.__version__.split('.')) |
@@ -53,7 +53,7 @@ dependencies = [ | |||
|
|||
[project.optional-dependencies] | |||
default = [] | |||
curl-cffi = ["curl-cffi==0.5.10; implementation_name=='cpython'"] | |||
curl-cffi = ["curl-cffi>=0.5.10,!=0.6.*,<0.8; implementation_name=='cpython'"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
been wanting to do this for a while, just for readability / uniformity
curl-cffi = ["curl-cffi>=0.5.10,!=0.6.*,<0.8; implementation_name=='cpython'"] | |
curl-cffi = [ | |
"curl-cffi>=0.5.10,!=0.6.*,<0.8; implementation_name=='cpython'", | |
] |
of course github struggles to render it tho
IMPORTANT: PRs without the template will be CLOSED
Description of your pull request and other information
ADD DESCRIPTION HERE
Adds support for upcoming curl-cffi 0.7.X
0.6.X is skipped due to issues when running on windows.
Currently leaving support for 0.5.10 in case there are issues. Will remove in future
Template
Before submitting a pull request make sure you have:
In order to be accepted and merged into yt-dlp each piece of code must be in public domain or released under Unlicense. Check all of the following options that apply:
What is the purpose of your pull request?