phub 4.8.4__py3-none-any.whl → 4.8.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- phub/core.py +3 -4
- phub/objects/query.py +8 -5
- {phub-4.8.4.dist-info → phub-4.8.5.dist-info}/METADATA +1 -1
- {phub-4.8.4.dist-info → phub-4.8.5.dist-info}/RECORD +8 -8
- {phub-4.8.4.dist-info → phub-4.8.5.dist-info}/WHEEL +0 -0
- {phub-4.8.4.dist-info → phub-4.8.5.dist-info}/entry_points.txt +0 -0
- {phub-4.8.4.dist-info → phub-4.8.5.dist-info}/licenses/LICENSE +0 -0
- {phub-4.8.4.dist-info → phub-4.8.5.dist-info}/top_level.txt +0 -0
phub/core.py
CHANGED
|
@@ -361,7 +361,7 @@ class Client:
|
|
|
361
361
|
AssertioneError: If one or more filters don't match their literals.
|
|
362
362
|
'''
|
|
363
363
|
|
|
364
|
-
query = query.strip()
|
|
364
|
+
query = query.strip().lower()
|
|
365
365
|
|
|
366
366
|
assert query, 'Query must be a non-empty string'
|
|
367
367
|
|
|
@@ -370,7 +370,7 @@ class Client:
|
|
|
370
370
|
literals.ass('exclude_category', exclude_category, literals.category )
|
|
371
371
|
literals.ass('sort' , sort , literals.sort )
|
|
372
372
|
literals.ass('period' , period , literals.period )
|
|
373
|
-
|
|
373
|
+
s = f'search "{query}"'
|
|
374
374
|
return queries.VideoQuery(
|
|
375
375
|
client = self,
|
|
376
376
|
func = 'video/search',
|
|
@@ -383,8 +383,7 @@ class Client:
|
|
|
383
383
|
't': literals.map.period.get(period),
|
|
384
384
|
'hd': literals._craft_boolean(hd)
|
|
385
385
|
},
|
|
386
|
-
query_repr =
|
|
387
|
-
)
|
|
386
|
+
query_repr = s)
|
|
388
387
|
|
|
389
388
|
def get_playlist(self, playlist: Union[str, int, Playlist]) -> Playlist:
|
|
390
389
|
'''
|
phub/objects/query.py
CHANGED
|
@@ -5,6 +5,7 @@ import logging
|
|
|
5
5
|
from base_api.base import setup_logger
|
|
6
6
|
from functools import cache, cached_property
|
|
7
7
|
from typing import TYPE_CHECKING, Iterator, Any, Callable, Union
|
|
8
|
+
from urllib.parse import urlencode, urlsplit, parse_qsl, urlunsplit
|
|
8
9
|
|
|
9
10
|
from . import Video, User, FeedItem
|
|
10
11
|
|
|
@@ -93,7 +94,6 @@ class Query:
|
|
|
93
94
|
self._query_repr = query_repr
|
|
94
95
|
|
|
95
96
|
# Build URL
|
|
96
|
-
args |= {'page': '{page}'}
|
|
97
97
|
self.url = utils.concat(self.BASE, func, utils.urlify(args))
|
|
98
98
|
|
|
99
99
|
self.suppress_spicevids = True
|
|
@@ -181,14 +181,17 @@ class Query:
|
|
|
181
181
|
Returns:
|
|
182
182
|
str: The raw page content.
|
|
183
183
|
'''
|
|
184
|
-
|
|
184
|
+
|
|
185
185
|
assert isinstance(index, int)
|
|
186
|
-
|
|
186
|
+
parts = list(urlsplit(self.url))
|
|
187
|
+
q = dict(parse_qsl(parts[3], keep_blank_values=True))
|
|
188
|
+
q['page'] = str(index + 1) # PH uses 1-based pages; omit or set "1" for page 1
|
|
189
|
+
parts[3] = urlencode(q)
|
|
190
|
+
url = urlunsplit(parts)
|
|
191
|
+
|
|
187
192
|
req = self.client.call(url, get_response=True, throw=False)
|
|
188
|
-
|
|
189
193
|
if req.status_code == 404:
|
|
190
194
|
raise errors.NoResult()
|
|
191
|
-
|
|
192
195
|
return req.text
|
|
193
196
|
|
|
194
197
|
@cache
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
phub/__init__.py,sha256=tEWpP7XSkDB9_M5iJ1XHSgpJ6g4olWqYTX8f9IBpIAA,635
|
|
2
2
|
phub/__main__.py,sha256=nP5IffsxbcFzPdGkMWky4fs647NOswW9DT-S5AcLQtU,4028
|
|
3
3
|
phub/consts.py,sha256=a-okcZtwtSDmt4eub_acE1xWg1Fqxm1DZ9yy7aVGvM0,12453
|
|
4
|
-
phub/core.py,sha256=
|
|
4
|
+
phub/core.py,sha256=_5iMMcvnt9Ue-1YY1u0Nlc4Sra-VMHFoiLcxIaUSLSM,18441
|
|
5
5
|
phub/errors.py,sha256=KiNt_4T4ffzgL-2iIfD8qhIHN_5DeKV4FLPcY72sOw8,1822
|
|
6
6
|
phub/literals.py,sha256=ZnRnn5hJNI3hM6aj2YxsxPANUR-PCqfE2SuQGD8_Yq4,10794
|
|
7
7
|
phub/utils.py,sha256=MYPYvpLrWAYXcwpSUJnRWvFNP0N9iOyLxkzaJFsk8GA,6582
|
|
@@ -15,7 +15,7 @@ phub/objects/data.py,sha256=hJpbuL185CLmISYCsmVu8WZVJEsiFC246bL1-QHa9j0,5967
|
|
|
15
15
|
phub/objects/feed.py,sha256=JFvNc59VfGXU3PiW17GySQooy-5h8zLfl0vHIs9ga48,2691
|
|
16
16
|
phub/objects/image.py,sha256=qCLuaOy-EYzA_uXxiPRQeCLHPf9gFr0o7TDszQvWXZs,3376
|
|
17
17
|
phub/objects/playlist.py,sha256=hpP76yH23LdDS0iL28jhp_iG7EGetYJA3xoqZZdXjTs,3278
|
|
18
|
-
phub/objects/query.py,sha256=
|
|
18
|
+
phub/objects/query.py,sha256=gALFeOQA48loUStLA_d9npQHIAkw0CdTAIOQ_h_tFuA,11811
|
|
19
19
|
phub/objects/user.py,sha256=pIumIGC_MQXQ-hjzf_0c0I_egL4WziHrh2e8XegArEc,8161
|
|
20
20
|
phub/objects/video.py,sha256=0XJL-PP8HVqb2uUexIMZVfQ29-qGEeb60_yVoj3RLuc,19169
|
|
21
21
|
phub/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -24,9 +24,9 @@ phub/tests/test_model.py,sha256=hRpmIjsx2z0EjTWsIpwT_vpHm-H4wCmZtvGWOohaIKQ,1426
|
|
|
24
24
|
phub/tests/test_playlist.py,sha256=-hS5bIBecsv3zSNlUo66b73DdVbkYlmVThYip9Ivpss,1081
|
|
25
25
|
phub/tests/test_search.py,sha256=VeqyjVzu0QnIYR6NhcujXy8wfCcWn1BlvKS06iY-7JY,1301
|
|
26
26
|
phub/tests/test_video.py,sha256=4E70tiza45byMFIrjBdnpP3xOSyk1YKoTGNP4_QTI0E,1465
|
|
27
|
-
phub-4.8.
|
|
28
|
-
phub-4.8.
|
|
29
|
-
phub-4.8.
|
|
30
|
-
phub-4.8.
|
|
31
|
-
phub-4.8.
|
|
32
|
-
phub-4.8.
|
|
27
|
+
phub-4.8.5.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
28
|
+
phub-4.8.5.dist-info/METADATA,sha256=K7OEBgDD9c1VArJvma_ccZmUZ0yi177cSxbUmIMon8k,41758
|
|
29
|
+
phub-4.8.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
30
|
+
phub-4.8.5.dist-info/entry_points.txt,sha256=oxL1BvDV19M1IGLgwFElgb37PlmGnblDBEfMwx3x6u8,44
|
|
31
|
+
phub-4.8.5.dist-info/top_level.txt,sha256=xqJ5Lg28Ba-pgvXf8qwpTFurW3neZhguNd8bhbQonZo,5
|
|
32
|
+
phub-4.8.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|