mirror of
https://github.com/yt-dlp/yt-dlp
synced 2025-12-17 14:45:42 +07:00
[youtube] Fix search continuations
This commit is contained in:
@@ -3181,6 +3181,12 @@ def _entries(self, query, n):
|
|||||||
# So we search through all entries till we find them.
|
# So we search through all entries till we find them.
|
||||||
continuation_token = None
|
continuation_token = None
|
||||||
for slr_content in slr_contents:
|
for slr_content in slr_contents:
|
||||||
|
if continuation_token is None:
|
||||||
|
continuation_token = try_get(
|
||||||
|
slr_content,
|
||||||
|
lambda x: x['continuationItemRenderer']['continuationEndpoint']['continuationCommand']['token'],
|
||||||
|
compat_str)
|
||||||
|
|
||||||
isr_contents = try_get(
|
isr_contents = try_get(
|
||||||
slr_content,
|
slr_content,
|
||||||
lambda x: x['itemSectionRenderer']['contents'],
|
lambda x: x['itemSectionRenderer']['contents'],
|
||||||
@@ -3202,12 +3208,6 @@ def _entries(self, query, n):
|
|||||||
if total == n:
|
if total == n:
|
||||||
return
|
return
|
||||||
|
|
||||||
if continuation_token is None:
|
|
||||||
continuation_token = try_get(
|
|
||||||
slr_content,
|
|
||||||
lambda x: x['continuationItemRenderer']['continuationEndpoint']['continuationCommand']['token'],
|
|
||||||
compat_str)
|
|
||||||
|
|
||||||
if not continuation_token:
|
if not continuation_token:
|
||||||
break
|
break
|
||||||
data['continuation'] = continuation_token
|
data['continuation'] = continuation_token
|
||||||
|
|||||||
Reference in New Issue
Block a user