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

[Search] Correct incorrect naming #395

Merged
merged 4 commits into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

VERSION=8
MINOR=8
PATCH=3
PATCH=4
EXTRAVERSION=""

NOTES="(#391)"
NOTES="(#393)"
BRANCH="main"

if [[ -z $PATCH ]]; then
Expand Down
4 changes: 2 additions & 2 deletions docs/user/search.rst
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ It wouldn't be very practical for the user or developer to have to manually retr
>>> from pytubefix.contrib.search import Search, Filter
>>>
>>>
>>> f = {
... 'upload_data': Filter.get_upload_data('Today'),
>>> filters = {
... 'upload_date': Filter.get_upload_date('Today'),
... 'type': Filter.get_type("Video"),
... 'duration': Filter.get_duration("Under 4 minutes"),
... 'features': [Filter.get_features("4K"), Filter.get_features("Creative Commons")],
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "pytubefix"
version = "8.8.3"
version = "8.8.4"
authors = [
{ name="Juan Bindez", email="[email protected]" },
]
Expand Down
10 changes: 5 additions & 5 deletions pytubefix/contrib/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def __init__(
(if passed, else default verifier will be used)
:param dict filters:
(Optional) Apply filters when searching.
Can be used: `upload_data`, `type`, `duration`, `features`, `sort_by`.
Can be used: `upload_date`, `type`, `duration`, `features`, `sort_by`.
features can be combined into a list with other parameters of the same type.
"""
self.query = query
Expand Down Expand Up @@ -397,7 +397,7 @@ class Filter:

def __init__(self):
self.filters = {
'upload_data': None,
'upload_date': None,
'type': None,
'duration': None,
'features': [],
Expand Down Expand Up @@ -449,8 +449,8 @@ def get_filters_params(self):
for feature in self.filters['features']:
combined[2].update(feature)

if self.filters['upload_data']:
combined[2].update(self.filters['upload_data'])
if self.filters['upload_date']:
combined[2].update(self.filters['upload_date'])

combined[2] = dict(sorted(combined.get(2, {}).items()))

Expand All @@ -463,7 +463,7 @@ def get_filters_params(self):
return encoded_filters

@staticmethod
def get_upload_data(option: str) -> dict:
def get_upload_date(option: str) -> dict:
"""
Last Hour,
Today,
Expand Down
4 changes: 2 additions & 2 deletions pytubefix/innertube.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@
'context': {
'client': {
'clientName': 'MWEB',
'clientVersion': '2.20240726.01.00'
'clientVersion': '2.20241202.07.00'
}
}
},
'header': {
'User-Agent': 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Mobile Safari/537.36',
'User-Agent': 'Mozilla/5.0 (iPad; CPU OS 16_7_10 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1,gzip(gfe)',
'X-Youtube-Client-Name': '2'
},
'api_key': 'AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8',
Expand Down
2 changes: 1 addition & 1 deletion pytubefix/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "8.8.3"
__version__ = "8.8.4"

if __name__ == "__main__":
print(__version__)