dfreelon / pyktok

A simple module to collect video, text, and metadata from Tiktok.
BSD 3-Clause "New" or "Revised" License
316 stars 44 forks source link

Did TT break save video? #19

Closed croweDF closed 1 year ago

croweDF commented 1 year ago

Great tool, the CSV listing it creates is really helpful. I was using this just Wednesday and downloading videos no problem, but today - no luck. Just wanted to check if you were aware of anything TT did that would break save video. Thanks.

dfreelon commented 1 year ago

Yep, looks like it--function is returning "Access Denied." Looking into it...

dfreelon commented 1 year ago

OK, now I can't view TT videos by themselves (i.e. without the surrounding comments, related videos etc. Can anyone else do this?

dfreelon commented 1 year ago

Well, using this site: https://savett.cc/en/ I figured out how to pull a working standalone TT URL, e.g. https://v39.tiktokcdn-us.com/df11acde2bc0d9d9ae2f365d1ea02390/63e6cf85/video/tos/useast5/tos-useast5-pve-0068-tx/60b8cdef3a584f7392bfa09a8d147bf7/?a=1233&ch=0&cr=3&dr=0&lr=all&vr=all&cd=0%7C0%7C0%7C3&cv=1&br=838&bt=419&cs=0&ds=6&ft=aEKfuqT0mIsPD12iDr9q3wU3cSfaEeF~OD&mime_type=video_mp4&qs=0&rc=aGY3aGdlZDlmZWZnZzU3ZkBpM29scDc6ZnhkODMzNzczM0AvYS1iLl8vNi8xLjJiLjE0YSNlcGwucjRvMjRgLS1kMTZzcw%3D%3D&l=202302101713048226E689EC529F0412DA"

Problem is, this doesn't show up in the JSON, the rendered page, or among the XHR requests that I can see. Any ideas?

croweDF commented 1 year ago

I've used this site in the past as well: https://snaptik.app/

Sorry, friend, no ideas at the moment re: the JSON.

dphiffer commented 1 year ago

I tinkered a little bit but did not figure this out. Here are some things I tried, in case they might offer some clues:

dfreelon commented 1 year ago

There's gotta be a way. If those TT download websites could figure it out, anyone can.

vrocx28 commented 1 year ago

@dfreelon i figured out how to download the videos as of 3 march 2023 while i was working on a similar thing, i stumbled across your project right now, but i have no experience contributing to open source projects

dfreelon commented 1 year ago

Well, if you have working code or any other details that might help, feel free to share them...

liabozarth commented 1 year ago

@dfreelon i figured out how to download the videos as of 3 march 2023 while i was working on a similar thing, i stumbled across your project right now, but i have no experience contributing to open source projects

Hey, Vrocx can you describe how you solve this issue?

vrocx28 commented 1 year ago

Well, if you have working code or any other details that might help, feel free to share them...

Yes, i have working code, but i am travelling currently, the new download url in the embedded json end with chain_tt_token which is set when we call any tiktok video, a simple fix would be to extract those cookies and pass those cookies in the header don't use cookies=cookies but update the header dict

vrocx28 commented 1 year ago

@dfreelon i figured out how to download the videos as of 3 march 2023 while i was working on a similar thing, i stumbled across your project right now, but i have no experience contributing to open source projects

Hey, Vrocx can you describe how you solve this issue?

The new download url in the embedded json end with chain_tt_token which is set when we call any tiktok video, a simple fix would be to extract those cookies and pass those cookies in the header don't use cookies=cookies but update the header dict

dfreelon commented 1 year ago

This is now fixed; see https://github.com/dfreelon/pyktok/pull/22 . Big thx to @dphiffer !

dphiffer commented 1 year ago

I had tried passing cookies in my earlier testing but hadn't considered that the cookies would need refreshing. @vrocx28's comments got me to try that angle out again.