Skip to content

Commit

Permalink
[TikTok] Pass cookies to formats (yt-dlp#2171)
Browse files Browse the repository at this point in the history
Closes yt-dlp#2166
Authored by: MinePlayersPE
  • Loading branch information
MinePlayersPE committed Dec 31, 2021
1 parent cfcf60e commit 6134fbe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions yt_dlp/extractor/tiktok.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ def extract_addr(addr, add_meta={}):
}))

self._remove_duplicate_formats(formats)
auth_cookie = self._get_cookies(self._WEBPAGE_HOST).get('sid_tt')
if auth_cookie:
for f in formats:
self._set_cookie(f['url'], 'sid_tt', auth_cookie.value)
self._sort_formats(formats, ('quality', 'codec', 'size', 'br'))

thumbnails = []
Expand Down

0 comments on commit 6134fbe

Please sign in to comment.