diff options
author | coletdjnz <colethedj@protonmail.com> | 2021-04-14 05:07:03 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-14 10:37:03 +0530 |
commit | 8ea3f7b9095685eed8ba191498a81213dfae1f91 (patch) | |
tree | f1606b81012d514f4ad73833aaddfd6ba3a2c536 /yt_dlp | |
parent | 921b76cab8ac61b8234e511973d4b5bf934e5c2f (diff) | |
download | hypervideo-pre-8ea3f7b9095685eed8ba191498a81213dfae1f91.tar.lz hypervideo-pre-8ea3f7b9095685eed8ba191498a81213dfae1f91.tar.xz hypervideo-pre-8ea3f7b9095685eed8ba191498a81213dfae1f91.zip |
[youtube] Improve channel syncid extraction to support ytcfg (#241)
Authored by: colethedj
Diffstat (limited to 'yt_dlp')
-rw-r--r-- | yt_dlp/extractor/youtube.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py index ea09ad358..54b9ce94c 100644 --- a/yt_dlp/extractor/youtube.py +++ b/yt_dlp/extractor/youtube.py @@ -336,14 +336,19 @@ class YoutubeBaseInfoExtractor(InfoExtractor): @staticmethod def _extract_account_syncid(data): - """Extract syncId required to download private playlists of secondary channels""" - sync_ids = ( - try_get(data, lambda x: x['responseContext']['mainAppWebResponseContext']['datasyncId'], compat_str) - or '').split("||") + """ + Extract syncId required to download private playlists of secondary channels + @param data Either response or ytcfg + """ + sync_ids = (try_get( + data, (lambda x: x['responseContext']['mainAppWebResponseContext']['datasyncId'], + lambda x: x['DATASYNC_ID']), compat_str) or '').split("||") if len(sync_ids) >= 2 and sync_ids[1]: # datasyncid is of the form "channel_syncid||user_syncid" for secondary channel # and just "user_syncid||" for primary channel. We only want the channel_syncid return sync_ids[0] + # ytcfg includes channel_syncid if on secondary channel + return data.get('DELEGATED_SESSION_ID') def _extract_ytcfg(self, video_id, webpage): return self._parse_json( |