mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-07 01:47:26 +00:00
[youtube:tab] Make click tracking params on continuation optional
This commit is contained in:
parent
e00b8f60d4
commit
e029da9add
@ -2870,6 +2870,16 @@ class YoutubeTabIE(YoutubeBaseInfoExtractor):
|
|||||||
for entry in self._post_thread_entries(renderer):
|
for entry in self._post_thread_entries(renderer):
|
||||||
yield entry
|
yield entry
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _build_continuation_query(continuation, ctp=None):
|
||||||
|
query = {
|
||||||
|
'ctoken': continuation,
|
||||||
|
'continuation': continuation,
|
||||||
|
}
|
||||||
|
if ctp:
|
||||||
|
query['itct'] = ctp
|
||||||
|
return query
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _extract_next_continuation_data(renderer):
|
def _extract_next_continuation_data(renderer):
|
||||||
next_continuation = try_get(
|
next_continuation = try_get(
|
||||||
@ -2880,11 +2890,7 @@ class YoutubeTabIE(YoutubeBaseInfoExtractor):
|
|||||||
if not continuation:
|
if not continuation:
|
||||||
return
|
return
|
||||||
ctp = next_continuation.get('clickTrackingParams')
|
ctp = next_continuation.get('clickTrackingParams')
|
||||||
return {
|
return YoutubeTabIE._build_continuation_query(continuation, ctp)
|
||||||
'ctoken': continuation,
|
|
||||||
'continuation': continuation,
|
|
||||||
'itct': ctp,
|
|
||||||
}
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _extract_continuation(cls, renderer):
|
def _extract_continuation(cls, renderer):
|
||||||
@ -2907,13 +2913,7 @@ class YoutubeTabIE(YoutubeBaseInfoExtractor):
|
|||||||
if not continuation:
|
if not continuation:
|
||||||
continue
|
continue
|
||||||
ctp = continuation_ep.get('clickTrackingParams')
|
ctp = continuation_ep.get('clickTrackingParams')
|
||||||
if not ctp:
|
return YoutubeTabIE._build_continuation_query(continuation, ctp)
|
||||||
continue
|
|
||||||
return {
|
|
||||||
'ctoken': continuation,
|
|
||||||
'continuation': continuation,
|
|
||||||
'itct': ctp,
|
|
||||||
}
|
|
||||||
|
|
||||||
def _entries(self, tab, identity_token):
|
def _entries(self, tab, identity_token):
|
||||||
tab_content = try_get(tab, lambda x: x['content'], dict)
|
tab_content = try_get(tab, lambda x: x['content'], dict)
|
||||||
|
Loading…
Reference in New Issue
Block a user