![]() ![]() If you plan to do a lot of crawling (I assume valid/legal), you'll have to also take into account your rate of requesting the URL pages (among a lot of other things). Print(response.url) # the correct url with the usernameįinally, you can find the username and the video id using '6796374554391448838')]Įxtra: Modern webservices are usually quite smart and may sometimes have different mechanisms to thwart crawling activities. ![]() Response = requests.get(url, headers=headers) If you update your headers with some 'browser-like' User-Agent, it should work. TikTok might be not redirecting you the right URL because it is detecting your User-Agent. I've also tried things like Selenium, which actually ends up giving me the HTML of the original video page, in which I can find the username and the video id by searching through the actual HTML, but this method doesn't seem too scalable as I'm sure tiktok would notice and slow down my processes. I've tried tracking redirects but the URL I end up with "." is this, which evidently is not the same. I want to be able to get the username and the video id (6796374554391448838) from the shortened URL as it appears in the actual URL. This link ends up redirecting to Is there any way I could get this URL with only the shortened URL? ![]() Some examples of shortened URL's I've come across seem to be shared URL's on Facebook/Twitter in the form of "m." or more specifically, "". I'm trying to get the URL of a tiktok video from a shortened URL in order to extract the of the poster and the video id of the post. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |