Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v16-webapp-prime.us.tiktok.com 403 #79

Open
piggsoft opened this issue Apr 13, 2024 · 14 comments
Open

v16-webapp-prime.us.tiktok.com 403 #79

piggsoft opened this issue Apr 13, 2024 · 14 comments
Labels
已确认(confirmed) 该issue已被处理,将在下次推送中更新(The issue has been processed and will be updated in the next push) 重复(duplicate) 与已有的反馈或需求重复(This issue or pull request already exists) 提问(question) 想得到更多的详细支持(Further information is requested)

Comments

@piggsoft
Copy link

问题描述
tiktok 下载出现v16-webapp-prime.us.tiktok.com 403

2024-04-13_092043

大家有碰到类似的问题吗?如何解决呢?正常观看是没问题的

@piggsoft piggsoft added the 提问(question) 想得到更多的详细支持(Further information is requested) label Apr 13, 2024
@Johnserf-Seed
Copy link
Owner

  • 代理或者cookie的问题,自行排查

image
image

@Johnserf-Seed
Copy link
Owner

@Johnserf-Seed Johnserf-Seed added 重复(duplicate) 与已有的反馈或需求重复(This issue or pull request already exists) 已确认(confirmed) 该issue已被处理,将在下次推送中更新(The issue has been processed and will be updated in the next push) labels Jun 23, 2024
@Vetches
Copy link

Vetches commented Jun 30, 2024

Hi @Johnserf-Seed! I'm running into this issue still on 0.0.1.6. I'm logged into TikTok and have tried reading cookies with --auto-cookie as well as copying them manually from the browser, but I still run into 403 errors when f2 tries to download videos. It can successfully download the cover and description, which it previously wasn't able to do in 0.0.1.5 or 0.0.1.4, but videos are still not working:

ERROR    HTTP状态错误, 尝试GET请求失败:                                                                                                                                   
         https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/oMBPA2t4rFDUsENQIlEDf4fOEaNYQslMDPgaBR/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=
         3&dr=0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=3816&bt=1908&cs=0&ds=6&ft=4KJMyMzm8Zmo04jap-4jVcDidpWrKsd.&mime_type=video_mp4&qs=0&rc=Ozw2Nmk6NDtmNTk0ZjwzZEBpM2duNnk5cjln
         cTMzZjczM0BeMjJfXzMxXzMxYTUwMzQtYSM0MDFqMmRramRgLS1kMWNzcw%3D%3D&btag=e00090000&expire=1719791120&l=202406301743533B4E4C5F9535AEC20EDA&ply_type=2&policy=2&signat
         ure=e5a42e51c5543e696ed1b6901c3ad10e&tk=tt_chain_token, 错误详情: Client error '403 Forbidden' for url                                                           
         'https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/oMBPA2t4rFDUsENQIlEDf4fOEaNYQslMDPgaBR/?a=1988&bti=ODszNWYuMDE6&ch=0&cr
         =3&dr=0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=3816&bt=1908&cs=0&ds=6&ft=4KJMyMzm8Zmo04jap-4jVcDidpWrKsd.&mime_type=video_mp4&qs=0&rc=Ozw2Nmk6NDtmNTk0ZjwzZEBpM2duNnk5cjl
         ncTMzZjczM0BeMjJfXzMxXzMxYTUwMzQtYSM0MDFqMmRramRgLS1kMWNzcw%3D%3D&btag=e00090000&expire=1719791120&l=202406301743533B4E4C5F9535AEC20EDA&ply_type=2&policy=2&signa
         ture=e5a42e51c5543e696ed1b6901c3ad10e&tk=tt_chain_token'                                                                                                         
         For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403                                                                         
WARNING  link                                                                                                                                                             
         https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-pve-0037-aiso/oArPIfeNQMPg6UYWDQnAEUVNVNkQjB9CQbD2bU/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=3&dr
         =0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=3004&bt=1502&cs=0&ds=6&ft=4KJMyMzm8Zmo04jap-4jVcDidpWrKsd.&mime_type=video_mp4&qs=0&rc=aWgzaTo3NGZpODo1NjkzNEBpamRmPDk6Zjt1azMz
         ZjgzM0BgLmIyMDAyXjAxYWMvMi8yYSNjY2dncjQwXl5gLS1kL2Nzcw%3D%3D&btag=e00090000&expire=1719791121&l=202406301743533B4E4C5F9535AEC20EDA&ply_type=2&policy=2&signature=
         37fc6cf6244a8321e15bb61af66f99f1&tk=tt_chain_token content length 0, try next link if available                                                                  
WARNING  所有链接都无法下载                                                                                                                                               
WARNING  link                                                                                                                                                             
         https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/oMBPA2t4rFDUsENQIlEDf4fOEaNYQslMDPgaBR/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=
         3&dr=0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=3816&bt=1908&cs=0&ds=6&ft=4KJMyMzm8Zmo04jap-4jVcDidpWrKsd.&mime_type=video_mp4&qs=0&rc=Ozw2Nmk6NDtmNTk0ZjwzZEBpM2duNnk5cjln
         cTMzZjczM0BeMjJfXzMxXzMxYTUwMzQtYSM0MDFqMmRramRgLS1kMWNzcw%3D%3D&btag=e00090000&expire=1719791120&l=202406301743533B4E4C5F9535AEC20EDA&ply_type=2&policy=2&signat
         ure=e5a42e51c5543e696ed1b6901c3ad10e&tk=tt_chain_token content length 0, try next link if available                                                              
WARNING  所有链接都无法下载                                                                                                                                               
ERROR    Traceback (most recent call last):                                                                                                                               
           File "/Users/user/.pyenv/versions/3.10.10/lib/python3.10/site-packages/f2/utils/_dl.py", line 42, in get_content_length                           
             response.raise_for_status()                                                                                                                                  
           File "/Users/user/.pyenv/versions/3.10.10/lib/python3.10/site-packages/httpx/_models.py", line 761, in raise_for_status                           
             raise HTTPStatusError(message, request=request, response=self)                                                                                               
         httpx.HTTPStatusError: Client error '403 Forbidden' for url                                                                                                      
         'https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068-euttp/owIGiqKQos0IAIbAzDEiMSijCyhBnMfmAWQXBd/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=3&d
         r=0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=2820&bt=1410&cs=0&ds=6&ft=4KJMyMzm8Zmo04jap-4jVcDidpWrKsd.&mime_type=video_mp4&qs=0&rc=aDw8N2llNmVpNGk0Zzw3ZUBpanBpNm45cjdzdDM
         zZjczM0AvLTAuNGEwXzUxYy4yYi4tYSNfMTBpMmRjYC1gLS1kMWNzcw%3D%3D&btag=e00088000&expire=1719791053&l=202406301743533B4E4C5F9535AEC20EDA&ply_type=2&policy=2&signature
         =adad4017f2206a2fd7b3a41a5c9138c8&tk=tt_chain_token'                                                                                                             
         For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403                                                                         
                                                                                                                                                                          
         During handling of the above exception, another exception occurred:                                                                                              
                                                                                                                                                                          
         Traceback (most recent call last):                                                                                                                               
           File "/Users/user/.pyenv/versions/3.10.10/lib/python3.10/site-packages/f2/utils/_dl.py", line 73, in get_content_length                           
             response.raise_for_status()                                                                                                                                  
           File "/Users/user/.pyenv/versions/3.10.10/lib/python3.10/site-packages/httpx/_models.py", line 761, in raise_for_status                           
             raise HTTPStatusError(message, request=request, response=self)                                                                                               
         httpx.HTTPStatusError: Client error '403 Forbidden' for url                                                                                                      
         'https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068-euttp/owIGiqKQos0IAIbAzDEiMSijCyhBnMfmAWQXBd/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=3&d
         r=0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=2820&bt=1410&cs=0&ds=6&ft=4KJMyMzm8Zmo04jap-4jVcDidpWrKsd.&mime_type=video_mp4&qs=0&rc=aDw8N2llNmVpNGk0Zzw3ZUBpanBpNm45cjdzdDM
         zZjczM0AvLTAuNGEwXzUxYy4yYi4tYSNfMTBpMmRjYC1gLS1kMWNzcw%3D%3D&btag=e00088000&expire=1719791053&l=202406301743533B4E4C5F9535AEC20EDA&ply_type=2&policy=2&signature
         =adad4017f2206a2fd7b3a41a5c9138c8&tk=tt_chain_token'                                                                                                             
         For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403                                                                         
                                                                                                                                                                          
ERROR    HTTP状态错误, 尝试GET请求失败:                                                                                                                                   
         https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068-euttp/owIGiqKQos0IAIbAzDEiMSijCyhBnMfmAWQXBd/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=3&dr
         =0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=2820&bt=1410&cs=0&ds=6&ft=4KJMyMzm8Zmo04jap-4jVcDidpWrKsd.&mime_type=video_mp4&qs=0&rc=aDw8N2llNmVpNGk0Zzw3ZUBpanBpNm45cjdzdDMz
         ZjczM0AvLTAuNGEwXzUxYy4yYi4tYSNfMTBpMmRjYC1gLS1kMWNzcw%3D%3D&btag=e00088000&expire=1719791053&l=202406301743533B4E4C5F9535AEC20EDA&ply_type=2&policy=2&signature=
         adad4017f2206a2fd7b3a41a5c9138c8&tk=tt_chain_token, 错误详情: Client error '403 Forbidden' for url                                                               
         'https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068-euttp/owIGiqKQos0IAIbAzDEiMSijCyhBnMfmAWQXBd/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=3&d
         r=0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=2820&bt=1410&cs=0&ds=6&ft=4KJMyMzm8Zmo04jap-4jVcDidpWrKsd.&mime_type=video_mp4&qs=0&rc=aDw8N2llNmVpNGk0Zzw3ZUBpanBpNm45cjdzdDM
         zZjczM0AvLTAuNGEwXzUxYy4yYi4tYSNfMTBpMmRjYC1gLS1kMWNzcw%3D%3D&btag=e00088000&expire=1719791053&l=202406301743533B4E4C5F9535AEC20EDA&ply_type=2&policy=2&signature
         =adad4017f2206a2fd7b3a41a5c9138c8&tk=tt_chain_token'                                                                                                             
         For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403   

Here is my config!:

tiktok:
  User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML,
    like Gecko) Chrome/125.0.0.0 Safari/537.36
  cookie: tt_csrf_token=CrMfLmKd-eKF790-9TrPVNqakmiHeyH1D6mM; xxx=xxxx;
  cover: true
  dataType: 8
  desc: true
  folderize: false
  headers:
    Referer: https://www.tiktok.com/
    User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36
      (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
  interval: all
  language: en_US
  magic: 538969122
  max_connections: 5
  max_counts: 0
  max_retries: 20
  max_tasks: 5
  mode: post
  msToken:
    User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36
      (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
    dataType: 8
    magic: 538969122
    strData: L4ewPx28JPUaoDr6cApcBI76s4x_UDCzduSiHMaWUpVKIEkXhONE6qzHpK88ECXcKNABvskwQC1FnMLlSXG67L8_M-vxTyrAH6q8d52cEWa3dnak8hiGlL1cVVYf1pC_Hdk-uLYOV_FuDUoOnz4=
    url: https://mssdk.bytedance.com/web/report
    version: 1
  music: false
  naming: '{create}_{desc}'
  odin_tt:
    url: https://www.tiktok.com/passport/web/account/info/?aid=1459&app_language=zh-Hans&app_name=tiktok_web&browser_language=zh-CN&browser_name=Mozilla&browser_online=true&browser_platform=Win32&browser_version=5.0%20%28Windows%20NT%2010.0%3B%20Win64%3B%20x64%29%20AppleWebKit%2F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F119.0.0.0%20Safari%2F537.36&channel=tiktok_web&cookie_enabled=true&device_id=7306060721837852167&root_referer=https%3A%2F%2Fwww.tiktok.com
  page_counts: 20
  path: /Users/user/Desktop/F2/test1
  proxies:
    http: null
    https: null
  strData: 3BvqYbNXLLOcZehvxZVbjpAu7vq82RoWmFSJHLFwzDwJIZevE0AeilQfP55LridxmdGGjknoksqIsLqlMHMif0IFK/Br7JWqxOHnYuMwVCnttFc0Y4MFvdVWM5FECiEulJC0Dc+eeVsNSrFnAc9K7fazqdglyJgGLSfXIJmgyCvvQ4pg0u5HBVVugLSWs242X42fjoWymaUCLZJQo6vi6WLyuV7l5IC3Mg+lelr5xBQD6Q7hBIFEw8zzxJ1n2DyA4xLbOHTQdKvEtsK7XzyWwjpRnojPTbBl69Zosnuru+lOBIl+tFu/+hCQ1m0jYZwTP4rVE75L3Du6+KZ5v/9TyFYjq7y3y9bGLP4d7yQueJbF90G1yrZ6htElrZ2vqZKDrIqBVbmOZr/nph12k2JKrITtN0R/pMsp0sJ4gesQnXxcD/pLOFAINHk7umgbe6LzJ7+TLUdGuO4M7xiEg/jCqhjgJX1izZ4NPoBDp35zRxj6Y6OrcstlTN/cv5sz663+Nco/mEwhGq2VwrL4gAIAPycndIsb48dPdtngmLqNDNN0ZyVRjgqVIDXXrxigXCkR9CH89Dlrrb7QQqWVgRXz9/k5ihEM43BR3sd3mMU/XgFLN1Aoxf6GzzdxP2QPBI75/ZoHoAmu54v8gTmA3ntCGlEF0zgaFGTdpkGdb+oZgyQM4pw1aAyxmFINXkpD3IKKoGev9kD9gTFnhiQMGCMemhZS7ZYdbuGu0Cb+lQKaL/QTt80FMyGmW8kzVy9xW/ja9BcdEJYRoaufuFRkBFG5ay8x4WHLR6hEapXqQial/cREbLL4sQytpjtmnndFqvT7xN5DhgsLY2Z7451MJhD6NJXKNrMafGZSbItzQWY=
  timeout: 10
  ttwid:
    cookie: 1%7CVHrH5Mr2patcBf6Et_ELdIH_XysKWoAofxNgVkbJTzA%7C1702562457%7Ceda860c7cf77c4f2c0f7a19622a7536869842169b01c2c102bebeac79c4e7eed
    data: '{"aid":1988,"service":"www.tiktok.com","union":false,"unionHost":"","needFid":false,"fid":"","migrate_priority":0}'
    url: https://www.tiktok.com/ttwid/check/
  url: https://www.tiktok.com/@gordonramsayofficial
  version: 1

Am I missing something with how this yaml is set up? Any insight would be greatly appreciated, thank you so much!

@Johnserf-Seed
Copy link
Owner

Hi @Johnserf-Seed! I'm running into this issue still on 0.0.1.6. I'm logged into TikTok and have tried reading cookies with --auto-cookie as well as copying them manually from the browser, but I still run into 403 errors when f2 tries to download videos. It can successfully download the cover and description, which it previously wasn't able to do in 0.0.1.5 or 0.0.1.4, but videos are still not working:

ERROR    HTTP状态错误, 尝试GET请求失败:                                                                                                                                   
         https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/oMBPA2t4rFDUsENQIlEDf4fOEaNYQslMDPgaBR/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=
         3&dr=0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=3816&bt=1908&cs=0&ds=6&ft=4KJMyMzm8Zmo04jap-4jVcDidpWrKsd.&mime_type=video_mp4&qs=0&rc=Ozw2Nmk6NDtmNTk0ZjwzZEBpM2duNnk5cjln
         cTMzZjczM0BeMjJfXzMxXzMxYTUwMzQtYSM0MDFqMmRramRgLS1kMWNzcw%3D%3D&btag=e00090000&expire=1719791120&l=202406301743533B4E4C5F9535AEC20EDA&ply_type=2&policy=2&signat
         ure=e5a42e51c5543e696ed1b6901c3ad10e&tk=tt_chain_token, 错误详情: Client error '403 Forbidden' for url                                                           
         'https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/oMBPA2t4rFDUsENQIlEDf4fOEaNYQslMDPgaBR/?a=1988&bti=ODszNWYuMDE6&ch=0&cr
         =3&dr=0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=3816&bt=1908&cs=0&ds=6&ft=4KJMyMzm8Zmo04jap-4jVcDidpWrKsd.&mime_type=video_mp4&qs=0&rc=Ozw2Nmk6NDtmNTk0ZjwzZEBpM2duNnk5cjl
         ncTMzZjczM0BeMjJfXzMxXzMxYTUwMzQtYSM0MDFqMmRramRgLS1kMWNzcw%3D%3D&btag=e00090000&expire=1719791120&l=202406301743533B4E4C5F9535AEC20EDA&ply_type=2&policy=2&signa
         ture=e5a42e51c5543e696ed1b6901c3ad10e&tk=tt_chain_token'                                                                                                         
         For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403                                                                         
WARNING  link                                                                                                                                                             
         https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-pve-0037-aiso/oArPIfeNQMPg6UYWDQnAEUVNVNkQjB9CQbD2bU/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=3&dr
         =0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=3004&bt=1502&cs=0&ds=6&ft=4KJMyMzm8Zmo04jap-4jVcDidpWrKsd.&mime_type=video_mp4&qs=0&rc=aWgzaTo3NGZpODo1NjkzNEBpamRmPDk6Zjt1azMz
         ZjgzM0BgLmIyMDAyXjAxYWMvMi8yYSNjY2dncjQwXl5gLS1kL2Nzcw%3D%3D&btag=e00090000&expire=1719791121&l=202406301743533B4E4C5F9535AEC20EDA&ply_type=2&policy=2&signature=
         37fc6cf6244a8321e15bb61af66f99f1&tk=tt_chain_token content length 0, try next link if available                                                                  
WARNING  所有链接都无法下载                                                                                                                                               
WARNING  link                                                                                                                                                             
         https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/oMBPA2t4rFDUsENQIlEDf4fOEaNYQslMDPgaBR/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=
         3&dr=0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=3816&bt=1908&cs=0&ds=6&ft=4KJMyMzm8Zmo04jap-4jVcDidpWrKsd.&mime_type=video_mp4&qs=0&rc=Ozw2Nmk6NDtmNTk0ZjwzZEBpM2duNnk5cjln
         cTMzZjczM0BeMjJfXzMxXzMxYTUwMzQtYSM0MDFqMmRramRgLS1kMWNzcw%3D%3D&btag=e00090000&expire=1719791120&l=202406301743533B4E4C5F9535AEC20EDA&ply_type=2&policy=2&signat
         ure=e5a42e51c5543e696ed1b6901c3ad10e&tk=tt_chain_token content length 0, try next link if available                                                              
WARNING  所有链接都无法下载                                                                                                                                               
ERROR    Traceback (most recent call last):                                                                                                                               
           File "/Users/user/.pyenv/versions/3.10.10/lib/python3.10/site-packages/f2/utils/_dl.py", line 42, in get_content_length                           
             response.raise_for_status()                                                                                                                                  
           File "/Users/user/.pyenv/versions/3.10.10/lib/python3.10/site-packages/httpx/_models.py", line 761, in raise_for_status                           
             raise HTTPStatusError(message, request=request, response=self)                                                                                               
         httpx.HTTPStatusError: Client error '403 Forbidden' for url                                                                                                      
         'https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068-euttp/owIGiqKQos0IAIbAzDEiMSijCyhBnMfmAWQXBd/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=3&d
         r=0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=2820&bt=1410&cs=0&ds=6&ft=4KJMyMzm8Zmo04jap-4jVcDidpWrKsd.&mime_type=video_mp4&qs=0&rc=aDw8N2llNmVpNGk0Zzw3ZUBpanBpNm45cjdzdDM
         zZjczM0AvLTAuNGEwXzUxYy4yYi4tYSNfMTBpMmRjYC1gLS1kMWNzcw%3D%3D&btag=e00088000&expire=1719791053&l=202406301743533B4E4C5F9535AEC20EDA&ply_type=2&policy=2&signature
         =adad4017f2206a2fd7b3a41a5c9138c8&tk=tt_chain_token'                                                                                                             
         For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403                                                                         
                                                                                                                                                                          
         During handling of the above exception, another exception occurred:                                                                                              
                                                                                                                                                                          
         Traceback (most recent call last):                                                                                                                               
           File "/Users/user/.pyenv/versions/3.10.10/lib/python3.10/site-packages/f2/utils/_dl.py", line 73, in get_content_length                           
             response.raise_for_status()                                                                                                                                  
           File "/Users/user/.pyenv/versions/3.10.10/lib/python3.10/site-packages/httpx/_models.py", line 761, in raise_for_status                           
             raise HTTPStatusError(message, request=request, response=self)                                                                                               
         httpx.HTTPStatusError: Client error '403 Forbidden' for url                                                                                                      
         'https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068-euttp/owIGiqKQos0IAIbAzDEiMSijCyhBnMfmAWQXBd/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=3&d
         r=0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=2820&bt=1410&cs=0&ds=6&ft=4KJMyMzm8Zmo04jap-4jVcDidpWrKsd.&mime_type=video_mp4&qs=0&rc=aDw8N2llNmVpNGk0Zzw3ZUBpanBpNm45cjdzdDM
         zZjczM0AvLTAuNGEwXzUxYy4yYi4tYSNfMTBpMmRjYC1gLS1kMWNzcw%3D%3D&btag=e00088000&expire=1719791053&l=202406301743533B4E4C5F9535AEC20EDA&ply_type=2&policy=2&signature
         =adad4017f2206a2fd7b3a41a5c9138c8&tk=tt_chain_token'                                                                                                             
         For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403                                                                         
                                                                                                                                                                          
ERROR    HTTP状态错误, 尝试GET请求失败:                                                                                                                                   
         https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068-euttp/owIGiqKQos0IAIbAzDEiMSijCyhBnMfmAWQXBd/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=3&dr
         =0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=2820&bt=1410&cs=0&ds=6&ft=4KJMyMzm8Zmo04jap-4jVcDidpWrKsd.&mime_type=video_mp4&qs=0&rc=aDw8N2llNmVpNGk0Zzw3ZUBpanBpNm45cjdzdDMz
         ZjczM0AvLTAuNGEwXzUxYy4yYi4tYSNfMTBpMmRjYC1gLS1kMWNzcw%3D%3D&btag=e00088000&expire=1719791053&l=202406301743533B4E4C5F9535AEC20EDA&ply_type=2&policy=2&signature=
         adad4017f2206a2fd7b3a41a5c9138c8&tk=tt_chain_token, 错误详情: Client error '403 Forbidden' for url                                                               
         'https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068-euttp/owIGiqKQos0IAIbAzDEiMSijCyhBnMfmAWQXBd/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=3&d
         r=0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=2820&bt=1410&cs=0&ds=6&ft=4KJMyMzm8Zmo04jap-4jVcDidpWrKsd.&mime_type=video_mp4&qs=0&rc=aDw8N2llNmVpNGk0Zzw3ZUBpanBpNm45cjdzdDM
         zZjczM0AvLTAuNGEwXzUxYy4yYi4tYSNfMTBpMmRjYC1gLS1kMWNzcw%3D%3D&btag=e00088000&expire=1719791053&l=202406301743533B4E4C5F9535AEC20EDA&ply_type=2&policy=2&signature
         =adad4017f2206a2fd7b3a41a5c9138c8&tk=tt_chain_token'                                                                                                             
         For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403   

Here is my config!:

tiktok:
  User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML,
    like Gecko) Chrome/125.0.0.0 Safari/537.36
  cookie: tt_csrf_token=CrMfLmKd-eKF790-9TrPVNqakmiHeyH1D6mM; s_v_web_id=verify_lpinhozj_JRmYFMed_SJdW_4SgJ_96gy_hh9Hcu9Vwh11;
    ttwid=1%7CVHrH5Mr2patcBf6Et_ELdIH_XysKWoAofxNgVkbJTzA%7C1702562457%7Ceda860c7cf77c4f2c0f7a19622a7536869842169b01c2c102bebeac79c4e7eed;
    tt_chain_token=hGI7PTvqbuhUrrTwdD7UaQ==; odin_tt=045576381bb781536e2f0525a74f496639b0ea0d1e8d60eb0986081f2cc20e4b712e65eceab57484583efcefd47a65f69d8361ffc1eabca63ebbb1d317deed8b;
    uid_tt=4650829e4267f785cda446fec18c130ba3411b1c735bc884d856ab32a2c400b5; uid_tt_ss=4650829e4267f785cda446fec18c130ba3411b1c735bc884d856ab32a2c400b5;
    sid_tt=e612677b1ea3bd71807eb3daa4a9ae89; sessionid=e612677b1ea3bd71807eb3daa4a9ae89;
    sessionid_ss=e612677b1ea3bd71807eb3daa4a9ae89; store-idc=useast5; store-country-code=us;
    store-country-code-src=uid; tt-target-idc=useast5; tt-target-idc-sign=VvkiqQJVv_NXir36KSpN9EMfMW-6DnwnZNQVjhVGoTfzc3NySnBiJwZuwS-pwV1_xjPAsKAnBBa9ikg6t_Zt47ICRz07x7PiMEYa1d-7p7_aAoWMoztOpoE2wJHdOsJZIjuln3JPcKToqMHieiuHy35eG3DN83gLJ3VnInZ5nZa4MNyycVwj-XFgiZn8y8EdcPXv2_SjewqiX4XfvdJII0HhXmo8u4G4CWGaYpyDb4tnxMq2XD78Nylz84CvCYoI5YSYMfS1vb2YeYctMY9nudwJ3zdZN0KEdFE0aSVlc-FK5qMwf3CKRG_fD5dxjgNfueGFlfI9GpTGJAyGCnzOqhz9XTH2DsmpE0_zyaLRIeEPYBazAI8n8qPRnhaO2kc2YFbrVquj-Rxz01C3gLnNN8XzkzNJEFyh1R_9TcVeYxnlvBHh9hi1OY-QkQ9aqu9CFf-igPw6H_PQ2SIdW39i80VbG2z2QdovnXkNCi77a_-XI3ZSR_9dx2HURFlGTtX8;
    sid_guard=e612677b1ea3bd71807eb3daa4a9ae89%7C1711455755%7C15551985%7CSun%2C+22-Sep-2024+12%3A22%3A20+GMT;
    sid_ucp_v1=1.0.0-KGExMTU4NmI1NDlkYTYyN2Y3MDhkZmUwYmQ2MmIyYzcyZTYwOTYwMjIKGAiriJac-Y_kw2UQi_yKsAYYsws4AUDrBxAEGgd1c2Vhc3Q1IiBlNjEyNjc3YjFlYTNiZDcxODA3ZWIzZGFhNGE5YWU4OQ;
    ssid_ucp_v1=1.0.0-KGExMTU4NmI1NDlkYTYyN2Y3MDhkZmUwYmQ2MmIyYzcyZTYwOTYwMjIKGAiriJac-Y_kw2UQi_yKsAYYsws4AUDrBxAEGgd1c2Vhc3Q1IiBlNjEyNjc3YjFlYTNiZDcxODA3ZWIzZGFhNGE5YWU4OQ;
    tiktok_webapp_theme=light; passport_fe_beating_status=true; csrf_session_id=0fe7bbbb85c9e6a0e8ec8b7a0aae55f2;
    tea_sid=4ad2ceb2-109c-4a2b-a876-18a8d4908b5e; last_login_method=email; msToken=L4ewPx28JPUaoDr6cApcBI76s4x_UDCzduSiHMaWUpVKIEkXhONE6qzHpK88ECXcKNABvskwQC1FnMLlSXG67L8_M-vxTyrAH6q8d52cEWa3dnak8hiGlL1cVVYf1pC_Hdk-uLYOV_FuDUoOnz4=
  cover: true
  dataType: 8
  desc: true
  folderize: false
  headers:
    Referer: https://www.tiktok.com/
    User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36
      (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
  interval: all
  language: en_US
  magic: 538969122
  max_connections: 5
  max_counts: 0
  max_retries: 20
  max_tasks: 5
  mode: post
  msToken:
    User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36
      (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
    dataType: 8
    magic: 538969122
    strData: L4ewPx28JPUaoDr6cApcBI76s4x_UDCzduSiHMaWUpVKIEkXhONE6qzHpK88ECXcKNABvskwQC1FnMLlSXG67L8_M-vxTyrAH6q8d52cEWa3dnak8hiGlL1cVVYf1pC_Hdk-uLYOV_FuDUoOnz4=
    url: https://mssdk.bytedance.com/web/report
    version: 1
  music: false
  naming: '{create}_{desc}'
  odin_tt:
    url: https://www.tiktok.com/passport/web/account/info/?aid=1459&app_language=zh-Hans&app_name=tiktok_web&browser_language=zh-CN&browser_name=Mozilla&browser_online=true&browser_platform=Win32&browser_version=5.0%20%28Windows%20NT%2010.0%3B%20Win64%3B%20x64%29%20AppleWebKit%2F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F119.0.0.0%20Safari%2F537.36&channel=tiktok_web&cookie_enabled=true&device_id=7306060721837852167&root_referer=https%3A%2F%2Fwww.tiktok.com
  page_counts: 20
  path: /Users/user/Desktop/F2/test1
  proxies:
    http: null
    https: null
  strData: 3BvqYbNXLLOcZehvxZVbjpAu7vq82RoWmFSJHLFwzDwJIZevE0AeilQfP55LridxmdGGjknoksqIsLqlMHMif0IFK/Br7JWqxOHnYuMwVCnttFc0Y4MFvdVWM5FECiEulJC0Dc+eeVsNSrFnAc9K7fazqdglyJgGLSfXIJmgyCvvQ4pg0u5HBVVugLSWs242X42fjoWymaUCLZJQo6vi6WLyuV7l5IC3Mg+lelr5xBQD6Q7hBIFEw8zzxJ1n2DyA4xLbOHTQdKvEtsK7XzyWwjpRnojPTbBl69Zosnuru+lOBIl+tFu/+hCQ1m0jYZwTP4rVE75L3Du6+KZ5v/9TyFYjq7y3y9bGLP4d7yQueJbF90G1yrZ6htElrZ2vqZKDrIqBVbmOZr/nph12k2JKrITtN0R/pMsp0sJ4gesQnXxcD/pLOFAINHk7umgbe6LzJ7+TLUdGuO4M7xiEg/jCqhjgJX1izZ4NPoBDp35zRxj6Y6OrcstlTN/cv5sz663+Nco/mEwhGq2VwrL4gAIAPycndIsb48dPdtngmLqNDNN0ZyVRjgqVIDXXrxigXCkR9CH89Dlrrb7QQqWVgRXz9/k5ihEM43BR3sd3mMU/XgFLN1Aoxf6GzzdxP2QPBI75/ZoHoAmu54v8gTmA3ntCGlEF0zgaFGTdpkGdb+oZgyQM4pw1aAyxmFINXkpD3IKKoGev9kD9gTFnhiQMGCMemhZS7ZYdbuGu0Cb+lQKaL/QTt80FMyGmW8kzVy9xW/ja9BcdEJYRoaufuFRkBFG5ay8x4WHLR6hEapXqQial/cREbLL4sQytpjtmnndFqvT7xN5DhgsLY2Z7451MJhD6NJXKNrMafGZSbItzQWY=
  timeout: 10
  ttwid:
    cookie: 1%7CVHrH5Mr2patcBf6Et_ELdIH_XysKWoAofxNgVkbJTzA%7C1702562457%7Ceda860c7cf77c4f2c0f7a19622a7536869842169b01c2c102bebeac79c4e7eed
    data: '{"aid":1988,"service":"www.tiktok.com","union":false,"unionHost":"","needFid":false,"fid":"","migrate_priority":0}'
    url: https://www.tiktok.com/ttwid/check/
  url: https://www.tiktok.com/@gordonramsayofficial
  version: 1

Am I missing something with how this yaml is set up? Any insight would be greatly appreciated, thank you so much!

Reference in new

Hi @Vetches thanks for your question, this has been fixed. The correct way to do this is to use the conf.yaml configuration file for 0.0.1.6 and change the device_id parameter in there. The device_id generation code is provided in the code snippet example. You just need to manually replace it in the configuration file with the corresponding cookie:tt_chain_token=xxx;other cookies:xxx;, otherwise it will still not work.

image

Code snippet:
https://johnserf-seed.github.io/f2/guide/apps/tiktok/#%E7%94%9F%E6%88%90deviceid-%F0%9F%9F%A2

@Vetches
Copy link

Vetches commented Jul 1, 2024

Hi @Johnserf-Seed! Thank you so much for the prompt and insightful reply, I really appreciate it! Unfortunately, I still can't get it to work despite my best efforts. I decided to switch to python version 3.11.1 as a "reset" of sorts, but that didn't solve it. Regardless, here are the steps I took to try using the device_id method you mentioned!

  1. Retrieved cookies from browser with f2 tk -l en_US --auto-cookie chrome:
f2 tk -l en_US --auto-cookie chrome
WARNING  您当前使用的版本 0.0.1.6 可能已过时,请考虑及时升级到最新版本 0.0.1.6,请使用 pip install -U f2 更新                                                             
INFO     应用:tiktok                                                                                                                                                     
Should I update the configuration file using parameters from the command line?`/Users/user/.pyenv/versions/3.11.1/lib/python3.11.1/site-packages/f2/conf/app.yaml` [Y/n]: Y
Configuration files have been updated!

From there, this is now my app.yaml:

douyin:
  cookie: null
  lyric: true
  max_connections: 5
  max_counts: 0
  max_retries: 5
  max_tasks: 10
  naming: '{create}_{desc}'
  page_counts: 20
  path: Download
  timeout: 10
tiktok:
  cookie: tt_csrf_token=CrMfLmKd-eKF790-9TrPVNqakmiHeyH1D6mM; xxxx=xxxx
  max_connections: 5
  max_counts: 0
  max_retries: 5
  max_tasks: 5
  naming: '{create}_{desc}'
  page_counts: 5
  path: Download
  timeout: 10
twitter:
  cookie: null
  folderize: true
  interval: all
  max_connections: 5
  max_counts: 0
  max_retries: 5
  max_tasks: 5
  mode: one
  naming: '{create}_{desc}'
  page_counts: 20
  path: Download
  timeout: 10
weibo:
  cookie: null
  folderize: true
  interval: all
  max_connections: 5
  max_counts: 0
  max_retries: 5
  max_tasks: 5
  mode: post
  naming: '{create}_{desc}'
  page_counts: 20
  path: Download
  timeout: 10
  1. Ran the code snipped you linked above (it presumably uses the python package, so I'm not sure if the package checks specific directories for reading certain values):
python3 get_tiktok_device_id.py 
{'deviceId': '7386629644626396715', 'cookie': 'tt_chain_token=phQ5EQ4dWXv0urcIzTI7tQ==;bm_sv=6BC92BB0E1BF9C0206404BDDFBFA2935~YAAQ6rUuF9hDoWyQAQAAKVoUbhgn9CDc+m1JDgwnPAdn8uBN6PKf5O/ex+r85iQCTv9xB7lqCT2S3L5F0zgXyfaZDRaPmMu9ejIxwfvbsFkKFehUV5uFg0fbSa5U5J85x1RcNXiQf2KVq5b+J4OzSDeAnThglZ8inIwNCNlYs9yKqHfk9I6ObeHgBaz23NTmoArvi5cnqyZ4NFrUktP/efxXd4JKidlRzKJDkmW7h9X7ZUjJzClS5IZn7Cc0vcGo~1'}
{'deviceId': '7386629648954656302', 'cookie': 'ttwid=1%7CkihMguEU_lSgZdOWraX8pG2nw5HszGxcMXPC4mJ5AD4%7C1719833746%7C954fb2c405920eeb9da0a3f7489d755866997da779f30edc13013760084d1f59;tt_csrf_token=WKEz1RU7-4Agnrre_4X5kuVkMGoYl7b5EjOU;tt_chain_token=YnIDXsyatdy28ri0Wr/35A==;ak_bmsc=F80C0F1755BA5F480F549DF92D18A9D6~000000000000000000000000000000~YAAQ6rUuF9xDoWyQAQAA+lsUbhgj5OgTRimP3Ba0CLfRIklIKS70/nyM3wn1oRyomd/B9lT1rmQV10k2NFIsxb7jIyGJxXaWATtxyzA96K0WfmFPTxTbMeMwzIUIDri4jE5JzdQ3sG6Cw3NG74pqiowRkOl85AVuQtQPXUF8ewuCUvoUHBltlzy8djntTiNml5lwmfdyusML10J170A7i7vw1h6905wJWcXyrOg+LPSllaIq8sYZaR0wqP7mzz/BRPRmTjIeiuBpdZkAUgB1rIvPsNplZVuYYAV6h1Q8GOkM8jM6tYbk9awmdzMktmk5+v9ExGSnQwAaUfEsgKTlCoC4fapT0WrPsohrVJ/u24ZRlKHOnXIZGLgVu96Q'}
  1. Copied the device ID and the cookie output from above into the conf.yaml file, located in /Users/user/.pyenv/versions/3.11.1/lib/python3.11.1/site-packages/f2/conf/:

(Note: The cookie is URL encoded (as evident by the presence of % -- is that an issue? Should it be decoded? I've tried both, but figure best to ask to confirm!)

conf.yaml:

f2:
  version: "0.0.1.6"

  douyin:
    encryption: ab

    BaseRequestModel:
      version:
        code: "190500"
        name: "19.5.0"
      browser:
        language: zh-CN
        platform: Win32
        name: Edge
        version: "122.0.0.0"
      engine:
        name: Blink
        version: "122.0.0.0"
      os:
        name: Windows
        version: "10"

    BaseLiveModel:
      language: zh-CN
      browser:
        language: zh-CN
        platform: Win32
        name: Edge
        version: "119.0.0.0"

    headers:
      User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0
      Referer: https://www.douyin.com/

    proxies:
      http://:
      https://:

    msToken:
      url: https://mssdk.bytedance.com/web/report
      magic: 538969122
      version: 1
      dataType: 8
      strData: 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

    ttwid:
      url: https://ttwid.bytedance.com/ttwid/union/register/
      data: '{"region":"cn","aid":1768,"needFid":false,"service":"www.ixigua.com","migrate_info":{"ticket":"","source":"node"},"cbUrlProtocol":"https","union":true}'

    webid:
      url: https://mcs.zijieapi.com/webid?aid=6383&sdk_version=5.1.18_zip&device_platform=web
      body:
        app_id: 6383
        referer: https://www.douyin.com/
        url: https://www.douyin.com/
        user_agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0
        user_unique_id: ""

  tiktok:

    BaseRequestModel:
      browser:
        language: zh-CN
        name: Mozilla
        platform: Win32
        version: 5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36

      device:
        id: "7386633786827818539"
        platform: web_pc

      os: windows
      region: SG
      priority_region: ""
      webcast_language: zh-Hans
      tz_name: Asia/Hong_Kong

    headers:
      User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
      Referer: https://www.tiktok.com/

    proxies:
      http://:
      https://:

    msToken:
      url: https://mssdk-sg.tiktok.com/web/common?msToken=QnC7zMMh1cpaDTxHDHnabNOrqaWv49JwA1IAq3AIFvrdaqQi8Rs_YlXSya1vN-4b6C1MgpWpS2cL1oakaUEDe3pUDMLpCbdSc3b3V98Fux0AuwXn_9Ns3FyMTnFRmSOOOVeGg6bVXMSGoMG6dq3k
      url2: https://mssdk-sg.tiktok.com/web/report?msToken=QnC7zMMh1cpaDTxHDHnabNOrqaWv49JwA1IAq3AIFvrdaqQi8Rs_YlXSya1vN-4b6C1MgpWpS2cL1oakaUEDe3pUDMLpCbdSc3b3V98Fux0AuwXn_9Ns3FyMTnFRmSOOOVeGg6bVXMSGoMG6dq3k
      magic: 538969122
      version: 1
      dataType: 8
      strData: 3g+ZrAO5JQgfqCRzb689RAbiueodAexjAjn2plyPVBdOArbRM66UOTnZPoVTDDw8GZ8TL/CO13bWedlvWSA8kCODHA6mjO1Af5hgak+1NHbb8EvfuahWFDL8x8hruWn4t6qb79DhOy64REx1nsO6ub4SX4cKdgs+ZXTjUItB2WKddXo7CKikuywT8SJ0TcwZ+z/9hSsawqJXawopS5H8bOF0o3qPn+CwkoWkXBUu4iwkI5UzL9/k18Gwq1BxAiCbyl2kCHJaox7md1H+KfQ0lU9fBhfVBuXa3jNkT5GfyASaBNeJXdhHwuPfEGI6a+4FOaO0MEGzOWDzhu6joo89ooEPo1XV+UJE2KLC5tStxSBibUvn+wZSfGmcpPfYl0jB0H2vLqyaveYraOx8WRE/G/Y9DkbBLJvz7E8sDZ/v1fCUVs1JDDewE/yn2aqOHr3NxUjOnylKl5WWSCPeSR4ZTXRR1ZJhvpGKP7XYc3tkOjBSQ70cXnl53dAQ6aouUVMcztSlkXh4goI46tgJDjTiJJILHBr03dM/1KwVzqoEEO8f7JBhfQo4OR6Y48PXomshJmZhDiEmtkqLndpZY2I/B8q0EShuPlDCFRW7iob6kFahyqDfpOmK15kzCX2n7eu7zqDGgpJuHEtULF9803lR5QBt104ET49RbnDJ+ipbz1bFvS2FJQ2rfktNlwjqdBT8UzfFPHyZk6z4cSxYIfPRj1lB8fDwTwv3PUSRxUZSwkuGoZbc6j/6hxwZaY0xxIEbb9DlOmQZY4qyiqSziZ8HGWsQ9uD95dO4lX6GlZaeh7mKsjLSKSdUt13YeGAciqjTvSPyO/pZ5xc3+i+5hY4A290/JiTmIyFBOrRrlmIhPEQe9OEJn0DPXYgliYUO1nljEi6q/4HMFdXFmlw6nC8/kL9EeinisX7g6PbdHuRcKONXZpXxBevL8xD5Z8SvFKH/uQmYHrJlybiKHjDIMq7vc59NBw2VDQBmRqa8NTh2XLwIryjoBIHuNSBngSZwJE==

    ttwid:
      url: https://www.tiktok.com/ttwid/check/
      data: '{"aid":1988,"service":"www.tiktok.com","union":false,"unionHost":"","needFid":false,"fid":"","migrate_priority":0}'
      cookie: ttwid=1%7C3uOVjidbOFBmdS6Aci5oeBb8Ta-HWpeyp2dvhl2Ib2E%7C1716637053%7C462867ee452aecd60a854225b854ff4498e9b99c13d4826a3e2a4e58a4c55134;

    odin_tt:
      url: https://www.tiktok.com/passport/web/account/info/?WebIdLastTime=1716637053&aid=1459&app_language=zh-Hans&app_name=tiktok_web&browser_language=zh-CN&browser_name=Mozilla&browser_online=true&browser_platform=Win32&browser_version=5.0%20%28Windows%20NT%2010.0%3B%20Win64%3B%20x64%29%20AppleWebKit%2F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F124.0.0.0%20Safari%2F537.36&channel=tiktok_web&cookie_enabled=true&device_id=7372899909097571857&device_platform=web_pc&focus_state=true&from_page=fyp&history_len=2&is_fullscreen=false&is_page_visible=true&odinId=7372898697492972561&os=windows&priority_region=&referer=&region=SG&screen_height=1080&screen_width=1920&tz_name=Asia%2FHong_Kong&webcast_language=zh-Hans

  twitter:
    headers:
      User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0
      Referer: https://twitter.com/
      Authorization: Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA
      X-Csrf-Token: ""

    proxies:
      http://:
      https://:

  weibo:
    headers:
      User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0
      Referer: https://weibo.com/

    proxies:
      http://:
      https://:

    visitor:
      url: https://passport.weibo.com/visitor/genvisitor2
      cb: visitor_gray_callback
      tid:
      from: weibo
  1. Ran f2 tk -l en_US -c tiktok.yaml, where tiktok.yaml is the following:
tiktok:
  odin_tt:
    url: https://www.tiktok.com/passport/web/account/info/?WebIdLastTime=1716637053&aid=1459&app_language=zh-Hans&app_name=tiktok_web&browser_language=zh-CN&browser_name=Mozilla&browser_online=true&browser_platform=Win32&browser_version=5.0%20%28Windows%20NT%2010.0%3B%20Win64%3B%20x64%29%20AppleWebKit%2F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F124.0.0.0%20Safari%2F537.36&channel=tiktok_web&cookie_enabled=true&device_id=7372899909097571857&device_platform=web_pc&focus_state=true&from_page=fyp&history_len=2&is_fullscreen=false&is_page_visible=true&odinId=7372898697492972561&os=windows&priority_region=&referer=&region=SG&screen_height=1080&screen_width=1920&tz_name=Asia%2FHong_Kong&webcast_language=zh-Hans
  User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML,
    like Gecko) Chrome/125.0.0.0 Safari/537.36
  cookie: tt_csrf_token=CrMfLmKd-eKF790-9TrPVNqakmiHeyH1D6mM; xxxx=xxxx;
  cover: true
  dataType: 8
  desc: true
  folderize: false
  headers:
    Referer: https://www.tiktok.com/
    User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36
      (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
  interval: all
  language: en_US
  magic: 538969122
  max_connections: 5
  max_counts: 0
  max_retries: 20
  max_tasks: 5
  mode: post
  msToken:
    User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36
      (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
    dataType: 8
    magic: 538969122
    strData: L4ewPx28JPUaoDr6cApcBI76s4x_UDCzduSiHMaWUpVKIEkXhONE6qzHpK88ECXcKNABvskwQC1FnMLlSXG67L8_M-vxTyrAH6q8d52cEWa3dnak8hiGlL1cVVYf1pC_Hdk-uLYOV_FuDUoOnz4=
    url: https://mssdk.bytedance.com/web/report
    version: 1
  music: false
  naming: '{create}_{desc}'
  odin_tt:
    url: https://www.tiktok.com/passport/web/account/info/?aid=1459&app_language=zh-Hans&app_name=tiktok_web&browser_language=zh-CN&browser_name=Mozilla&browser_online=true&browser_platform=Win32&browser_version=5.0%20%28Windows%20NT%2010.0%3B%20Win64%3B%20x64%29%20AppleWebKit%2F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F119.0.0.0%20Safari%2F537.36&channel=tiktok_web&cookie_enabled=true&device_id=7306060721837852167&root_referer=https%3A%2F%2Fwww.tiktok.com
  page_counts: 20
  path: /Users/user/Desktop/F2/test1
  proxies:
    http: null
    https: null
  strData: 3BvqYbNXLLOcZehvxZVbjpAu7vq82RoWmFSJHLFwzDwJIZevE0AeilQfP55LridxmdGGjknoksqIsLqlMHMif0IFK/Br7JWqxOHnYuMwVCnttFc0Y4MFvdVWM5FECiEulJC0Dc+eeVsNSrFnAc9K7fazqdglyJgGLSfXIJmgyCvvQ4pg0u5HBVVugLSWs242X42fjoWymaUCLZJQo6vi6WLyuV7l5IC3Mg+lelr5xBQD6Q7hBIFEw8zzxJ1n2DyA4xLbOHTQdKvEtsK7XzyWwjpRnojPTbBl69Zosnuru+lOBIl+tFu/+hCQ1m0jYZwTP4rVE75L3Du6+KZ5v/9TyFYjq7y3y9bGLP4d7yQueJbF90G1yrZ6htElrZ2vqZKDrIqBVbmOZr/nph12k2JKrITtN0R/pMsp0sJ4gesQnXxcD/pLOFAINHk7umgbe6LzJ7+TLUdGuO4M7xiEg/jCqhjgJX1izZ4NPoBDp35zRxj6Y6OrcstlTN/cv5sz663+Nco/mEwhGq2VwrL4gAIAPycndIsb48dPdtngmLqNDNN0ZyVRjgqVIDXXrxigXCkR9CH89Dlrrb7QQqWVgRXz9/k5ihEM43BR3sd3mMU/XgFLN1Aoxf6GzzdxP2QPBI75/ZoHoAmu54v8gTmA3ntCGlEF0zgaFGTdpkGdb+oZgyQM4pw1aAyxmFINXkpD3IKKoGev9kD9gTFnhiQMGCMemhZS7ZYdbuGu0Cb+lQKaL/QTt80FMyGmW8kzVy9xW/ja9BcdEJYRoaufuFRkBFG5ay8x4WHLR6hEapXqQial/cREbLL4sQytpjtmnndFqvT7xN5DhgsLY2Z7451MJhD6NJXKNrMafGZSbItzQWY=
  timeout: 10
  ttwid:
    cookie: 1%7CVHrH5Mr2patcBf6Et_ELdIH_XysKWoAofxNgVkbJTzA%7C1702562457%7Ceda860c7cf77c4f2c0f7a19622a7536869842169b01c2c102bebeac79c4e7eed
    data: '{"aid":1988,"service":"www.tiktok.com","union":false,"unionHost":"","needFid":false,"fid":"","migrate_priority":0}'
    url: https://www.tiktok.com/ttwid/check/
  url: https://www.tiktok.com/@gordonramsayofficial
  version: 1

Which shows the same output as before:

f2 tk -l en_US -c tiktok.yaml 
WARNING  您当前使用的版本 0.0.1.6 可能已过时,请考虑及时升级到最新版本 0.0.1.6,请使用 pip install -U f2 更新                                                             
INFO     应用:tiktok                                                                                                                                                     
INFO     Mode: post                                                                                                                                                       
INFO     Main configuration path: /Users/user/.pyenv/versions/3.11.1/lib/python3.11.1/site-packages/f2/conf/app.yaml                                          
INFO     Custom configuration path: /Users/user/Desktop/SAUCE/AUTOMATED TIKTOK DOWNLOADING/tiktok.yaml                                                       
ERROR    Traceback (most recent call last):                                                                                                                               
           File "/Users/user/.pyenv/versions/3.11.1/lib/python3.11.1/site-packages/f2/utils/_dl.py", line 42, in get_content_length                           
             response.raise_for_status()                                                                                                                                  
           File "/Users/user/.pyenv/versions/3.11.1/lib/python3.11.1/site-packages/httpx/_models.py", line 761, in raise_for_status                           
             raise HTTPStatusError(message, request=request, response=self)                                                                                               
         httpx.HTTPStatusError: Client error '403 Forbidden' for url                                                                                                      
         'https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/oMBPA2t4rFDUsENQIlEDf4fOEaNYQslMDPgaBR/?a=1988&bti=ODszNWYuMDE6&ch=0&cr
         =3&dr=0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=3816&bt=1908&cs=0&ds=6&ft=4KJMyMzm8Zmo0Rkwp-4jV70idpWrKsd.&mime_type=video_mp4&qs=0&rc=Ozw2Nmk6NDtmNTk0ZjwzZEBpM2duNnk5cjl
         ncTMzZjczM0BeMjJfXzMxXzMxYTUwMzQtYSM0MDFqMmRramRgLS1kMWNzcw%3D%3D&btag=e00090000&expire=1719855890&l=202407011143233D101C871936D5001C65&ply_type=2&policy=2&signa
         ture=6c41d7fbe0d4a0658731fb876d018ee8&tk=tt_chain_token'                                                                                                         
         For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403                                                                         
                                                                                                                                                                          
         During handling of the above exception, another exception occurred:                                                                                              
                                                                                                                                                                          
         Traceback (most recent call last):                                                                                                                               
           File "/Users/user/.pyenv/versions/3.11.1/lib/python3.11.1/site-packages/f2/utils/_dl.py", line 73, in get_content_length                           
             response.raise_for_status()                                                                                                                                  
           File "/Users/user/.pyenv/versions/3.11.1/lib/python3.11.1/site-packages/httpx/_models.py", line 761, in raise_for_status                           
             raise HTTPStatusError(message, request=request, response=self)                                                                                               
         httpx.HTTPStatusError: Client error '403 Forbidden' for url                                                                                                      
         'https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/oMBPA2t4rFDUsENQIlEDf4fOEaNYQslMDPgaBR/?a=1988&bti=ODszNWYuMDE6&ch=0&cr
         =3&dr=0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=3816&bt=1908&cs=0&ds=6&ft=4KJMyMzm8Zmo0Rkwp-4jV70idpWrKsd.&mime_type=video_mp4&qs=0&rc=Ozw2Nmk6NDtmNTk0ZjwzZEBpM2duNnk5cjl
         ncTMzZjczM0BeMjJfXzMxXzMxYTUwMzQtYSM0MDFqMmRramRgLS1kMWNzcw%3D%3D&btag=e00090000&expire=1719855890&l=202407011143233D101C871936D5001C65&ply_type=2&policy=2&signa
         ture=6c41d7fbe0d4a0658731fb876d018ee8&tk=tt_chain_token'                                                                                                         
         For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403                                                                         
                                                                                                                                                                          
ERROR    HTTP状态错误, 尝试GET请求失败:                                                                                                                                   
         https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/oMBPA2t4rFDUsENQIlEDf4fOEaNYQslMDPgaBR/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=
         3&dr=0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=3816&bt=1908&cs=0&ds=6&ft=4KJMyMzm8Zmo0Rkwp-4jV70idpWrKsd.&mime_type=video_mp4&qs=0&rc=Ozw2Nmk6NDtmNTk0ZjwzZEBpM2duNnk5cjln
         cTMzZjczM0BeMjJfXzMxXzMxYTUwMzQtYSM0MDFqMmRramRgLS1kMWNzcw%3D%3D&btag=e00090000&expire=1719855890&l=202407011143233D101C871936D5001C65&ply_type=2&policy=2&signat
         ure=6c41d7fbe0d4a0658731fb876d018ee8&tk=tt_chain_token, 错误详情: Client error '403 Forbidden' for url                                                           
         'https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/oMBPA2t4rFDUsENQIlEDf4fOEaNYQslMDPgaBR/?a=1988&bti=ODszNWYuMDE6&ch=0&cr
         =3&dr=0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=3816&bt=1908&cs=0&ds=6&ft=4KJMyMzm8Zmo0Rkwp-4jV70idpWrKsd.&mime_type=video_mp4&qs=0&rc=Ozw2Nmk6NDtmNTk0ZjwzZEBpM2duNnk5cjl
         ncTMzZjczM0BeMjJfXzMxXzMxYTUwMzQtYSM0MDFqMmRramRgLS1kMWNzcw%3D%3D&btag=e00090000&expire=1719855890&l=202407011143233D101C871936D5001C65&ply_type=2&policy=2&signa
         ture=6c41d7fbe0d4a0658731fb876d018ee8&tk=tt_chain_token'                                                                                                         
         For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403                                                                         
ERROR    Traceback (most recent call last):                                                                                                                               
           File "/Users/user/.pyenv/versions/3.11.1/lib/python3.11.1/site-packages/f2/utils/_dl.py", line 42, in get_content_length                           
             response.raise_for_status()                                                                                                                                  
           File "/Users/user/.pyenv/versions/3.11.1/lib/python3.11.1/site-packages/httpx/_models.py", line 761, in raise_for_status                           
             raise HTTPStatusError(message, request=request, response=self)                                                                                               
         httpx.HTTPStatusError: Client error '403 Forbidden' for url                                                                                                      
         'https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/oco6jMNGfrxEIevXGAI6m8ofM1IgtFQDdweEGX/?a=1988&bti=ODszNWYuMDE6&ch=0&cr
         =3&dr=0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=1690&bt=845&cs=0&ds=6&ft=4KJMyMzm8Zmo0Rkwp-4jV70idpWrKsd.&mime_type=video_mp4&qs=0&rc=cnF8b2hsc2d3SkBwaHIxaDFybndmODxlaDY8
         NWdmOTpmZjtmOUBpam1lcHg5cjZxczMzZjczM0BjRl5Nc3FePmJKYSNvYF90aHFmOiNhNDYwNDYvXzAxNDYxLi4tYSMuZDQuMmQ0aHJgLS1kMWNzcw%3D%3D&btag=e00088000&expire=1719855811&l=20240
         7011143233D101C871936D5001C65&ply_type=2&policy=2&signature=9c04a9294598d428cfdccf7fffd9f557&tk=tt_chain_token'                                                  
         For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403                                                                         
                                                                                                                                                                          
         During handling of the above exception, another exception occurred:                                                                                              
                                                                                                                                                                          
         Traceback (most recent call last):                                                                                                                               
           File "/Users/user/.pyenv/versions/3.11.1/lib/python3.11.1/site-packages/f2/utils/_dl.py", line 73, in get_content_length                           
             response.raise_for_status()                                                                                                                                  
           File "/Users/user/.pyenv/versions/3.11.1/lib/python3.11.1/site-packages/httpx/_models.py", line 761, in raise_for_status                           
             raise HTTPStatusError(message, request=request, response=self)                                                                                               
         httpx.HTTPStatusError: Client error '403 Forbidden' for url                                                                                                      
         'https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/oco6jMNGfrxEIevXGAI6m8ofM1IgtFQDdweEGX/?a=1988&bti=ODszNWYuMDE6&ch=0&cr
         =3&dr=0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=1690&bt=845&cs=0&ds=6&ft=4KJMyMzm8Zmo0Rkwp-4jV70idpWrKsd.&mime_type=video_mp4&qs=0&rc=cnF8b2hsc2d3SkBwaHIxaDFybndmODxlaDY8
         NWdmOTpmZjtmOUBpam1lcHg5cjZxczMzZjczM0BjRl5Nc3FePmJKYSNvYF90aHFmOiNhNDYwNDYvXzAxNDYxLi4tYSMuZDQuMmQ0aHJgLS1kMWNzcw%3D%3D&btag=e00088000&expire=1719855811&l=20240
         7011143233D101C871936D5001C65&ply_type=2&policy=2&signature=9c04a9294598d428cfdccf7fffd9f557&tk=tt_chain_token'                                                  
         For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403                                                                         
                                                                                                                                                                          
ERROR    HTTP状态错误, 尝试GET请求失败:                                                                                                                                   
         https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/oco6jMNGfrxEIevXGAI6m8ofM1IgtFQDdweEGX/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=
         3&dr=0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=1690&bt=845&cs=0&ds=6&ft=4KJMyMzm8Zmo0Rkwp-4jV70idpWrKsd.&mime_type=video_mp4&qs=0&rc=cnF8b2hsc2d3SkBwaHIxaDFybndmODxlaDY8N
         WdmOTpmZjtmOUBpam1lcHg5cjZxczMzZjczM0BjRl5Nc3FePmJKYSNvYF90aHFmOiNhNDYwNDYvXzAxNDYxLi4tYSMuZDQuMmQ0aHJgLS1kMWNzcw%3D%3D&btag=e00088000&expire=1719855811&l=202407
         011143233D101C871936D5001C65&ply_type=2&policy=2&signature=9c04a9294598d428cfdccf7fffd9f557&tk=tt_chain_token, 错误详情: Client error '403 Forbidden' for url    
         'https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/oco6jMNGfrxEIevXGAI6m8ofM1IgtFQDdweEGX/?a=1988&bti=ODszNWYuMDE6&ch=0&cr
         =3&dr=0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=1690&bt=845&cs=0&ds=6&ft=4KJMyMzm8Zmo0Rkwp-4jV70idpWrKsd.&mime_type=video_mp4&qs=0&rc=cnF8b2hsc2d3SkBwaHIxaDFybndmODxlaDY8
         NWdmOTpmZjtmOUBpam1lcHg5cjZxczMzZjczM0BjRl5Nc3FePmJKYSNvYF90aHFmOiNhNDYwNDYvXzAxNDYxLi4tYSMuZDQuMmQ0aHJgLS1kMWNzcw%3D%3D&btag=e00088000&expire=1719855811&l=20240
         7011143233D101C871936D5001C65&ply_type=2&policy=2&signature=9c04a9294598d428cfdccf7fffd9f557&tk=tt_chain_token'                                                  
         For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403                                                                         
ERROR    Traceback (most recent call last):                                                                                                                               
           File "/Users/user/.pyenv/versions/3.11.1/lib/python3.11.1/site-packages/f2/utils/_dl.py", line 42, in get_content_length                           
             response.raise_for_status()                                                                                                                                  
           File "/Users/user/.pyenv/versions/3.11.1/lib/python3.11.1/site-packages/httpx/_models.py", line 761, in raise_for_status                           
             raise HTTPStatusError(message, request=request, response=self)                                                                                               
         httpx.HTTPStatusError: Client error '403 Forbidden' for url                                                                                                      
         'https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-pve-0037-aiso/oArPIfeNQMPg6UYWDQnAEUVNVNkQjB9CQbD2bU/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=3&d
         r=0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=3004&bt=1502&cs=0&ds=6&ft=4KJMyMzm8Zmo0Rkwp-4jV70idpWrKsd.&mime_type=video_mp4&qs=0&rc=aWgzaTo3NGZpODo1NjkzNEBpamRmPDk6Zjt1azM
         zZjgzM0BgLmIyMDAyXjAxYWMvMi8yYSNjY2dncjQwXl5gLS1kL2Nzcw%3D%3D&btag=e00090000&expire=1719855891&l=202407011143233D101C871936D5001C65&ply_type=2&policy=2&signature
         =340088e9f0f75a30dff4688fb949d427&tk=tt_chain_token'                                                                                                             
         For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403                                                                         
                                                                                                                                                                          
         During handling of the above exception, another exception occurred:                                                                                              
                                                                                                                                                                          
         Traceback (most recent call last):                                                                                                                               
           File "/Users/user/.pyenv/versions/3.11.1/lib/python3.11.1/site-packages/f2/utils/_dl.py", line 73, in get_content_length                           
             response.raise_for_status()                                                                                                                                  
           File "/Users/user/.pyenv/versions/3.11.1/lib/python3.11.1/site-packages/httpx/_models.py", line 761, in raise_for_status                           
             raise HTTPStatusError(message, request=request, response=self)                                                                                               
         httpx.HTTPStatusError: Client error '403 Forbidden' for url                                                                                                      
         'https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-pve-0037-aiso/oArPIfeNQMPg6UYWDQnAEUVNVNkQjB9CQbD2bU/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=3&d
         r=0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=3004&bt=1502&cs=0&ds=6&ft=4KJMyMzm8Zmo0Rkwp-4jV70idpWrKsd.&mime_type=video_mp4&qs=0&rc=aWgzaTo3NGZpODo1NjkzNEBpamRmPDk6Zjt1azM
         zZjgzM0BgLmIyMDAyXjAxYWMvMi8yYSNjY2dncjQwXl5gLS1kL2Nzcw%3D%3D&btag=e00090000&expire=1719855891&l=202407011143233D101C871936D5001C65&ply_type=2&policy=2&signature
         =340088e9f0f75a30dff4688fb949d427&tk=tt_chain_token'                                                                                                             
         For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403                                                                         
                                                                                                                                                                          
ERROR    HTTP状态错误, 尝试GET请求失败:                                                                                                                                   
         https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-pve-0037-aiso/oArPIfeNQMPg6UYWDQnAEUVNVNkQjB9CQbD2bU/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=3&dr
         =0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=3004&bt=1502&cs=0&ds=6&ft=4KJMyMzm8Zmo0Rkwp-4jV70idpWrKsd.&mime_type=video_mp4&qs=0&rc=aWgzaTo3NGZpODo1NjkzNEBpamRmPDk6Zjt1azMz
         ZjgzM0BgLmIyMDAyXjAxYWMvMi8yYSNjY2dncjQwXl5gLS1kL2Nzcw%3D%3D&btag=e00090000&expire=1719855891&l=202407011143233D101C871936D5001C65&ply_type=2&policy=2&signature=
         340088e9f0f75a30dff4688fb949d427&tk=tt_chain_token, 错误详情: Client error '403 Forbidden' for url                                                               
         'https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-pve-0037-aiso/oArPIfeNQMPg6UYWDQnAEUVNVNkQjB9CQbD2bU/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=3&d
         r=0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=3004&bt=1502&cs=0&ds=6&ft=4KJMyMzm8Zmo0Rkwp-4jV70idpWrKsd.&mime_type=video_mp4&qs=0&rc=aWgzaTo3NGZpODo1NjkzNEBpamRmPDk6Zjt1azM
         zZjgzM0BgLmIyMDAyXjAxYWMvMi8yYSNjY2dncjQwXl5gLS1kL2Nzcw%3D%3D&btag=e00090000&expire=1719855891&l=202407011143233D101C871936D5001C65&ply_type=2&policy=2&signature
         =340088e9f0f75a30dff4688fb949d427&tk=tt_chain_token'                                                                                                             
         For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403                                                                         
ERROR    Traceback (most recent call last):                                                                                                                               
           File "/Users/user/.pyenv/versions/3.11.1/lib/python3.11.1/site-packages/f2/utils/_dl.py", line 42, in get_content_length                           
             response.raise_for_status()                                                                                                                                  
           File "/Users/user/.pyenv/versions/3.11.1/lib/python3.11.1/site-packages/httpx/_models.py", line 761, in raise_for_status                           
             raise HTTPStatusError(message, request=request, response=self)                                                                                               
         httpx.HTTPStatusError: Client error '403 Forbidden' for url                                                                                                      
         'https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068-euttp/owIGiqKQos0IAIbAzDEiMSijCyhBnMfmAWQXBd/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=3&d
         r=0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=2820&bt=1410&cs=0&ds=6&ft=4KJMyMzm8Zmo0Rkwp-4jV70idpWrKsd.&mime_type=video_mp4&qs=0&rc=aDw8N2llNmVpNGk0Zzw3ZUBpanBpNm45cjdzdDM
         zZjczM0AvLTAuNGEwXzUxYy4yYi4tYSNfMTBpMmRjYC1gLS1kMWNzcw%3D%3D&btag=e00088000&expire=1719855823&l=202407011143233D101C871936D5001C65&ply_type=2&policy=2&signature
         =7f41428ad730261671cc2e08360529ce&tk=tt_chain_token'                                                                                                             
         For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403                                                                         
                                                                                                                                                                          
         During handling of the above exception, another exception occurred:                                                                                              
                                                                                                                                                                          
         Traceback (most recent call last):                                                                                                                               
           File "/Users/user/.pyenv/versions/3.11.1/lib/python3.11.1/site-packages/f2/utils/_dl.py", line 73, in get_content_length                           
             response.raise_for_status()                                                                                                                                  
           File "/Users/user/.pyenv/versions/3.11.1/lib/python3.11.1/site-packages/httpx/_models.py", line 761, in raise_for_status                           
             raise HTTPStatusError(message, request=request, response=self)                                                                                               
         httpx.HTTPStatusError: Client error '403 Forbidden' for url                                                                                                      
         'https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068-euttp/owIGiqKQos0IAIbAzDEiMSijCyhBnMfmAWQXBd/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=3&d
         r=0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=2820&bt=1410&cs=0&ds=6&ft=4KJMyMzm8Zmo0Rkwp-4jV70idpWrKsd.&mime_type=video_mp4&qs=0&rc=aDw8N2llNmVpNGk0Zzw3ZUBpanBpNm45cjdzdDM
         zZjczM0AvLTAuNGEwXzUxYy4yYi4tYSNfMTBpMmRjYC1gLS1kMWNzcw%3D%3D&btag=e00088000&expire=1719855823&l=202407011143233D101C871936D5001C65&ply_type=2&policy=2&signature
         =7f41428ad730261671cc2e08360529ce&tk=tt_chain_token'                                                                                                             
         For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403 

Let me know if I'm misconfiguring anything or using the wrong file or value somewhere! I can get f2 to work great with Douyin, but TikTok doesn't seem to be as easy! Thank you so much again for all your help, I really do appreciate it!

@Johnserf-Seed
Copy link
Owner

Johnserf-Seed commented Jul 1, 2024

Yes, I see the contents of the configuration file tiktok.yaml which does not match. Also, I found the major bug :< that caused this, in f2/apps/tiktok/utils.py:52, an oversight on my part resulted in writing the value incorrectly as model, when in fact it should have been BaseRequestModel, which you should fix to:

    # f2/apps/tiktok/utils.py:52
    @classmethod
    def base_request_model(cls) -> dict:
        return cls.client().get("BaseRequestModel", {})

image

Thank you for your patience, I will carefully answer the question about the existence of your config file.

  1. First of all the device_id configuration, you need to set the runtime of
python3 get_tiktok_device_id.py 
{'deviceId': '7386629644626396715', 'cookie': 'tt_chain_token=phQ5EQ4dWXv0urcIzTI7tQ==;bm_sv=6BC92BB0E1BF9C0206404BDDFBFA2935~ YAAQ6rUuF9hDoWyQAQAAKVoUbhgn9CDc+m1JDgwnPAdn8uBN6PKf5O/ex+ r85iQCTv9xB7lqCT2S3L5F0zgXyfaZDRaPmMu9ejIxwfvbsFkKFehUV5uFg0fbSa5U5J85x1RcNXiQf2KVq5b+ J4OzSDeAnThglZ8inIwNCNlYs9yKqHfk9I6ObeHgBaz23NTmoArvi5cnqyZ4NFrUktP/efxXXd4JKidlRzKJDkmW7h9X7ZUjJzClS5IZn7Cc0vcGo~1'}
{'deviceId': '7386629648954656302', 'cookie': 'ttwid=1%7CkihMguEU_lSgZdOWraX8pG2nw5HszGxcMXPC4mJ5AD4%7C1719833746% 7C954fb2c405920eeb9da0a3f7489d755866997da779f30edc13013760084d1f59;tt_csrf_token=WKEz1RU7-4Agnrre_4X5kuVkMGoYl7b5EjOU;tt_chain_  
lsUbhgj5OgTRimP3Ba0CLfRIklIKS70/nyM3wn1oRyomd/ B9lT1rmQV10k2NFIsxb7jIyGJxXaWATtxyzA96K0WfmFPTxTbMeMwzIUIDri4jE5JzdQ3sG6Cw3NG74pqiowRkOl85AVuQtQPXUF8ewuCUvoUHBltlzy8djntTiNml5lwmfdyusML10J170A7i7vw1h6905wJWcXyrOg +LPSllaIq8sYZaR0wqP7mzz/BRPRmTjIeiuBpdZkAUgB1rIvPsNplZVuYYAV6h1Q8GOkM8jM6tYbk9awmdzMktmk5+v9ExGSnQwAaUfEsgKTlCoC4fapT0WrPsohrVJ/ u24ZRlKHOnXIZGLgVu96Q'}
  1. Fill in the device_id: 7386629644626396715 into conf.yaml, and then fill in the cookie: tt_chain_token=phQ5EQ4dWXv0urcIzTI7tQ==; into your tiktok.yaml, like this.

your conf.yaml

f2:
  version: "0.0.1.6"

  douyin:
    encryption: ab

    BaseRequestModel:
      version:
        code: "190500"
        name: "19.5.0"
      browser:
        language: zh-CN
        platform: Win32
        name: Edge
        version: "122.0.0.0"
      engine:
        name: Blink
        version: "122.0.0.0"
      os:
        name: Windows
        version: "10"

    BaseLiveModel:
      language: zh-CN
      browser:
        language: zh-CN
        platform: Win32
        name: Edge
        version: "119.0.0.0"

    headers:
      User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0
      Referer: https://www.douyin.com/

    proxies:
      http://:
      https://:

    msToken:
      url: https://mssdk.bytedance.com/web/report
      magic: 538969122
      version: 1
      dataType: 8
      strData: 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

    ttwid:
      url: https://ttwid.bytedance.com/ttwid/union/register/
      data: '{"region":"cn","aid":1768,"needFid":false,"service":"www.ixigua.com","migrate_info":{"ticket":"","source":"node"},"cbUrlProtocol":"https","union":true}'

    webid:
      url: https://mcs.zijieapi.com/webid?aid=6383&sdk_version=5.1.18_zip&device_platform=web
      body:
        app_id: 6383
        referer: https://www.douyin.com/
        url: https://www.douyin.com/
        user_agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0
        user_unique_id: ""

  tiktok:

    BaseRequestModel:
      browser:
        language: zh-CN
        name: Mozilla
        platform: Win32
        version: 5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36

      device:
        id: "7386629644626396715"    # Fill in the new device_id here
        platform: web_pc

      os: windows
      region: SG
      priority_region: ""
      webcast_language: zh-Hans
      tz_name: Asia/Hong_Kong

    headers:
      User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
      Referer: https://www.tiktok.com/

    proxies:
      http://:
      https://:

    msToken:
      url: https://mssdk-sg.tiktok.com/web/common?msToken=QnC7zMMh1cpaDTxHDHnabNOrqaWv49JwA1IAq3AIFvrdaqQi8Rs_YlXSya1vN-4b6C1MgpWpS2cL1oakaUEDe3pUDMLpCbdSc3b3V98Fux0AuwXn_9Ns3FyMTnFRmSOOOVeGg6bVXMSGoMG6dq3k
      url2: https://mssdk-sg.tiktok.com/web/report?msToken=QnC7zMMh1cpaDTxHDHnabNOrqaWv49JwA1IAq3AIFvrdaqQi8Rs_YlXSya1vN-4b6C1MgpWpS2cL1oakaUEDe3pUDMLpCbdSc3b3V98Fux0AuwXn_9Ns3FyMTnFRmSOOOVeGg6bVXMSGoMG6dq3k
      magic: 538969122
      version: 1
      dataType: 8
      strData: 3g+ZrAO5JQgfqCRzb689RAbiueodAexjAjn2plyPVBdOArbRM66UOTnZPoVTDDw8GZ8TL/CO13bWedlvWSA8kCODHA6mjO1Af5hgak+1NHbb8EvfuahWFDL8x8hruWn4t6qb79DhOy64REx1nsO6ub4SX4cKdgs+ZXTjUItB2WKddXo7CKikuywT8SJ0TcwZ+z/9hSsawqJXawopS5H8bOF0o3qPn+CwkoWkXBUu4iwkI5UzL9/k18Gwq1BxAiCbyl2kCHJaox7md1H+KfQ0lU9fBhfVBuXa3jNkT5GfyASaBNeJXdhHwuPfEGI6a+4FOaO0MEGzOWDzhu6joo89ooEPo1XV+UJE2KLC5tStxSBibUvn+wZSfGmcpPfYl0jB0H2vLqyaveYraOx8WRE/G/Y9DkbBLJvz7E8sDZ/v1fCUVs1JDDewE/yn2aqOHr3NxUjOnylKl5WWSCPeSR4ZTXRR1ZJhvpGKP7XYc3tkOjBSQ70cXnl53dAQ6aouUVMcztSlkXh4goI46tgJDjTiJJILHBr03dM/1KwVzqoEEO8f7JBhfQo4OR6Y48PXomshJmZhDiEmtkqLndpZY2I/B8q0EShuPlDCFRW7iob6kFahyqDfpOmK15kzCX2n7eu7zqDGgpJuHEtULF9803lR5QBt104ET49RbnDJ+ipbz1bFvS2FJQ2rfktNlwjqdBT8UzfFPHyZk6z4cSxYIfPRj1lB8fDwTwv3PUSRxUZSwkuGoZbc6j/6hxwZaY0xxIEbb9DlOmQZY4qyiqSziZ8HGWsQ9uD95dO4lX6GlZaeh7mKsjLSKSdUt13YeGAciqjTvSPyO/pZ5xc3+i+5hY4A290/JiTmIyFBOrRrlmIhPEQe9OEJn0DPXYgliYUO1nljEi6q/4HMFdXFmlw6nC8/kL9EeinisX7g6PbdHuRcKONXZpXxBevL8xD5Z8SvFKH/uQmYHrJlybiKHjDIMq7vc59NBw2VDQBmRqa8NTh2XLwIryjoBIHuNSBngSZwJE==

    ttwid:
      url: https://www.tiktok.com/ttwid/check/
      data: '{"aid":1988,"service":"www.tiktok.com","union":false,"unionHost":"","needFid":false,"fid":"","migrate_priority":0}'
      cookie: ttwid=1%7C3uOVjidbOFBmdS6Aci5oeBb8Ta-HWpeyp2dvhl2Ib2E%7C1716637053%7C462867ee452aecd60a854225b854ff4498e9b99c13d4826a3e2a4e58a4c55134;

    odin_tt:
      url: https://www.tiktok.com/passport/web/account/info/?WebIdLastTime=1716637053&aid=1459&app_language=zh-Hans&app_name=tiktok_web&browser_language=zh-CN&browser_name=Mozilla&browser_online=true&browser_platform=Win32&browser_version=5.0%20%28Windows%20NT%2010.0%3B%20Win64%3B%20x64%29%20AppleWebKit%2F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F124.0.0.0%20Safari%2F537.36&channel=tiktok_web&cookie_enabled=true&device_id=7372899909097571857&device_platform=web_pc&focus_state=true&from_page=fyp&history_len=2&is_fullscreen=false&is_page_visible=true&odinId=7372898697492972561&os=windows&priority_region=&referer=&region=SG&screen_height=1080&screen_width=1920&tz_name=Asia%2FHong_Kong&webcast_language=zh-Hans

  twitter:
    headers:
      User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0
      Referer: https://twitter.com/
      Authorization: Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA
      X-Csrf-Token: ""

    proxies:
      http://:
      https://:

  weibo:
    headers:
      User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0
      Referer: https://weibo.com/

    proxies:
      http://:
      https://:

    visitor:
      url: https://passport.weibo.com/visitor/genvisitor2
      cb: visitor_gray_callback
      tid:
      from: weibo

your tiktok.yaml

tiktok:
  odin_tt:
    url: https://www.tiktok.com/passport/web/account/info/?WebIdLastTime=1716637053&aid=1459&app_language=zh-Hans&app_name=tiktok_web&browser_language=zh-CN&browser_name=Mozilla&browser_online=true&browser_platform=Win32&browser_version=5.0%20%28Windows%20NT%2010.0%3B%20Win64%3B%20x64%29%20AppleWebKit%2F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F124.0.0.0%20Safari%2F537.36&channel=tiktok_web&cookie_enabled=true&device_id=7372899909097571857&device_platform=web_pc&focus_state=true&from_page=fyp&history_len=2&is_fullscreen=false&is_page_visible=true&odinId=7372898697492972561&os=windows&priority_region=&referer=&region=SG&screen_height=1080&screen_width=1920&tz_name=Asia%2FHong_Kong&webcast_language=zh-Hans
  User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML,
    like Gecko) Chrome/125.0.0.0 Safari/537.36
  # Replace cookie:tt_chain_token bound to device_id with old value
  cookie: tt_chain_token=phQ5EQ4dWXv0urcIzTI7tQ==; xxx=xxx;
  cover: true
  dataType: 8
  desc: true
  folderize: false
  headers:
    Referer: https://www.tiktok.com/
    User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36
      (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
  interval: all
  language: en_US
  magic: 538969122
  max_connections: 5
  max_counts: 0
  max_retries: 20
  max_tasks: 5
  mode: post
  msToken:
    User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36
      (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
    dataType: 8
    magic: 538969122
    strData: L4ewPx28JPUaoDr6cApcBI76s4x_UDCzduSiHMaWUpVKIEkXhONE6qzHpK88ECXcKNABvskwQC1FnMLlSXG67L8_M-vxTyrAH6q8d52cEWa3dnak8hiGlL1cVVYf1pC_Hdk-uLYOV_FuDUoOnz4=
    url: https://mssdk.bytedance.com/web/report
    version: 1
  music: false
  naming: '{create}_{desc}'
  odin_tt:
    url: https://www.tiktok.com/passport/web/account/info/?aid=1459&app_language=zh-Hans&app_name=tiktok_web&browser_language=zh-CN&browser_name=Mozilla&browser_online=true&browser_platform=Win32&browser_version=5.0%20%28Windows%20NT%2010.0%3B%20Win64%3B%20x64%29%20AppleWebKit%2F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F119.0.0.0%20Safari%2F537.36&channel=tiktok_web&cookie_enabled=true&device_id=7306060721837852167&root_referer=https%3A%2F%2Fwww.tiktok.com
  page_counts: 20
  path: /Users/users/Desktop/F2/test1
  proxies:
    http: null
    https: null
  strData: 3BvqYbNXLLOcZehvxZVbjpAu7vq82RoWmFSJHLFwzDwJIZevE0AeilQfP55LridxmdGGjknoksqIsLqlMHMif0IFK/Br7JWqxOHnYuMwVCnttFc0Y4MFvdVWM5FECiEulJC0Dc+eeVsNSrFnAc9K7fazqdglyJgGLSfXIJmgyCvvQ4pg0u5HBVVugLSWs242X42fjoWymaUCLZJQo6vi6WLyuV7l5IC3Mg+lelr5xBQD6Q7hBIFEw8zzxJ1n2DyA4xLbOHTQdKvEtsK7XzyWwjpRnojPTbBl69Zosnuru+lOBIl+tFu/+hCQ1m0jYZwTP4rVE75L3Du6+KZ5v/9TyFYjq7y3y9bGLP4d7yQueJbF90G1yrZ6htElrZ2vqZKDrIqBVbmOZr/nph12k2JKrITtN0R/pMsp0sJ4gesQnXxcD/pLOFAINHk7umgbe6LzJ7+TLUdGuO4M7xiEg/jCqhjgJX1izZ4NPoBDp35zRxj6Y6OrcstlTN/cv5sz663+Nco/mEwhGq2VwrL4gAIAPycndIsb48dPdtngmLqNDNN0ZyVRjgqVIDXXrxigXCkR9CH89Dlrrb7QQqWVgRXz9/k5ihEM43BR3sd3mMU/XgFLN1Aoxf6GzzdxP2QPBI75/ZoHoAmu54v8gTmA3ntCGlEF0zgaFGTdpkGdb+oZgyQM4pw1aAyxmFINXkpD3IKKoGev9kD9gTFnhiQMGCMemhZS7ZYdbuGu0Cb+lQKaL/QTt80FMyGmW8kzVy9xW/ja9BcdEJYRoaufuFRkBFG5ay8x4WHLR6hEapXqQial/cREbLL4sQytpjtmnndFqvT7xN5DhgsLY2Z7451MJhD6NJXKNrMafGZSbItzQWY=
  timeout: 10
  ttwid:
    cookie: 1%7CVHrH5Mr2patcBf6Et_ELdIH_XysKWoAofxNgVkbJTzA%7C1702562457%7Ceda860c7cf77c4f2c0f7a19622a7536869842169b01c2c102bebeac79c4e7eed
    data: '{"aid":1988,"service":"www.tiktok.com","union":false,"unionHost":"","needFid":false,"fid":"","migrate_priority":0}'
    url: https://www.tiktok.com/ttwid/check/
  url: https://www.tiktok.com/@gordonramsayofficial
  version: 1

Screenshot

image

Now the F2 should work correctly, if you have new questions feel free to continue the discussion! 😊

@Vetches
Copy link

Vetches commented Jul 1, 2024

Before I begin, would it be possible to erase or update the path property of the tiktok.yaml portion of your update your last comment? I realize I used my actual path instead of anonymizing it, so it'd be great if you could erase it, haha.

With that aside, thank you so much for such a thorough reply and being so patient with helping me! I just went ahead and updated the utils.py function with your suggestion!

Unfortunately, it's still not working, haha. I tried using a different browser (originally Chrome, now Firefox) but it didn't change anything. Here are the steps I tried after reading your reply!

  1. Ran f2 tk -l en_US --auto-cookie firefox to set cookies:
f2 tk -l en_US --auto-cookie firefox
WARNING  您当前使用的版本 0.0.1.6 可能已过时,请考虑及时升级到最新版本 0.0.1.6,请使用 pip install -U f2 更新                                                             
INFO     应用:tiktok                                                                                                                                                     
Should I update the configuration file using parameters from the command line?`/Users/user/.pyenv/versions/3.11.1/lib/python3.11/site-packages/f2/conf/app.yaml` [Y/n]: Y
Configuration files have been updated!

Here is the new app.yaml file!:

douyin:
  cookie: null
  lyric: true
  max_connections: 5
  max_counts: 0
  max_retries: 5
  max_tasks: 10
  naming: '{create}_{desc}'
  page_counts: 20
  path: Download
  timeout: 10
tiktok:
  cookie:  tt_chain_token=8eqB5Y0ciD4hbZcwXVTrwQ==;
  max_connections: 5
  max_counts: 0
  max_retries: 5
  max_tasks: 5
  naming: '{create}_{desc}'
  page_counts: 5
  path: Download
  timeout: 10
twitter:
  cookie: null
  folderize: true
  interval: all
  max_connections: 5
  max_counts: 0
  max_retries: 5
  max_tasks: 5
  mode: one
  naming: '{create}_{desc}'
  page_counts: 20
  path: Download
  timeout: 10
weibo:
  cookie: null
  folderize: true
  interval: all
  max_connections: 5
  max_counts: 0
  max_retries: 5
  max_tasks: 5
  mode: post
  naming: '{create}_{desc}'
  page_counts: 20
  path: Download
  timeout: 10
  1. Ran python3 get_tiktok_device_id.py code snippet:
python3 get_tiktok_device_id.py 
{'deviceId': '7386681587079972398', 'cookie': 'tt_chain_token=eQHpKpgw04JNiWvh/LObnw==;bm_sv=6860F2CB20AF5371B2B290C3F97CD97A~YAAQ2oEyF3Lv51yQAQAACOHMbhjo9h6LvuSA8iDouTYl9xXtnmz1zbx9Ok7E171MM6hHJMKpk7z0MJXR1aGhqnaYhDBTdSnW/8RAnNdEQQCn2jyEFFm3FmuP+J4mmFhOSWyg+1ECQ2DphbmdAhjIHtivXBgfBS6KiSMU0RpNXArV8fzAqclRQpskQJnQx7/AVQCt7Ko1XBwdas4k4hP0ufSzNum+tI/NE18NQ4mrYfHAcmUjEw3nQe/CykoBZxAL~1'}
{'deviceId': '7386681590811952683', 'cookie': 'ttwid=1%7CuwbuwfmSN4moKU0EJinHI3inMOSBEOxAb2sGzi67ijo%7C1719845839%7C57afe7c918e70415c49eb4adc5f69a2b7bd3be7d30bc7c76f6ec7c14a63e02ba;tt_csrf_token=Ebg179v4-YTe799ddUO13FnSuRuboZrzF5bA;tt_chain_token=kcxt28CoXS7XeTWhrt57kg==;ak_bmsc=C8E14EF226B532CA03C57FED1E9F649E~000000000000000000000000000000~YAAQ2oEyF3jv51yQAQAAveLMbhg51S/LkDyVorH2qI4lPw5c2UedCVYeBgsICPE0wTUzkho4PiV7LuYcWWGuRJqIuk7UPIhv6whiTM1VxFGzQ5eOZWn8gKULviFaPNgfCqbPF05cDm6kBRak5b/ZCiGcdYaNqxvA8eWYFcbWmnIrsR9gnQOLordlyqzNXdpmcGotluqrc3JF8oa31ehJ2f7I/1AGrJD47cPxrUpP97un1Wb6PgPyOFzmbywTIzWb1Pax0EEJwhcgRd1qhoh+PfwevjDFopD6FZrxiFLBuEs//5Tbj37H1jyT5tFZsVO052jAnKWjZc32Zw8YI8nTsuGlgD8ka8YxdNB+AFJcrIejfVPkw4DIBDTJKjU6'}

Based on your example, do we use the first device ID without the full cookie value?

  1. Copied the first device ID (7386681587079972398) into the conf.yaml file:
f2:
  version: "0.0.1.6"

  douyin:
    encryption: ab

    BaseRequestModel:
      version:
        code: "190500"
        name: "19.5.0"
      browser:
        language: zh-CN
        platform: Win32
        name: Edge
        version: "122.0.0.0"
      engine:
        name: Blink
        version: "122.0.0.0"
      os:
        name: Windows
        version: "10"

    BaseLiveModel:
      language: zh-CN
      browser:
        language: zh-CN
        platform: Win32
        name: Edge
        version: "119.0.0.0"

    headers:
      User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0
      Referer: https://www.douyin.com/

    proxies:
      http://:
      https://:

    msToken:
      url: https://mssdk.bytedance.com/web/report
      magic: 538969122
      version: 1
      dataType: 8
      strData: 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

    ttwid:
      url: https://ttwid.bytedance.com/ttwid/union/register/
      data: '{"region":"cn","aid":1768,"needFid":false,"service":"www.ixigua.com","migrate_info":{"ticket":"","source":"node"},"cbUrlProtocol":"https","union":true}'

    webid:
      url: https://mcs.zijieapi.com/webid?aid=6383&sdk_version=5.1.18_zip&device_platform=web
      body:
        app_id: 6383
        referer: https://www.douyin.com/
        url: https://www.douyin.com/
        user_agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0
        user_unique_id: ""

  tiktok:

    BaseRequestModel:
      browser:
        language: zh-CN
        name: Mozilla
        platform: Win32
        version: 5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36

      device:
        id: "7386681587079972398" # <--- UPDATED
        platform: web_pc

      os: windows
      region: SG
      priority_region: ""
      webcast_language: zh-Hans
      tz_name: Asia/Hong_Kong

    headers:
      User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
      Referer: https://www.tiktok.com/

    proxies:
      http://:
      https://:

    msToken:
      url: https://mssdk-sg.tiktok.com/web/common?msToken=QnC7zMMh1cpaDTxHDHnabNOrqaWv49JwA1IAq3AIFvrdaqQi8Rs_YlXSya1vN-4b6C1MgpWpS2cL1oakaUEDe3pUDMLpCbdSc3b3V98Fux0AuwXn_9Ns3FyMTnFRmSOOOVeGg6bVXMSGoMG6dq3k
      url2: https://mssdk-sg.tiktok.com/web/report?msToken=QnC7zMMh1cpaDTxHDHnabNOrqaWv49JwA1IAq3AIFvrdaqQi8Rs_YlXSya1vN-4b6C1MgpWpS2cL1oakaUEDe3pUDMLpCbdSc3b3V98Fux0AuwXn_9Ns3FyMTnFRmSOOOVeGg6bVXMSGoMG6dq3k
      magic: 538969122
      version: 1
      dataType: 8
      strData: 3g+ZrAO5JQgfqCRzb689RAbiueodAexjAjn2plyPVBdOArbRM66UOTnZPoVTDDw8GZ8TL/CO13bWedlvWSA8kCODHA6mjO1Af5hgak+1NHbb8EvfuahWFDL8x8hruWn4t6qb79DhOy64REx1nsO6ub4SX4cKdgs+ZXTjUItB2WKddXo7CKikuywT8SJ0TcwZ+z/9hSsawqJXawopS5H8bOF0o3qPn+CwkoWkXBUu4iwkI5UzL9/k18Gwq1BxAiCbyl2kCHJaox7md1H+KfQ0lU9fBhfVBuXa3jNkT5GfyASaBNeJXdhHwuPfEGI6a+4FOaO0MEGzOWDzhu6joo89ooEPo1XV+UJE2KLC5tStxSBibUvn+wZSfGmcpPfYl0jB0H2vLqyaveYraOx8WRE/G/Y9DkbBLJvz7E8sDZ/v1fCUVs1JDDewE/yn2aqOHr3NxUjOnylKl5WWSCPeSR4ZTXRR1ZJhvpGKP7XYc3tkOjBSQ70cXnl53dAQ6aouUVMcztSlkXh4goI46tgJDjTiJJILHBr03dM/1KwVzqoEEO8f7JBhfQo4OR6Y48PXomshJmZhDiEmtkqLndpZY2I/B8q0EShuPlDCFRW7iob6kFahyqDfpOmK15kzCX2n7eu7zqDGgpJuHEtULF9803lR5QBt104ET49RbnDJ+ipbz1bFvS2FJQ2rfktNlwjqdBT8UzfFPHyZk6z4cSxYIfPRj1lB8fDwTwv3PUSRxUZSwkuGoZbc6j/6hxwZaY0xxIEbb9DlOmQZY4qyiqSziZ8HGWsQ9uD95dO4lX6GlZaeh7mKsjLSKSdUt13YeGAciqjTvSPyO/pZ5xc3+i+5hY4A290/JiTmIyFBOrRrlmIhPEQe9OEJn0DPXYgliYUO1nljEi6q/4HMFdXFmlw6nC8/kL9EeinisX7g6PbdHuRcKONXZpXxBevL8xD5Z8SvFKH/uQmYHrJlybiKHjDIMq7vc59NBw2VDQBmRqa8NTh2XLwIryjoBIHuNSBngSZwJE==

    ttwid:
      url: https://www.tiktok.com/ttwid/check/
      data: '{"aid":1988,"service":"www.tiktok.com","union":false,"unionHost":"","needFid":false,"fid":"","migrate_priority":0}'
      cookie: ttwid=1%7C3uOVjidbOFBmdS6Aci5oeBb8Ta-HWpeyp2dvhl2Ib2E%7C1716637053%7C462867ee452aecd60a854225b854ff4498e9b99c13d4826a3e2a4e58a4c55134;

    odin_tt:
      url: https://www.tiktok.com/passport/web/account/info/?WebIdLastTime=1716637053&aid=1459&app_language=zh-Hans&app_name=tiktok_web&browser_language=zh-CN&browser_name=Mozilla&browser_online=true&browser_platform=Win32&browser_version=5.0%20%28Windows%20NT%2010.0%3B%20Win64%3B%20x64%29%20AppleWebKit%2F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F124.0.0.0%20Safari%2F537.36&channel=tiktok_web&cookie_enabled=true&device_id=7372899909097571857&device_platform=web_pc&focus_state=true&from_page=fyp&history_len=2&is_fullscreen=false&is_page_visible=true&odinId=7372898697492972561&os=windows&priority_region=&referer=&region=SG&screen_height=1080&screen_width=1920&tz_name=Asia%2FHong_Kong&webcast_language=zh-Hans

  twitter:
    headers:
      User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0
      Referer: https://twitter.com/
      Authorization: Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA
      X-Csrf-Token: ""

    proxies:
      http://:
      https://:

  weibo:
    headers:
      User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0
      Referer: https://weibo.com/

    proxies:
      http://:
      https://:

    visitor:
      url: https://passport.weibo.com/visitor/genvisitor2
      cb: visitor_gray_callback
      tid:
      from: weibo
  1. Update the tiktok.yaml custom configuration file with the cookie value from app.yaml and the tt_chain_token value from the get_tiktok_device_id.py script:

tt_chain_token: tt_chain_token=eQHpKpgw04JNiWvh/LObnw==
tiktok.yaml file:

tiktok:
  odin_tt:
    url: https://www.tiktok.com/passport/web/account/info/?WebIdLastTime=1716637053&aid=1459&app_language=zh-Hans&app_name=tiktok_web&browser_language=zh-CN&browser_name=Mozilla&browser_online=true&browser_platform=Win32&browser_version=5.0%20%28Windows%20NT%2010.0%3B%20Win64%3B%20x64%29%20AppleWebKit%2F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F124.0.0.0%20Safari%2F537.36&channel=tiktok_web&cookie_enabled=true&device_id=7372899909097571857&device_platform=web_pc&focus_state=true&from_page=fyp&history_len=2&is_fullscreen=false&is_page_visible=true&odinId=7372898697492972561&os=windows&priority_region=&referer=&region=SG&screen_height=1080&screen_width=1920&tz_name=Asia%2FHong_Kong&webcast_language=zh-Hans
  User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML,
    like Gecko) Chrome/125.0.0.0 Safari/537.36
  cookie:  tt_chain_token=eQHpKpgw04JNiWvh/LObnw==; # more cookie
  cover: true
  dataType: 8
  desc: true
  folderize: false
  headers:
    Referer: https://www.tiktok.com/
    User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36
      (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
  interval: all
  language: en_US
  magic: 538969122
  max_connections: 5
  max_counts: 0
  max_retries: 20
  max_tasks: 5
  mode: post
  msToken:
    User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36
      (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
    dataType: 8
    magic: 538969122
    strData: L4ewPx28JPUaoDr6cApcBI76s4x_UDCzduSiHMaWUpVKIEkXhONE6qzHpK88ECXcKNABvskwQC1FnMLlSXG67L8_M-vxTyrAH6q8d52cEWa3dnak8hiGlL1cVVYf1pC_Hdk-uLYOV_FuDUoOnz4=
    url: https://mssdk.bytedance.com/web/report
    version: 1
  music: false
  naming: '{create}_{desc}'
  odin_tt:
    url: https://www.tiktok.com/passport/web/account/info/?aid=1459&app_language=zh-Hans&app_name=tiktok_web&browser_language=zh-CN&browser_name=Mozilla&browser_online=true&browser_platform=Win32&browser_version=5.0%20%28Windows%20NT%2010.0%3B%20Win64%3B%20x64%29%20AppleWebKit%2F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F119.0.0.0%20Safari%2F537.36&channel=tiktok_web&cookie_enabled=true&device_id=7306060721837852167&root_referer=https%3A%2F%2Fwww.tiktok.com
  page_counts: 20
  path: /Users/user/Desktop/F2/test1
  proxies:
    http: null
    https: null
  strData: 3BvqYbNXLLOcZehvxZVbjpAu7vq82RoWmFSJHLFwzDwJIZevE0AeilQfP55LridxmdGGjknoksqIsLqlMHMif0IFK/Br7JWqxOHnYuMwVCnttFc0Y4MFvdVWM5FECiEulJC0Dc+eeVsNSrFnAc9K7fazqdglyJgGLSfXIJmgyCvvQ4pg0u5HBVVugLSWs242X42fjoWymaUCLZJQo6vi6WLyuV7l5IC3Mg+lelr5xBQD6Q7hBIFEw8zzxJ1n2DyA4xLbOHTQdKvEtsK7XzyWwjpRnojPTbBl69Zosnuru+lOBIl+tFu/+hCQ1m0jYZwTP4rVE75L3Du6+KZ5v/9TyFYjq7y3y9bGLP4d7yQueJbF90G1yrZ6htElrZ2vqZKDrIqBVbmOZr/nph12k2JKrITtN0R/pMsp0sJ4gesQnXxcD/pLOFAINHk7umgbe6LzJ7+TLUdGuO4M7xiEg/jCqhjgJX1izZ4NPoBDp35zRxj6Y6OrcstlTN/cv5sz663+Nco/mEwhGq2VwrL4gAIAPycndIsb48dPdtngmLqNDNN0ZyVRjgqVIDXXrxigXCkR9CH89Dlrrb7QQqWVgRXz9/k5ihEM43BR3sd3mMU/XgFLN1Aoxf6GzzdxP2QPBI75/ZoHoAmu54v8gTmA3ntCGlEF0zgaFGTdpkGdb+oZgyQM4pw1aAyxmFINXkpD3IKKoGev9kD9gTFnhiQMGCMemhZS7ZYdbuGu0Cb+lQKaL/QTt80FMyGmW8kzVy9xW/ja9BcdEJYRoaufuFRkBFG5ay8x4WHLR6hEapXqQial/cREbLL4sQytpjtmnndFqvT7xN5DhgsLY2Z7451MJhD6NJXKNrMafGZSbItzQWY=
  timeout: 10
  ttwid:
    cookie: 1%7CVHrH5Mr2patcBf6Et_ELdIH_XysKWoAofxNgVkbJTzA%7C1702562457%7Ceda860c7cf77c4f2c0f7a19622a7536869842169b01c2c102bebeac79c4e7eed
    data: '{"aid":1988,"service":"www.tiktok.com","union":false,"unionHost":"","needFid":false,"fid":"","migrate_priority":0}'
    url: https://www.tiktok.com/ttwid/check/
  url: https://www.tiktok.com/@gordonramsayofficial
  version: 1
  1. Run f2 tk -l en_US -c tiktok.yaml, which results in the same errors as before:
f2 tk -l en_US -c tiktok.yaml
WARNING  您当前使用的版本 0.0.1.6 可能已过时,请考虑及时升级到最新版本 0.0.1.6,请使用 pip install -U f2 更新                                                             
INFO     应用:tiktok                                                                                                                                                     
INFO     Mode: post                                                                                                                                                       
INFO     Main configuration path: /Users/user/.pyenv/versions/3.11.1/lib/python3.11/site-packages/f2/conf/app.yaml                                           
INFO     Custom configuration path: /Users/user/Desktop/SAUCE/AUTOMATED TIKTOK DOWNLOADING/tiktok.yaml      

I feel like I'm missing something with how to structure the cookies and the tt_chain_token=eQHpKpgw04JNiWvh/LObnw== portion. In tiktok.yaml, is the cookie property the entire cookie from app.yaml, or just tt_chain_token=eQHpKpgw04JNiWvh/LObnw==? Or do I not even modify the tt_chain_token portion of the cookie value in tiktok.yaml? Any additional insight would be greatly appreciated!

Once again, thank you so much for helping me troubleshoot this! I'm more than happy to try anything you think would help or copy/paste any specific configurations, etc. I know we're close to getting this working!

@Johnserf-Seed
Copy link
Owner

Thank you very much for your patience, I've changed the personal information in the comments, you just need to log back into tiktok to invalidate the old cookie.

For the sake of brevity I will only show the tiktok part of the config file.

  • Suppose you re-run this code
python3 get_tiktok_device_id.py 
{'deviceId': '7386681587079972398', 'cookie': 'tt_chain_token=eQHpKpgw04JNiWvh/LObnw==;xxxx=xxxx'}
  • Place this deviceId in f2/conf/conf.yaml
f2.
  version: "0.0.1.6"

  tiktok:

    BaseRequestModel:
      ......
      device:
        id: "7386681587079972398" # deviceId just pasted in
        platform: web_pc

Here's the kicker, you just need to replace that tt_chain_token value corresponding to the deviceId into your tiktok.yaml configuration file (this is the only value to be replaced, the rest of the cookies are not modified).

Just find the original tt_chain_token and replace it with the new tt_chain_token.

tiktok:
  cookie: tt_chain_token=eQHpKpgw04JNiWvh/LObnw==; xxx=xxx # these are the other cookie contents
  max_connections: 5
  max_counts: 0
  max_retries: 5
  max_tasks: 5
  naming: '{create}_{desc}'
  page_counts: 5
  path: Download
  timeout: 10

To make sure the device_Id was successfully set, you can print it in f2/apps/tiktok/utils.py:60 for comparison. I hope it works out for you. We're almost there! ^^
image

Because the cookie you get from the browser corresponds to the device_Id in the browser, you just need to make sure they are consistent, based on the value you get from get_tiktok_device_id.py.

@Johnserf-Seed
Copy link
Owner

I hope it's working properly now, also tiktok may have other bugs, which will all be fixed in the next version update :>

image

@Vetches
Copy link

Vetches commented Jul 1, 2024

Ah, I realize now I never linked the comment in question! So here, towards the bottom, the path property of the tiktok.yaml has my actual path instead of a fake one! The cookies being there is fine, it's the path that I'm hoping you could erase instead! Sorry for the lack of clarity! 😅

And I thank you as well for bearing with me! So I went ahead and did exactly as you said, but it still doesn't seem to work. However! One thing I noticed in the error messages is that the tt_chain_token value isn't included in the URLs. Is that normal? I'll still lay out the steps I tried to be clear!

  1. Run python3 get_tiktok_device_id.py:
python3 get_tiktok_device_id.py 
{'deviceId': '7386706068162463274', 'cookie': 'tt_chain_token=uiu06/A07IgETEOnRD+0Qg==;bm_sv=512A28D4D703A7FF3052F2CD65B4E8CB~YAAQ7rUuFz83+muQAQAAf9ojbxgEUKPW9jj+mnHaUko3tF1yoE7qspqG6gMYgs/RMB84miFM26MVC+q+xXc1iMeocuBmceHU4AawBFfVAr57l8US02GeaAm5S+9vKyMjRkA/USblR6yYW5uU2ZZa6sejlwub1VrJSFGsxbNjkjLeuUsPLqtaIWI5Wsx1rhlSse62RsyWX/4TWm6sUh3MXXrWeUxJd/YdZa6dn0w7UzZr/2d9URfPsymeeu5J4Try~1'}
{'deviceId': '7386706072000349738', 'cookie': 'ttwid=1%7CUrf7XsWNo16gqNcJcjW2_5DpzTE7GYm8LsSRGyKpeBQ%7C1719851539%7C2c8e1018096b4d7aa1a77af47a5e8f6e55f1a7ff106492f3fbbf745b5fda0838;tt_csrf_token=eBJpXXe3-84EY2ao3NQ5UnDej4mkqgRXb88g;tt_chain_token=EhGIMEq8JpFWE31p3hk1Bw==;ak_bmsc=589B627FC455D1B77193F3DEA62394AA~000000000000000000000000000000~YAAQ7rUuF0M3+muQAQAAd9wjbxhVAFSkhNc2ldeIJV9XKZwWsCUFS16NKqu3q9rpzXvzYPJir61lzca7IHncG3VPpL5gSddk6dg9ykyw2QWlXXCPNpa651qZME3YJXO9c1Du1xCk5sA0eQ6QBH8N6bJQ21GLDtHWn4joaJpivGyZlsOBFHFjjoCkAYQhYAWZql9UVi5gWk786yXSu/0QONnult/mWc2EOBhQRFS88xPVdXIvgX9Hgx3YeNEPJaemThGtcnRWRU9s5vioWnacliIpksPpxKe8EZ7pwc0wKbO4jUMnK0WJqBUW826+BXB1fQoljE63/NZrfV5R8vJkMYc7Tlbs1XvLdxFkzY3ZDdx1JaLiLZKIWiCDzSRV'}
  1. Take the first device ID and paste it into conf.yaml:
...
tiktok:

    BaseRequestModel:
      browser:
        language: zh-CN
        name: Mozilla
        platform: Win32
        version: 5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36

      device:
        id: "7386706068162463274"
        platform: web_pc
...

I've verified that the device ID is read from correctly with the printing suggestion you made as well!:

@classmethod
    def brm_device(cls) -> dict:
        print('HEYYYY', cls.base_request_model().get("device", {}))
        return cls.base_request_model().get("device", {})
f2 tk -l en_US -c tiktok.yaml
WARNING  您当前使用的版本 0.0.1.6 可能已过时,请考虑及时升级到最新版本 0.0.1.6,请使用 pip install -U f2 更新                                                             
INFO     应用:tiktok                                                                                                                                                     
INFO     Mode: post                                                                                                                                                       
INFO     Main configuration path: /Users/user/.pyenv/versions/3.11.1/lib/python3.11/site-packages/f2/conf/app.yaml                                           
INFO     Custom configuration path: /Users/user/Desktop/SAUCE/AUTOMATED TIKTOK DOWNLOADING/tiktok.yaml                                                       
HEYYYY {'id': '7386706068162463274', 'platform': 'web_pc'}
HEYYYY {'id': '7386706068162463274', 'platform': 'web_pc'}
  1. Run f2 tk --auto-cookie firefox and copy the cookie value from app.yaml into tiktok.yaml:

tiktok.yaml:

tiktok:
  odin_tt:
    url: https://www.tiktok.com/passport/web/account/info/?WebIdLastTime=1716637053&aid=1459&app_language=zh-Hans&app_name=tiktok_web&browser_language=zh-CN&browser_name=Mozilla&browser_online=true&browser_platform=Win32&browser_version=5.0%20%28Windows%20NT%2010.0%3B%20Win64%3B%20x64%29%20AppleWebKit%2F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F124.0.0.0%20Safari%2F537.36&channel=tiktok_web&cookie_enabled=true&device_id=7372899909097571857&device_platform=web_pc&focus_state=true&from_page=fyp&history_len=2&is_fullscreen=false&is_page_visible=true&odinId=7372898697492972561&os=windows&priority_region=&referer=&region=SG&screen_height=1080&screen_width=1920&tz_name=Asia%2FHong_Kong&webcast_language=zh-Hans
  User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML,
    like Gecko) Chrome/125.0.0.0 Safari/537.36
  cookie: ttwid=1%7CAj6ILKLNPJrcFG4-U8CDZ7LRnAM6m2f5oTdv9-J1ksM%7C1718280507%7Cc9b2f10879a55435c2a8c217cf33c72a8d7aa380baca986307ca428e9fc3cfb7;
    sid_guard=71b1395b4562dc64409d82c934d72b16%7C1719851435%7C15551991%7CSat%2C+28-Dec-2024+16%3A30%3A26+GMT;
    uid_tt=714eae634cdad8bcab321abd76efcbfe63f3c14ffd9f7acc5b898f616735d5dc; uid_tt_ss=714eae634cdad8bcab321abd76efcbfe63f3c14ffd9f7acc5b898f616735d5dc;
    sid_tt=71b1395b4562dc64409d82c934d72b16; sessionid=71b1395b4562dc64409d82c934d72b16;
    sessionid_ss=71b1395b4562dc64409d82c934d72b16; sid_ucp_v1=1.0.0-KDY1NTYzNjM0MWVjODU0OGFhZmM4YjljNzlhMzQ2OGU3OWIzYmQ0MzcKGgiqiJ-cutWty2UQq7OLtAYYsws4AUDqB0gEEAQaB3VzZWFzdDUiIDcxYjEzOTViNDU2MmRjNjQ0MDlkODJjOTM0ZDcyYjE2;
    ssid_ucp_v1=1.0.0-KDY1NTYzNjM0MWVjODU0OGFhZmM4YjljNzlhMzQ2OGU3OWIzYmQ0MzcKGgiqiJ-cutWty2UQq7OLtAYYsws4AUDqB0gEEAQaB3VzZWFzdDUiIDcxYjEzOTViNDU2MmRjNjQ0MDlkODJjOTM0ZDcyYjE2;
    tt-target-idc-sign=PSDwMoI5lf0hm7ErSgLLdkJZaODPk0ZeEJIVfhK5nNBe606PhwxzCXXPfo8t1iJuaLrM65hXBsAOU49raJYrmzbSQLmSl2Qj6_UMtHDLSR8XWj3Q8KUzftAkCswO2nST5oITCcBZeefdzo4y9AQSGenL6wvRQNUhEhZWL2_33nZ-oNyiHc2LFsx_mjo9JQ7zmda9HupBkqzBVNUVkHWVS74-ouyWj3adAAJSiS7FBUNECCmbHC5c00RZ0sesp_44-PVj65d5TvsFHJHKV2cK98uMokEvHnsdpZXwi8OeXW-Uz-QZi39Fnx3wi1o4jg1KfjGZvgl6JkNSqUGXfQNQwFv4HsgtgdNOOpwG3uo26i-dNKjwCo8TQ_U9qYICmezMNk38n3GilflKpomlmLiytfn4WGk6nSD2TBisFP7zPrN9z5SoycSH6RdMupy_LL4y64zMDyzzGC-9ZIPG8gvhGXa14LKtky3qjI09-QL3uVK0bMG2j2WJkgenxJsYmnL3;
    store-idc=useast5; store-country-code=us; store-country-code-src=uid; tt-target-idc=useast5;
    tt_chain_token=5GgFovoOJm1vfJHkify6Bg==; odin_tt=652789081f5a4e6a6dd60f442363dd2778a989b57b5a6237b4c0a131066ca436;
    msToken=zECchOLDTdSkSyvJpvAThKEc-LCiinhL0vkgHl47MWNTIQC5Z_zCM4Gh_8-9qIItbuGwObXinpG9u2nrqmgTT4MbVfgo_xMdmrKxeuW_6gGZVtFiP1J8gNNYzjebhhLcRAgcLmmIJbEO7wyL8eecMfs=;
    passport_csrf_token=d489b5fa9e58aaeabd21460f9b7fb447; passport_csrf_token_default=d489b5fa9e58aaeabd21460f9b7fb447;
    ak_bmsc=5D576D2F153CD01F40E5027745BA0C17~000000000000000000000000000000~YAAQjdJ4aAzPQDiQAQAATOnqbhgHSDeT1aKmUuBvIDAf7Ank5Shtls/DV41MUvoGAt3Y7rc0mUz4EL8yAZOGcGXUEGSQp29Y7g4mhZUJ6Sc/xRYwGLaDBCJ7kOdUgbrYT3bluxErHuw0VlmnPQEWvjeQRCJaaBkqWKqE5jsvSHBNY9g0WtvmcCjggHnx9IIeaDyhQS10iCxW0j0UhlKbpNXhArgFB7OSBvxHnTK5Q2Ai5Duj9uX5ZR4dpoUSc4HinRXUYL1jqMDGZB54b2yxvY9YTRWuV3ZWvIPm5TToZuYQSEh1PFuqVVDZqXMR/YSizi1W0EC5yRA2IBSjBbRODBofGlzQDD/HcjCEDy0JEVE5W324ZcE3ujMhmvo6Ke+kb2bW300g3MPqZA==;
    d_ticket=a30a33f59a25fd914d7817d220ca4de81579e; multi_sids=7320239092636566570%3A71b1395b4562dc64409d82c934d72b16;
    cmpl_token=AgQQAPNSF-RO0rWoWAwrtR0T__cvnT2Qv6nZYNb5ig; bm_sv=46AB49D621D8FC08F05B408952378CC8~YAAQjdJ4aGrwQDiQAQAApEQibxj3bUZTDYl+qF7Ywm/Q32pthb3Xyy8J1BSIe4vgzcCyH18e8SQf3EvET20koKaNoqLlDYovvGbuZ85TJTV+iOCvtt0tZLyCCDDDzjz3FT++H+UUxkaTlYbew3Ab7hXM+37nWvpkzSc+l/6NEb5xQjpOx1beSKlr42rmX/RCEGCTTU5vYCV8MVk+jE9x5Ti71MYxRGK9n7jwi4lzqeibMfTMKFTgpCBv0vwQ0LLaHg==~1;
    tt_csrf_token=4lFaqd16-swyj4CaDoGDi0R91Wb158IDjSas; s_v_web_id=verify_luzl41cl_aYxk0TzJ_A7K5_4LpL_8YAl_HUWJUfDYEAZd;
    last_login_method=email; csrfToken=swsCwMT8-fl2qJEDihco0mljlBeSNgSYsy1s; tiktok_webapp_theme=light;
    tiktok_webapp_theme_auto_dark_ab=1; perf_feed_cache={%22expireTimestamp%22:1720022400000%2C%22itemIds%22:[%227386489686027537707%22%2C%227362740186813369606%22]};
    passport_fe_beating_status=false; csrf_session_id=0fe7bbbb85c9e6a0e8ec8b7a0aae55f2
...
  1. Replace the tt_chain_token property of tiktok.yaml's cookie value with the first device ID's tt_chain_token value (tt_chain_token=uiu06/A07IgETEOnRD+0Qg==):

So the cookie goes from this (old):

ttwid=1%7CAj6ILKLNPJrcFG4-U8CDZ7LRnAM6m2f5oTdv9-J1ksM%7C1718280507%7Cc9b2f10879a55435c2a8c217cf33c72a8d7aa380baca986307ca428e9fc3cfb7;
    sid_guard=71b1395b4562dc64409d82c934d72b16%7C1719851435%7C15551991%7CSat%2C+28-Dec-2024+16%3A30%3A26+GMT;
    uid_tt=714eae634cdad8bcab321abd76efcbfe63f3c14ffd9f7acc5b898f616735d5dc; uid_tt_ss=714eae634cdad8bcab321abd76efcbfe63f3c14ffd9f7acc5b898f616735d5dc;
    sid_tt=71b1395b4562dc64409d82c934d72b16; sessionid=71b1395b4562dc64409d82c934d72b16;
    sessionid_ss=71b1395b4562dc64409d82c934d72b16; sid_ucp_v1=1.0.0-KDY1NTYzNjM0MWVjODU0OGFhZmM4YjljNzlhMzQ2OGU3OWIzYmQ0MzcKGgiqiJ-cutWty2UQq7OLtAYYsws4AUDqB0gEEAQaB3VzZWFzdDUiIDcxYjEzOTViNDU2MmRjNjQ0MDlkODJjOTM0ZDcyYjE2;
    ssid_ucp_v1=1.0.0-KDY1NTYzNjM0MWVjODU0OGFhZmM4YjljNzlhMzQ2OGU3OWIzYmQ0MzcKGgiqiJ-cutWty2UQq7OLtAYYsws4AUDqB0gEEAQaB3VzZWFzdDUiIDcxYjEzOTViNDU2MmRjNjQ0MDlkODJjOTM0ZDcyYjE2;
    tt-target-idc-sign=PSDwMoI5lf0hm7ErSgLLdkJZaODPk0ZeEJIVfhK5nNBe606PhwxzCXXPfo8t1iJuaLrM65hXBsAOU49raJYrmzbSQLmSl2Qj6_UMtHDLSR8XWj3Q8KUzftAkCswO2nST5oITCcBZeefdzo4y9AQSGenL6wvRQNUhEhZWL2_33nZ-oNyiHc2LFsx_mjo9JQ7zmda9HupBkqzBVNUVkHWVS74-ouyWj3adAAJSiS7FBUNECCmbHC5c00RZ0sesp_44-PVj65d5TvsFHJHKV2cK98uMokEvHnsdpZXwi8OeXW-Uz-QZi39Fnx3wi1o4jg1KfjGZvgl6JkNSqUGXfQNQwFv4HsgtgdNOOpwG3uo26i-dNKjwCo8TQ_U9qYICmezMNk38n3GilflKpomlmLiytfn4WGk6nSD2TBisFP7zPrN9z5SoycSH6RdMupy_LL4y64zMDyzzGC-9ZIPG8gvhGXa14LKtky3qjI09-QL3uVK0bMG2j2WJkgenxJsYmnL3;
    store-idc=useast5; store-country-code=us; store-country-code-src=uid; tt-target-idc=useast5;
    tt_chain_token=5GgFovoOJm1vfJHkify6Bg==; odin_tt=652789081f5a4e6a6dd60f442363dd2778a989b57b5a6237b4c0a131066ca436;
    msToken=zECchOLDTdSkSyvJpvAThKEc-LCiinhL0vkgHl47MWNTIQC5Z_zCM4Gh_8-9qIItbuGwObXinpG9u2nrqmgTT4MbVfgo_xMdmrKxeuW_6gGZVtFiP1J8gNNYzjebhhLcRAgcLmmIJbEO7wyL8eecMfs=;
    passport_csrf_token=d489b5fa9e58aaeabd21460f9b7fb447; passport_csrf_token_default=d489b5fa9e58aaeabd21460f9b7fb447;
    ak_bmsc=5D576D2F153CD01F40E5027745BA0C17~000000000000000000000000000000~YAAQjdJ4aAzPQDiQAQAATOnqbhgHSDeT1aKmUuBvIDAf7Ank5Shtls/DV41MUvoGAt3Y7rc0mUz4EL8yAZOGcGXUEGSQp29Y7g4mhZUJ6Sc/xRYwGLaDBCJ7kOdUgbrYT3bluxErHuw0VlmnPQEWvjeQRCJaaBkqWKqE5jsvSHBNY9g0WtvmcCjggHnx9IIeaDyhQS10iCxW0j0UhlKbpNXhArgFB7OSBvxHnTK5Q2Ai5Duj9uX5ZR4dpoUSc4HinRXUYL1jqMDGZB54b2yxvY9YTRWuV3ZWvIPm5TToZuYQSEh1PFuqVVDZqXMR/YSizi1W0EC5yRA2IBSjBbRODBofGlzQDD/HcjCEDy0JEVE5W324ZcE3ujMhmvo6Ke+kb2bW300g3MPqZA==;
    d_ticket=a30a33f59a25fd914d7817d220ca4de81579e; multi_sids=7320239092636566570%3A71b1395b4562dc64409d82c934d72b16;
    cmpl_token=AgQQAPNSF-RO0rWoWAwrtR0T__cvnT2Qv6nZYNb5ig; bm_sv=46AB49D621D8FC08F05B408952378CC8~YAAQjdJ4aGrwQDiQAQAApEQibxj3bUZTDYl+qF7Ywm/Q32pthb3Xyy8J1BSIe4vgzcCyH18e8SQf3EvET20koKaNoqLlDYovvGbuZ85TJTV+iOCvtt0tZLyCCDDDzjz3FT++H+UUxkaTlYbew3Ab7hXM+37nWvpkzSc+l/6NEb5xQjpOx1beSKlr42rmX/RCEGCTTU5vYCV8MVk+jE9x5Ti71MYxRGK9n7jwi4lzqeibMfTMKFTgpCBv0vwQ0LLaHg==~1;
    tt_csrf_token=4lFaqd16-swyj4CaDoGDi0R91Wb158IDjSas; s_v_web_id=verify_luzl41cl_aYxk0TzJ_A7K5_4LpL_8YAl_HUWJUfDYEAZd;
    last_login_method=email; csrfToken=swsCwMT8-fl2qJEDihco0mljlBeSNgSYsy1s; tiktok_webapp_theme=light;
    tiktok_webapp_theme_auto_dark_ab=1; perf_feed_cache={%22expireTimestamp%22:1720022400000%2C%22itemIds%22:[%227386489686027537707%22%2C%227362740186813369606%22]};
    passport_fe_beating_status=false; csrf_session_id=0fe7bbbb85c9e6a0e8ec8b7a0aae55f2

to this (new):

ttwid=1%7CAj6ILKLNPJrcFG4-U8CDZ7LRnAM6m2f5oTdv9-J1ksM%7C1718280507%7Cc9b2f10879a55435c2a8c217cf33c72a8d7aa380baca986307ca428e9fc3cfb7;
    sid_guard=71b1395b4562dc64409d82c934d72b16%7C1719851435%7C15551991%7CSat%2C+28-Dec-2024+16%3A30%3A26+GMT;
    uid_tt=714eae634cdad8bcab321abd76efcbfe63f3c14ffd9f7acc5b898f616735d5dc; uid_tt_ss=714eae634cdad8bcab321abd76efcbfe63f3c14ffd9f7acc5b898f616735d5dc;
    sid_tt=71b1395b4562dc64409d82c934d72b16; sessionid=71b1395b4562dc64409d82c934d72b16;
    sessionid_ss=71b1395b4562dc64409d82c934d72b16; sid_ucp_v1=1.0.0-KDY1NTYzNjM0MWVjODU0OGFhZmM4YjljNzlhMzQ2OGU3OWIzYmQ0MzcKGgiqiJ-cutWty2UQq7OLtAYYsws4AUDqB0gEEAQaB3VzZWFzdDUiIDcxYjEzOTViNDU2MmRjNjQ0MDlkODJjOTM0ZDcyYjE2;
    ssid_ucp_v1=1.0.0-KDY1NTYzNjM0MWVjODU0OGFhZmM4YjljNzlhMzQ2OGU3OWIzYmQ0MzcKGgiqiJ-cutWty2UQq7OLtAYYsws4AUDqB0gEEAQaB3VzZWFzdDUiIDcxYjEzOTViNDU2MmRjNjQ0MDlkODJjOTM0ZDcyYjE2;
    tt-target-idc-sign=PSDwMoI5lf0hm7ErSgLLdkJZaODPk0ZeEJIVfhK5nNBe606PhwxzCXXPfo8t1iJuaLrM65hXBsAOU49raJYrmzbSQLmSl2Qj6_UMtHDLSR8XWj3Q8KUzftAkCswO2nST5oITCcBZeefdzo4y9AQSGenL6wvRQNUhEhZWL2_33nZ-oNyiHc2LFsx_mjo9JQ7zmda9HupBkqzBVNUVkHWVS74-ouyWj3adAAJSiS7FBUNECCmbHC5c00RZ0sesp_44-PVj65d5TvsFHJHKV2cK98uMokEvHnsdpZXwi8OeXW-Uz-QZi39Fnx3wi1o4jg1KfjGZvgl6JkNSqUGXfQNQwFv4HsgtgdNOOpwG3uo26i-dNKjwCo8TQ_U9qYICmezMNk38n3GilflKpomlmLiytfn4WGk6nSD2TBisFP7zPrN9z5SoycSH6RdMupy_LL4y64zMDyzzGC-9ZIPG8gvhGXa14LKtky3qjI09-QL3uVK0bMG2j2WJkgenxJsYmnL3;
    store-idc=useast5; store-country-code=us; store-country-code-src=uid; tt-target-idc=useast5;
    tt_chain_token=uiu06/A07IgETEOnRD+0Qg==; odin_tt=652789081f5a4e6a6dd60f442363dd2778a989b57b5a6237b4c0a131066ca436;
    msToken=zECchOLDTdSkSyvJpvAThKEc-LCiinhL0vkgHl47MWNTIQC5Z_zCM4Gh_8-9qIItbuGwObXinpG9u2nrqmgTT4MbVfgo_xMdmrKxeuW_6gGZVtFiP1J8gNNYzjebhhLcRAgcLmmIJbEO7wyL8eecMfs=;
    passport_csrf_token=d489b5fa9e58aaeabd21460f9b7fb447; passport_csrf_token_default=d489b5fa9e58aaeabd21460f9b7fb447;
    ak_bmsc=5D576D2F153CD01F40E5027745BA0C17~000000000000000000000000000000~YAAQjdJ4aAzPQDiQAQAATOnqbhgHSDeT1aKmUuBvIDAf7Ank5Shtls/DV41MUvoGAt3Y7rc0mUz4EL8yAZOGcGXUEGSQp29Y7g4mhZUJ6Sc/xRYwGLaDBCJ7kOdUgbrYT3bluxErHuw0VlmnPQEWvjeQRCJaaBkqWKqE5jsvSHBNY9g0WtvmcCjggHnx9IIeaDyhQS10iCxW0j0UhlKbpNXhArgFB7OSBvxHnTK5Q2Ai5Duj9uX5ZR4dpoUSc4HinRXUYL1jqMDGZB54b2yxvY9YTRWuV3ZWvIPm5TToZuYQSEh1PFuqVVDZqXMR/YSizi1W0EC5yRA2IBSjBbRODBofGlzQDD/HcjCEDy0JEVE5W324ZcE3ujMhmvo6Ke+kb2bW300g3MPqZA==;
    d_ticket=a30a33f59a25fd914d7817d220ca4de81579e; multi_sids=7320239092636566570%3A71b1395b4562dc64409d82c934d72b16;
    cmpl_token=AgQQAPNSF-RO0rWoWAwrtR0T__cvnT2Qv6nZYNb5ig; bm_sv=46AB49D621D8FC08F05B408952378CC8~YAAQjdJ4aGrwQDiQAQAApEQibxj3bUZTDYl+qF7Ywm/Q32pthb3Xyy8J1BSIe4vgzcCyH18e8SQf3EvET20koKaNoqLlDYovvGbuZ85TJTV+iOCvtt0tZLyCCDDDzjz3FT++H+UUxkaTlYbew3Ab7hXM+37nWvpkzSc+l/6NEb5xQjpOx1beSKlr42rmX/RCEGCTTU5vYCV8MVk+jE9x5Ti71MYxRGK9n7jwi4lzqeibMfTMKFTgpCBv0vwQ0LLaHg==~1;
    tt_csrf_token=4lFaqd16-swyj4CaDoGDi0R91Wb158IDjSas; s_v_web_id=verify_luzl41cl_aYxk0TzJ_A7K5_4LpL_8YAl_HUWJUfDYEAZd;
    last_login_method=email; csrfToken=swsCwMT8-fl2qJEDihco0mljlBeSNgSYsy1s; tiktok_webapp_theme=light;
    tiktok_webapp_theme_auto_dark_ab=1; perf_feed_cache={%22expireTimestamp%22:1720022400000%2C%22itemIds%22:[%227386489686027537707%22%2C%227362740186813369606%22]};
    passport_fe_beating_status=false; csrf_session_id=0fe7bbbb85c9e6a0e8ec8b7a0aae55f2
  1. Run f2 tk -l en_US -c tiktok.yaml`:
ERROR    HTTP状态错误, 尝试GET请求失败:                                                                                                                                   
         https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/o04tRbN5mIPJEYDesBbFJ1BEEXDQdFAU0Qf9Nl/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=
         3&dr=0&lr=unwatermarked&cd=0%7C0%7C0%7C&cv=1&br=2166&bt=1083&cs=0&ds=6&ft=4KJMyMzm8Zmo0wXRp-4jV5yZdpWrKsd.&mime_type=video_mp4&qs=0&rc=OmRoNzw2OWRkMzw6ZTc2OUBpan
         J3c3g5cnd1czMzZjczM0BiLi8tXmNjNV8xMzI1MjMuYSMzNl5iMmQ0LWpgLS1kMWNzcw%3D%3D&btag=e00090000&expire=1719873149&l=20240701163119E507B8AC60A91F056546&ply_type=2&polic
         y=2&signature=70d5f1061fd42ce92c8bb8fb9b5294a7&tk=tt_chain_token, 错误详情: Client error '403 Forbidden' for url                                                 
         'https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/o04tRbN5mIPJEYDesBbFJ1BEEXDQdFAU0Qf9Nl/?a=1988&bti=ODszNWYuMDE6&ch=0&cr
         =3&dr=0&lr=unwatermarked&cd=0%7C0%7C0%7C&cv=1&br=2166&bt=1083&cs=0&ds=6&ft=4KJMyMzm8Zmo0wXRp-4jV5yZdpWrKsd.&mime_type=video_mp4&qs=0&rc=OmRoNzw2OWRkMzw6ZTc2OUBpa
         nJ3c3g5cnd1czMzZjczM0BiLi8tXmNjNV8xMzI1MjMuYSMzNl5iMmQ0LWpgLS1kMWNzcw%3D%3D&btag=e00090000&expire=1719873149&l=20240701163119E507B8AC60A91F056546&ply_type=2&poli
         cy=2&signature=70d5f1061fd42ce92c8bb8fb9b5294a7&tk=tt_chain_token'                                                                                               
         For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403                                                                         
ERROR    Traceback (most recent call last):                                                                                                                               
           File "/Users/user/.pyenv/versions/3.11.1/lib/python3.11/site-packages/f2/utils/_dl.py", line 42, in get_content_length                            
             response.raise_for_status()                                                                                                                                  
           File "/Users/user/.pyenv/versions/3.11.1/lib/python3.11/site-packages/httpx/_models.py", line 761, in raise_for_status                            
             raise HTTPStatusError(message, request=request, response=self)                                                                                               
         httpx.HTTPStatusError: Client error '403 Forbidden' for url                                                                                                      
         'https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068-euttp/osnAPdLAtjUBNU89QBNIpevMCyhi8ZizoIAEEA/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=3&d
         r=0&lr=unwatermarked&cd=0%7C0%7C0%7C&cv=1&br=3334&bt=1667&cs=0&ds=6&ft=4KJMyMzm8Zmo0wXRp-4jV5yZdpWrKsd.&mime_type=video_mp4&qs=0&rc=OTg5ZDo8ZzdkZWY4ZGVlOUBpM2xqN
         XY5cng5czMzZjczM0BgNS4wMF9jNV4xX181L2JeYSMtNm5eMmRrYHJgLS1kMWNzcw%3D%3D&btag=e00088000&expire=1719873085&l=20240701163119E507B8AC60A91F056546&ply_type=2&policy=2
         &signature=417bca254775c20e30fd949a57f5a690&tk=tt_chain_token'                                                                                                   
         For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403                                                                         
                                                                                                                                                                          
         During handling of the above exception, another exception occurred:                                                                                              
                                                                                                                                                                          
         Traceback (most recent call last):                                                                                                                               
           File "/Users/user/.pyenv/versions/3.11.1/lib/python3.11/site-packages/f2/utils/_dl.py", line 73, in get_content_length                            
             response.raise_for_status()                                                                                                                                  
           File "/Users/user/.pyenv/versions/3.11.1/lib/python3.11/site-packages/httpx/_models.py", line 761, in raise_for_status                            
             raise HTTPStatusError(message, request=request, response=self)                                                                                               
         httpx.HTTPStatusError: Client error '403 Forbidden' for url                                                                                                      
         'https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068-euttp/osnAPdLAtjUBNU89QBNIpevMCyhi8ZizoIAEEA/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=3&d
         r=0&lr=unwatermarked&cd=0%7C0%7C0%7C&cv=1&br=3334&bt=1667&cs=0&ds=6&ft=4KJMyMzm8Zmo0wXRp-4jV5yZdpWrKsd.&mime_type=video_mp4&qs=0&rc=OTg5ZDo8ZzdkZWY4ZGVlOUBpM2xqN
         XY5cng5czMzZjczM0BgNS4wMF9jNV4xX181L2JeYSMtNm5eMmRrYHJgLS1kMWNzcw%3D%3D&btag=e00088000&expire=1719873085&l=20240701163119E507B8AC60A91F056546&ply_type=2&policy=2
         &signature=417bca254775c20e30fd949a57f5a690&tk=tt_chain_token'                                                                                                   
         For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403 

So what's interesting is that the following URL doesn't have the tt_chain_token value in the URL. I'm wondering if that's related to why this isn't working:

'https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068-euttp/osnAPdLAtjUBNU89QBNIpevMCyhi8ZizoIAEEA/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=3&d
         r=0&lr=unwatermarked&cd=0%7C0%7C0%7C&cv=1&br=3334&bt=1667&cs=0&ds=6&ft=4KJMyMzm8Zmo0wXRp-4jV5yZdpWrKsd.&mime_type=video_mp4&qs=0&rc=OTg5ZDo8ZzdkZWY4ZGVlOUBpM2xqN
         XY5cng5czMzZjczM0BgNS4wMF9jNV4xX181L2JeYSMtNm5eMmRrYHJgLS1kMWNzcw%3D%3D&btag=e00088000&expire=1719873085&l=20240701163119E507B8AC60A91F056546&ply_type=2&policy=2
         &signature=417bca254775c20e30fd949a57f5a690&tk=tt_chain_token' 

It's a total shot in the dark though. Perhaps the cookies shouldn't be encoded? I noticed that there are % signs in the cookie, but decoding doesn't solve it either, hah.

As a last resort, would it be of any use to share your my.yaml, app.yaml, and conf.yaml files? I could try comparing and see if I'm missing a key value!

@Johnserf-Seed
Copy link
Owner

Johnserf-Seed commented Jul 1, 2024

Ah, I realize now I never linked the comment in question! So here, towards the bottom, the path property of the tiktok.yaml has my actual path instead of a fake one! The cookies being there is fine, it's the path that I'm hoping you could erase instead! Sorry for the lack of clarity! 😅

And I thank you as well for bearing with me! So I went ahead and did exactly as you said, but it still doesn't seem to work. However! One thing I noticed in the error messages is that the tt_chain_token value isn't included in the URLs. Is that normal? I'll still lay out the steps I tried to be clear!

  1. Run python3 get_tiktok_device_id.py:
python3 get_tiktok_device_id.py 
{'deviceId': '7386706068162463274', 'cookie': 'tt_chain_token=uiu06/A07IgETEOnRD+0Qg==;bm_sv=512A28D4D703A7FF3052F2CD65B4E8CB~YAAQ7rUuFz83+muQAQAAf9ojbxgEUKPW9jj+mnHaUko3tF1yoE7qspqG6gMYgs/RMB84miFM26MVC+q+xXc1iMeocuBmceHU4AawBFfVAr57l8US02GeaAm5S+9vKyMjRkA/USblR6yYW5uU2ZZa6sejlwub1VrJSFGsxbNjkjLeuUsPLqtaIWI5Wsx1rhlSse62RsyWX/4TWm6sUh3MXXrWeUxJd/YdZa6dn0w7UzZr/2d9URfPsymeeu5J4Try~1'}
{'deviceId': '7386706072000349738', 'cookie': 'ttwid=1%7CUrf7XsWNo16gqNcJcjW2_5DpzTE7GYm8LsSRGyKpeBQ%7C1719851539%7C2c8e1018096b4d7aa1a77af47a5e8f6e55f1a7ff106492f3fbbf745b5fda0838;tt_csrf_token=eBJpXXe3-84EY2ao3NQ5UnDej4mkqgRXb88g;tt_chain_token=EhGIMEq8JpFWE31p3hk1Bw==;ak_bmsc=589B627FC455D1B77193F3DEA62394AA~000000000000000000000000000000~YAAQ7rUuF0M3+muQAQAAd9wjbxhVAFSkhNc2ldeIJV9XKZwWsCUFS16NKqu3q9rpzXvzYPJir61lzca7IHncG3VPpL5gSddk6dg9ykyw2QWlXXCPNpa651qZME3YJXO9c1Du1xCk5sA0eQ6QBH8N6bJQ21GLDtHWn4joaJpivGyZlsOBFHFjjoCkAYQhYAWZql9UVi5gWk786yXSu/0QONnult/mWc2EOBhQRFS88xPVdXIvgX9Hgx3YeNEPJaemThGtcnRWRU9s5vioWnacliIpksPpxKe8EZ7pwc0wKbO4jUMnK0WJqBUW826+BXB1fQoljE63/NZrfV5R8vJkMYc7Tlbs1XvLdxFkzY3ZDdx1JaLiLZKIWiCDzSRV'}
  1. Take the first device ID and paste it into conf.yaml:
...
tiktok:

    BaseRequestModel:
      browser:
        language: zh-CN
        name: Mozilla
        platform: Win32
        version: 5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36

      device:
        id: "7386706068162463274"
        platform: web_pc
...

I've verified that the device ID is read from correctly with the printing suggestion you made as well!:

@classmethod
    def brm_device(cls) -> dict:
        print('HEYYYY', cls.base_request_model().get("device", {}))
        return cls.base_request_model().get("device", {})
f2 tk -l en_US -c tiktok.yaml
WARNING  您当前使用的版本 0.0.1.6 可能已过时,请考虑及时升级到最新版本 0.0.1.6,请使用 pip install -U f2 更新                                                             
INFO     应用:tiktok                                                                                                                                                     
INFO     Mode: post                                                                                                                                                       
INFO     Main configuration path: /Users/user/.pyenv/versions/3.11.1/lib/python3.11/site-packages/f2/conf/app.yaml                                           
INFO     Custom configuration path: /Users/user/Desktop/SAUCE/AUTOMATED TIKTOK DOWNLOADING/tiktok.yaml                                                       
HEYYYY {'id': '7386706068162463274', 'platform': 'web_pc'}
HEYYYY {'id': '7386706068162463274', 'platform': 'web_pc'}
  1. Run f2 tk --auto-cookie firefox and copy the cookie value from app.yaml into tiktok.yaml:

tiktok.yaml:

tiktok:
  odin_tt:
    url: https://www.tiktok.com/passport/web/account/info/?WebIdLastTime=1716637053&aid=1459&app_language=zh-Hans&app_name=tiktok_web&browser_language=zh-CN&browser_name=Mozilla&browser_online=true&browser_platform=Win32&browser_version=5.0%20%28Windows%20NT%2010.0%3B%20Win64%3B%20x64%29%20AppleWebKit%2F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F124.0.0.0%20Safari%2F537.36&channel=tiktok_web&cookie_enabled=true&device_id=7372899909097571857&device_platform=web_pc&focus_state=true&from_page=fyp&history_len=2&is_fullscreen=false&is_page_visible=true&odinId=7372898697492972561&os=windows&priority_region=&referer=&region=SG&screen_height=1080&screen_width=1920&tz_name=Asia%2FHong_Kong&webcast_language=zh-Hans
  User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML,
    like Gecko) Chrome/125.0.0.0 Safari/537.36
  cookie: ttwid=1%7CAj6ILKLNPJrcFG4-U8CDZ7LRnAM6m2f5oTdv9-J1ksM%7C1718280507%7Cc9b2f10879a55435c2a8c217cf33c72a8d7aa380baca986307ca428e9fc3cfb7;
    sid_guard=71b1395b4562dc64409d82c934d72b16%7C1719851435%7C15551991%7CSat%2C+28-Dec-2024+16%3A30%3A26+GMT;
    uid_tt=714eae634cdad8bcab321abd76efcbfe63f3c14ffd9f7acc5b898f616735d5dc; uid_tt_ss=714eae634cdad8bcab321abd76efcbfe63f3c14ffd9f7acc5b898f616735d5dc;
    sid_tt=71b1395b4562dc64409d82c934d72b16; sessionid=71b1395b4562dc64409d82c934d72b16;
    sessionid_ss=71b1395b4562dc64409d82c934d72b16; sid_ucp_v1=1.0.0-KDY1NTYzNjM0MWVjODU0OGFhZmM4YjljNzlhMzQ2OGU3OWIzYmQ0MzcKGgiqiJ-cutWty2UQq7OLtAYYsws4AUDqB0gEEAQaB3VzZWFzdDUiIDcxYjEzOTViNDU2MmRjNjQ0MDlkODJjOTM0ZDcyYjE2;
    ssid_ucp_v1=1.0.0-KDY1NTYzNjM0MWVjODU0OGFhZmM4YjljNzlhMzQ2OGU3OWIzYmQ0MzcKGgiqiJ-cutWty2UQq7OLtAYYsws4AUDqB0gEEAQaB3VzZWFzdDUiIDcxYjEzOTViNDU2MmRjNjQ0MDlkODJjOTM0ZDcyYjE2;
    tt-target-idc-sign=PSDwMoI5lf0hm7ErSgLLdkJZaODPk0ZeEJIVfhK5nNBe606PhwxzCXXPfo8t1iJuaLrM65hXBsAOU49raJYrmzbSQLmSl2Qj6_UMtHDLSR8XWj3Q8KUzftAkCswO2nST5oITCcBZeefdzo4y9AQSGenL6wvRQNUhEhZWL2_33nZ-oNyiHc2LFsx_mjo9JQ7zmda9HupBkqzBVNUVkHWVS74-ouyWj3adAAJSiS7FBUNECCmbHC5c00RZ0sesp_44-PVj65d5TvsFHJHKV2cK98uMokEvHnsdpZXwi8OeXW-Uz-QZi39Fnx3wi1o4jg1KfjGZvgl6JkNSqUGXfQNQwFv4HsgtgdNOOpwG3uo26i-dNKjwCo8TQ_U9qYICmezMNk38n3GilflKpomlmLiytfn4WGk6nSD2TBisFP7zPrN9z5SoycSH6RdMupy_LL4y64zMDyzzGC-9ZIPG8gvhGXa14LKtky3qjI09-QL3uVK0bMG2j2WJkgenxJsYmnL3;
    store-idc=useast5; store-country-code=us; store-country-code-src=uid; tt-target-idc=useast5;
    tt_chain_token=5GgFovoOJm1vfJHkify6Bg==; odin_tt=652789081f5a4e6a6dd60f442363dd2778a989b57b5a6237b4c0a131066ca436;
    msToken=zECchOLDTdSkSyvJpvAThKEc-LCiinhL0vkgHl47MWNTIQC5Z_zCM4Gh_8-9qIItbuGwObXinpG9u2nrqmgTT4MbVfgo_xMdmrKxeuW_6gGZVtFiP1J8gNNYzjebhhLcRAgcLmmIJbEO7wyL8eecMfs=;
    passport_csrf_token=d489b5fa9e58aaeabd21460f9b7fb447; passport_csrf_token_default=d489b5fa9e58aaeabd21460f9b7fb447;
    ak_bmsc=5D576D2F153CD01F40E5027745BA0C17~000000000000000000000000000000~YAAQjdJ4aAzPQDiQAQAATOnqbhgHSDeT1aKmUuBvIDAf7Ank5Shtls/DV41MUvoGAt3Y7rc0mUz4EL8yAZOGcGXUEGSQp29Y7g4mhZUJ6Sc/xRYwGLaDBCJ7kOdUgbrYT3bluxErHuw0VlmnPQEWvjeQRCJaaBkqWKqE5jsvSHBNY9g0WtvmcCjggHnx9IIeaDyhQS10iCxW0j0UhlKbpNXhArgFB7OSBvxHnTK5Q2Ai5Duj9uX5ZR4dpoUSc4HinRXUYL1jqMDGZB54b2yxvY9YTRWuV3ZWvIPm5TToZuYQSEh1PFuqVVDZqXMR/YSizi1W0EC5yRA2IBSjBbRODBofGlzQDD/HcjCEDy0JEVE5W324ZcE3ujMhmvo6Ke+kb2bW300g3MPqZA==;
    d_ticket=a30a33f59a25fd914d7817d220ca4de81579e; multi_sids=7320239092636566570%3A71b1395b4562dc64409d82c934d72b16;
    cmpl_token=AgQQAPNSF-RO0rWoWAwrtR0T__cvnT2Qv6nZYNb5ig; bm_sv=46AB49D621D8FC08F05B408952378CC8~YAAQjdJ4aGrwQDiQAQAApEQibxj3bUZTDYl+qF7Ywm/Q32pthb3Xyy8J1BSIe4vgzcCyH18e8SQf3EvET20koKaNoqLlDYovvGbuZ85TJTV+iOCvtt0tZLyCCDDDzjz3FT++H+UUxkaTlYbew3Ab7hXM+37nWvpkzSc+l/6NEb5xQjpOx1beSKlr42rmX/RCEGCTTU5vYCV8MVk+jE9x5Ti71MYxRGK9n7jwi4lzqeibMfTMKFTgpCBv0vwQ0LLaHg==~1;
    tt_csrf_token=4lFaqd16-swyj4CaDoGDi0R91Wb158IDjSas; s_v_web_id=verify_luzl41cl_aYxk0TzJ_A7K5_4LpL_8YAl_HUWJUfDYEAZd;
    last_login_method=email; csrfToken=swsCwMT8-fl2qJEDihco0mljlBeSNgSYsy1s; tiktok_webapp_theme=light;
    tiktok_webapp_theme_auto_dark_ab=1; perf_feed_cache={%22expireTimestamp%22:1720022400000%2C%22itemIds%22:[%227386489686027537707%22%2C%227362740186813369606%22]};
    passport_fe_beating_status=false; csrf_session_id=0fe7bbbb85c9e6a0e8ec8b7a0aae55f2
...
  1. Replace the tt_chain_token property of tiktok.yaml's cookie value with the first device ID's tt_chain_token value (tt_chain_token=uiu06/A07IgETEOnRD+0Qg==):

So the cookie goes from this (old):

ttwid=1%7CAj6ILKLNPJrcFG4-U8CDZ7LRnAM6m2f5oTdv9-J1ksM%7C1718280507%7Cc9b2f10879a55435c2a8c217cf33c72a8d7aa380baca986307ca428e9fc3cfb7;
    sid_guard=71b1395b4562dc64409d82c934d72b16%7C1719851435%7C15551991%7CSat%2C+28-Dec-2024+16%3A30%3A26+GMT;
    uid_tt=714eae634cdad8bcab321abd76efcbfe63f3c14ffd9f7acc5b898f616735d5dc; uid_tt_ss=714eae634cdad8bcab321abd76efcbfe63f3c14ffd9f7acc5b898f616735d5dc;
    sid_tt=71b1395b4562dc64409d82c934d72b16; sessionid=71b1395b4562dc64409d82c934d72b16;
    sessionid_ss=71b1395b4562dc64409d82c934d72b16; sid_ucp_v1=1.0.0-KDY1NTYzNjM0MWVjODU0OGFhZmM4YjljNzlhMzQ2OGU3OWIzYmQ0MzcKGgiqiJ-cutWty2UQq7OLtAYYsws4AUDqB0gEEAQaB3VzZWFzdDUiIDcxYjEzOTViNDU2MmRjNjQ0MDlkODJjOTM0ZDcyYjE2;
    ssid_ucp_v1=1.0.0-KDY1NTYzNjM0MWVjODU0OGFhZmM4YjljNzlhMzQ2OGU3OWIzYmQ0MzcKGgiqiJ-cutWty2UQq7OLtAYYsws4AUDqB0gEEAQaB3VzZWFzdDUiIDcxYjEzOTViNDU2MmRjNjQ0MDlkODJjOTM0ZDcyYjE2;
    tt-target-idc-sign=PSDwMoI5lf0hm7ErSgLLdkJZaODPk0ZeEJIVfhK5nNBe606PhwxzCXXPfo8t1iJuaLrM65hXBsAOU49raJYrmzbSQLmSl2Qj6_UMtHDLSR8XWj3Q8KUzftAkCswO2nST5oITCcBZeefdzo4y9AQSGenL6wvRQNUhEhZWL2_33nZ-oNyiHc2LFsx_mjo9JQ7zmda9HupBkqzBVNUVkHWVS74-ouyWj3adAAJSiS7FBUNECCmbHC5c00RZ0sesp_44-PVj65d5TvsFHJHKV2cK98uMokEvHnsdpZXwi8OeXW-Uz-QZi39Fnx3wi1o4jg1KfjGZvgl6JkNSqUGXfQNQwFv4HsgtgdNOOpwG3uo26i-dNKjwCo8TQ_U9qYICmezMNk38n3GilflKpomlmLiytfn4WGk6nSD2TBisFP7zPrN9z5SoycSH6RdMupy_LL4y64zMDyzzGC-9ZIPG8gvhGXa14LKtky3qjI09-QL3uVK0bMG2j2WJkgenxJsYmnL3;
    store-idc=useast5; store-country-code=us; store-country-code-src=uid; tt-target-idc=useast5;
    tt_chain_token=5GgFovoOJm1vfJHkify6Bg==; odin_tt=652789081f5a4e6a6dd60f442363dd2778a989b57b5a6237b4c0a131066ca436;
    msToken=zECchOLDTdSkSyvJpvAThKEc-LCiinhL0vkgHl47MWNTIQC5Z_zCM4Gh_8-9qIItbuGwObXinpG9u2nrqmgTT4MbVfgo_xMdmrKxeuW_6gGZVtFiP1J8gNNYzjebhhLcRAgcLmmIJbEO7wyL8eecMfs=;
    passport_csrf_token=d489b5fa9e58aaeabd21460f9b7fb447; passport_csrf_token_default=d489b5fa9e58aaeabd21460f9b7fb447;
    ak_bmsc=5D576D2F153CD01F40E5027745BA0C17~000000000000000000000000000000~YAAQjdJ4aAzPQDiQAQAATOnqbhgHSDeT1aKmUuBvIDAf7Ank5Shtls/DV41MUvoGAt3Y7rc0mUz4EL8yAZOGcGXUEGSQp29Y7g4mhZUJ6Sc/xRYwGLaDBCJ7kOdUgbrYT3bluxErHuw0VlmnPQEWvjeQRCJaaBkqWKqE5jsvSHBNY9g0WtvmcCjggHnx9IIeaDyhQS10iCxW0j0UhlKbpNXhArgFB7OSBvxHnTK5Q2Ai5Duj9uX5ZR4dpoUSc4HinRXUYL1jqMDGZB54b2yxvY9YTRWuV3ZWvIPm5TToZuYQSEh1PFuqVVDZqXMR/YSizi1W0EC5yRA2IBSjBbRODBofGlzQDD/HcjCEDy0JEVE5W324ZcE3ujMhmvo6Ke+kb2bW300g3MPqZA==;
    d_ticket=a30a33f59a25fd914d7817d220ca4de81579e; multi_sids=7320239092636566570%3A71b1395b4562dc64409d82c934d72b16;
    cmpl_token=AgQQAPNSF-RO0rWoWAwrtR0T__cvnT2Qv6nZYNb5ig; bm_sv=46AB49D621D8FC08F05B408952378CC8~YAAQjdJ4aGrwQDiQAQAApEQibxj3bUZTDYl+qF7Ywm/Q32pthb3Xyy8J1BSIe4vgzcCyH18e8SQf3EvET20koKaNoqLlDYovvGbuZ85TJTV+iOCvtt0tZLyCCDDDzjz3FT++H+UUxkaTlYbew3Ab7hXM+37nWvpkzSc+l/6NEb5xQjpOx1beSKlr42rmX/RCEGCTTU5vYCV8MVk+jE9x5Ti71MYxRGK9n7jwi4lzqeibMfTMKFTgpCBv0vwQ0LLaHg==~1;
    tt_csrf_token=4lFaqd16-swyj4CaDoGDi0R91Wb158IDjSas; s_v_web_id=verify_luzl41cl_aYxk0TzJ_A7K5_4LpL_8YAl_HUWJUfDYEAZd;
    last_login_method=email; csrfToken=swsCwMT8-fl2qJEDihco0mljlBeSNgSYsy1s; tiktok_webapp_theme=light;
    tiktok_webapp_theme_auto_dark_ab=1; perf_feed_cache={%22expireTimestamp%22:1720022400000%2C%22itemIds%22:[%227386489686027537707%22%2C%227362740186813369606%22]};
    passport_fe_beating_status=false; csrf_session_id=0fe7bbbb85c9e6a0e8ec8b7a0aae55f2

to this (new):

ttwid=1%7CAj6ILKLNPJrcFG4-U8CDZ7LRnAM6m2f5oTdv9-J1ksM%7C1718280507%7Cc9b2f10879a55435c2a8c217cf33c72a8d7aa380baca986307ca428e9fc3cfb7;
    sid_guard=71b1395b4562dc64409d82c934d72b16%7C1719851435%7C15551991%7CSat%2C+28-Dec-2024+16%3A30%3A26+GMT;
    uid_tt=714eae634cdad8bcab321abd76efcbfe63f3c14ffd9f7acc5b898f616735d5dc; uid_tt_ss=714eae634cdad8bcab321abd76efcbfe63f3c14ffd9f7acc5b898f616735d5dc;
    sid_tt=71b1395b4562dc64409d82c934d72b16; sessionid=71b1395b4562dc64409d82c934d72b16;
    sessionid_ss=71b1395b4562dc64409d82c934d72b16; sid_ucp_v1=1.0.0-KDY1NTYzNjM0MWVjODU0OGFhZmM4YjljNzlhMzQ2OGU3OWIzYmQ0MzcKGgiqiJ-cutWty2UQq7OLtAYYsws4AUDqB0gEEAQaB3VzZWFzdDUiIDcxYjEzOTViNDU2MmRjNjQ0MDlkODJjOTM0ZDcyYjE2;
    ssid_ucp_v1=1.0.0-KDY1NTYzNjM0MWVjODU0OGFhZmM4YjljNzlhMzQ2OGU3OWIzYmQ0MzcKGgiqiJ-cutWty2UQq7OLtAYYsws4AUDqB0gEEAQaB3VzZWFzdDUiIDcxYjEzOTViNDU2MmRjNjQ0MDlkODJjOTM0ZDcyYjE2;
    tt-target-idc-sign=PSDwMoI5lf0hm7ErSgLLdkJZaODPk0ZeEJIVfhK5nNBe606PhwxzCXXPfo8t1iJuaLrM65hXBsAOU49raJYrmzbSQLmSl2Qj6_UMtHDLSR8XWj3Q8KUzftAkCswO2nST5oITCcBZeefdzo4y9AQSGenL6wvRQNUhEhZWL2_33nZ-oNyiHc2LFsx_mjo9JQ7zmda9HupBkqzBVNUVkHWVS74-ouyWj3adAAJSiS7FBUNECCmbHC5c00RZ0sesp_44-PVj65d5TvsFHJHKV2cK98uMokEvHnsdpZXwi8OeXW-Uz-QZi39Fnx3wi1o4jg1KfjGZvgl6JkNSqUGXfQNQwFv4HsgtgdNOOpwG3uo26i-dNKjwCo8TQ_U9qYICmezMNk38n3GilflKpomlmLiytfn4WGk6nSD2TBisFP7zPrN9z5SoycSH6RdMupy_LL4y64zMDyzzGC-9ZIPG8gvhGXa14LKtky3qjI09-QL3uVK0bMG2j2WJkgenxJsYmnL3;
    store-idc=useast5; store-country-code=us; store-country-code-src=uid; tt-target-idc=useast5;
    tt_chain_token=uiu06/A07IgETEOnRD+0Qg==; odin_tt=652789081f5a4e6a6dd60f442363dd2778a989b57b5a6237b4c0a131066ca436;
    msToken=zECchOLDTdSkSyvJpvAThKEc-LCiinhL0vkgHl47MWNTIQC5Z_zCM4Gh_8-9qIItbuGwObXinpG9u2nrqmgTT4MbVfgo_xMdmrKxeuW_6gGZVtFiP1J8gNNYzjebhhLcRAgcLmmIJbEO7wyL8eecMfs=;
    passport_csrf_token=d489b5fa9e58aaeabd21460f9b7fb447; passport_csrf_token_default=d489b5fa9e58aaeabd21460f9b7fb447;
    ak_bmsc=5D576D2F153CD01F40E5027745BA0C17~000000000000000000000000000000~YAAQjdJ4aAzPQDiQAQAATOnqbhgHSDeT1aKmUuBvIDAf7Ank5Shtls/DV41MUvoGAt3Y7rc0mUz4EL8yAZOGcGXUEGSQp29Y7g4mhZUJ6Sc/xRYwGLaDBCJ7kOdUgbrYT3bluxErHuw0VlmnPQEWvjeQRCJaaBkqWKqE5jsvSHBNY9g0WtvmcCjggHnx9IIeaDyhQS10iCxW0j0UhlKbpNXhArgFB7OSBvxHnTK5Q2Ai5Duj9uX5ZR4dpoUSc4HinRXUYL1jqMDGZB54b2yxvY9YTRWuV3ZWvIPm5TToZuYQSEh1PFuqVVDZqXMR/YSizi1W0EC5yRA2IBSjBbRODBofGlzQDD/HcjCEDy0JEVE5W324ZcE3ujMhmvo6Ke+kb2bW300g3MPqZA==;
    d_ticket=a30a33f59a25fd914d7817d220ca4de81579e; multi_sids=7320239092636566570%3A71b1395b4562dc64409d82c934d72b16;
    cmpl_token=AgQQAPNSF-RO0rWoWAwrtR0T__cvnT2Qv6nZYNb5ig; bm_sv=46AB49D621D8FC08F05B408952378CC8~YAAQjdJ4aGrwQDiQAQAApEQibxj3bUZTDYl+qF7Ywm/Q32pthb3Xyy8J1BSIe4vgzcCyH18e8SQf3EvET20koKaNoqLlDYovvGbuZ85TJTV+iOCvtt0tZLyCCDDDzjz3FT++H+UUxkaTlYbew3Ab7hXM+37nWvpkzSc+l/6NEb5xQjpOx1beSKlr42rmX/RCEGCTTU5vYCV8MVk+jE9x5Ti71MYxRGK9n7jwi4lzqeibMfTMKFTgpCBv0vwQ0LLaHg==~1;
    tt_csrf_token=4lFaqd16-swyj4CaDoGDi0R91Wb158IDjSas; s_v_web_id=verify_luzl41cl_aYxk0TzJ_A7K5_4LpL_8YAl_HUWJUfDYEAZd;
    last_login_method=email; csrfToken=swsCwMT8-fl2qJEDihco0mljlBeSNgSYsy1s; tiktok_webapp_theme=light;
    tiktok_webapp_theme_auto_dark_ab=1; perf_feed_cache={%22expireTimestamp%22:1720022400000%2C%22itemIds%22:[%227386489686027537707%22%2C%227362740186813369606%22]};
    passport_fe_beating_status=false; csrf_session_id=0fe7bbbb85c9e6a0e8ec8b7a0aae55f2
  1. Run f2 tk -l en_US -c tiktok.yaml`:
ERROR    HTTP状态错误, 尝试GET请求失败:                                                                                                                                   
         https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/o04tRbN5mIPJEYDesBbFJ1BEEXDQdFAU0Qf9Nl/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=
         3&dr=0&lr=unwatermarked&cd=0%7C0%7C0%7C&cv=1&br=2166&bt=1083&cs=0&ds=6&ft=4KJMyMzm8Zmo0wXRp-4jV5yZdpWrKsd.&mime_type=video_mp4&qs=0&rc=OmRoNzw2OWRkMzw6ZTc2OUBpan
         J3c3g5cnd1czMzZjczM0BiLi8tXmNjNV8xMzI1MjMuYSMzNl5iMmQ0LWpgLS1kMWNzcw%3D%3D&btag=e00090000&expire=1719873149&l=20240701163119E507B8AC60A91F056546&ply_type=2&polic
         y=2&signature=70d5f1061fd42ce92c8bb8fb9b5294a7&tk=tt_chain_token, 错误详情: Client error '403 Forbidden' for url                                                 
         'https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/o04tRbN5mIPJEYDesBbFJ1BEEXDQdFAU0Qf9Nl/?a=1988&bti=ODszNWYuMDE6&ch=0&cr
         =3&dr=0&lr=unwatermarked&cd=0%7C0%7C0%7C&cv=1&br=2166&bt=1083&cs=0&ds=6&ft=4KJMyMzm8Zmo0wXRp-4jV5yZdpWrKsd.&mime_type=video_mp4&qs=0&rc=OmRoNzw2OWRkMzw6ZTc2OUBpa
         nJ3c3g5cnd1czMzZjczM0BiLi8tXmNjNV8xMzI1MjMuYSMzNl5iMmQ0LWpgLS1kMWNzcw%3D%3D&btag=e00090000&expire=1719873149&l=20240701163119E507B8AC60A91F056546&ply_type=2&poli
         cy=2&signature=70d5f1061fd42ce92c8bb8fb9b5294a7&tk=tt_chain_token'                                                                                               
         For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403                                                                         
ERROR    Traceback (most recent call last):                                                                                                                               
           File "/Users/user/.pyenv/versions/3.11.1/lib/python3.11/site-packages/f2/utils/_dl.py", line 42, in get_content_length                            
             response.raise_for_status()                                                                                                                                  
           File "/Users/user/.pyenv/versions/3.11.1/lib/python3.11/site-packages/httpx/_models.py", line 761, in raise_for_status                            
             raise HTTPStatusError(message, request=request, response=self)                                                                                               
         httpx.HTTPStatusError: Client error '403 Forbidden' for url                                                                                                      
         'https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068-euttp/osnAPdLAtjUBNU89QBNIpevMCyhi8ZizoIAEEA/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=3&d
         r=0&lr=unwatermarked&cd=0%7C0%7C0%7C&cv=1&br=3334&bt=1667&cs=0&ds=6&ft=4KJMyMzm8Zmo0wXRp-4jV5yZdpWrKsd.&mime_type=video_mp4&qs=0&rc=OTg5ZDo8ZzdkZWY4ZGVlOUBpM2xqN
         XY5cng5czMzZjczM0BgNS4wMF9jNV4xX181L2JeYSMtNm5eMmRrYHJgLS1kMWNzcw%3D%3D&btag=e00088000&expire=1719873085&l=20240701163119E507B8AC60A91F056546&ply_type=2&policy=2
         &signature=417bca254775c20e30fd949a57f5a690&tk=tt_chain_token'                                                                                                   
         For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403                                                                         
                                                                                                                                                                          
         During handling of the above exception, another exception occurred:                                                                                              
                                                                                                                                                                          
         Traceback (most recent call last):                                                                                                                               
           File "/Users/user/.pyenv/versions/3.11.1/lib/python3.11/site-packages/f2/utils/_dl.py", line 73, in get_content_length                            
             response.raise_for_status()                                                                                                                                  
           File "/Users/user/.pyenv/versions/3.11.1/lib/python3.11/site-packages/httpx/_models.py", line 761, in raise_for_status                            
             raise HTTPStatusError(message, request=request, response=self)                                                                                               
         httpx.HTTPStatusError: Client error '403 Forbidden' for url                                                                                                      
         'https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068-euttp/osnAPdLAtjUBNU89QBNIpevMCyhi8ZizoIAEEA/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=3&d
         r=0&lr=unwatermarked&cd=0%7C0%7C0%7C&cv=1&br=3334&bt=1667&cs=0&ds=6&ft=4KJMyMzm8Zmo0wXRp-4jV5yZdpWrKsd.&mime_type=video_mp4&qs=0&rc=OTg5ZDo8ZzdkZWY4ZGVlOUBpM2xqN
         XY5cng5czMzZjczM0BgNS4wMF9jNV4xX181L2JeYSMtNm5eMmRrYHJgLS1kMWNzcw%3D%3D&btag=e00088000&expire=1719873085&l=20240701163119E507B8AC60A91F056546&ply_type=2&policy=2
         &signature=417bca254775c20e30fd949a57f5a690&tk=tt_chain_token'                                                                                                   
         For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403 

So what's interesting is that the following URL doesn't have the tt_chain_token value in the URL. I'm wondering if that's related to why this isn't working:

'https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068-euttp/osnAPdLAtjUBNU89QBNIpevMCyhi8ZizoIAEEA/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=3&d
         r=0&lr=unwatermarked&cd=0%7C0%7C0%7C&cv=1&br=3334&bt=1667&cs=0&ds=6&ft=4KJMyMzm8Zmo0wXRp-4jV5yZdpWrKsd.&mime_type=video_mp4&qs=0&rc=OTg5ZDo8ZzdkZWY4ZGVlOUBpM2xqN
         XY5cng5czMzZjczM0BgNS4wMF9jNV4xX181L2JeYSMtNm5eMmRrYHJgLS1kMWNzcw%3D%3D&btag=e00088000&expire=1719873085&l=20240701163119E507B8AC60A91F056546&ply_type=2&policy=2
         &signature=417bca254775c20e30fd949a57f5a690&tk=tt_chain_token' 

It's a total shot in the dark, but I'm otherwise unsure what else I'm doing wrong! Perhaps the cookies shouldn't be encoded? I noticed that there are % signs in the cookie, but decoding doesn't solve it either, hah.

Would love to see you point out the location of the comment, you can edit it yourself to remove your personal path!

The contents of the cookie must be the original fields, i.e. what ever value you export using --auto-cookie is what it is.
Also I verified the device_Id you generated, which is 7386706068162463274 and the corresponding tt_chain_token, which is uiu06/A07IgETEOnRD+0Qg==.
image

It works fine for me, and I can download the artwork fine using your cookie, so this creates a big mystery.
image

Did you try printing them f2/apps/tiktok/utils.py:60 and do they have the same value?

Looking forward to more feedback from you to help us address this issue! : )

@Vetches
Copy link

Vetches commented Jul 1, 2024

Ugh, I did it again! Right after you edited it, I hastily sent my reply and included my personal path again, this time in the error messages instead. 😓

Would you mind editing this comment of yours to no longer reference the path? It's under "5." where I show the error messages! I am so sorry about having to ask this of you!


It works, it works, IT WORKS! I'll be honest, it's an incredibly stupid error: I had open two files, but one was for my Douyin downloading and one was for my TikTok downloading, and I was modifying the wrong file. 🫠

Assuming you're not mad at me for missing something so basic, I want to say thank you so much for being so responsive and replying with such clear and helpful comments! I am beyond grateful for taking the time to help solve this for me and break down what steps I need to take to get this all working! Thank you so, so much!

@Johnserf-Seed
Copy link
Owner

Hahaha so that's why, I'm glad I could help you as you were very polite and would provide details so I could quickly pinpoint the problem. As for the personal path issue I have now deleted all path related privacy!

@Vetches
Copy link

Vetches commented Jul 1, 2024

Amazing, absolutely amazing! I just want to say once more thank you so, so much for all of your help! You were equally if not more polite and were beyond patient with me as I fumbled my way through this, hah. You've built an incredible piece of technology that I hope you continue to grow and refine! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
已确认(confirmed) 该issue已被处理,将在下次推送中更新(The issue has been processed and will be updated in the next push) 重复(duplicate) 与已有的反馈或需求重复(This issue or pull request already exists) 提问(question) 想得到更多的详细支持(Further information is requested)
Projects
None yet
Development

No branches or pull requests

3 participants