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

Getting more than 50 videos from userLikedbyUsername? #231

Closed
everestpipkin opened this issue Aug 24, 2020 · 5 comments
Closed

Getting more than 50 videos from userLikedbyUsername? #231

everestpipkin opened this issue Aug 24, 2020 · 5 comments
Labels
Hacktoberfest Good issues for Hacktober

Comments

@everestpipkin
Copy link

Hi everyone,

Thank you for the useful wrapper! I've been having fun toying with it.

Ran into a problem - I'm helping a friend archive their liked videos. I wrote a little script that goes through, gets the list of their likes, then downloads the associated files. It works perfectly - up to 50. At 51+, it hangs, then quits and doesn't return anything at all.

I went into the code and saw there were some hard parameters (maxCount in userLiked) set to 50, so I upped that but it doesn't solve the issue. I was wondering if it was related to #183 with the change of indexing meaning that the maxCursor parameter wasn't allowing for pagination. Wondering if you had any leads? I'm new to pyppeteer so perhaps its an easy fix?

Thank you!

@issue-label-bot
Copy link

Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details.

@duplicate-issues
Copy link

Hey @everestpipkin,

We did a quick check and this issue looks very darn similar to

This could be a coincidence, but if any of these issues solves your problem then I did a good job 😄

If not, the maintainers will get to this issue shortly.

Cheers,
Your Friendly Neighborhood ProBot

@everestpipkin
Copy link
Author

everestpipkin commented Sep 4, 2020

Just wanted to check in and see if anyone else had run into this or something similar - I've kept fiddling but have not made any progress on this at all on my end. Here is the code for making the info CSV - it works perfectly up to count=50, but count=51+ returns nothing.

from TikTokApi import TikTokApi
import requests
import pandas as pd

api = TikTokApi()

username = 'NAME'

def simple_dict(tiktok_dict):
  to_return = {}
  to_return['user_name'] = tiktok_dict['author']['uniqueId']
  to_return['user_id'] = tiktok_dict['author']['id']

  to_return['video_id'] = tiktok_dict['id']
  to_return['video_description'] = tiktok_dict['desc']
  to_return['video_created'] = tiktok_dict['createTime']
  to_return['video_link'] = 'https://www.tiktok.com/@{}/video/{}'.format(to_return['user_name'], to_return['video_id'])

  to_return['number_likes'] = tiktok_dict['stats']['diggCount']
  to_return['number_plays'] = tiktok_dict['stats']['playCount']

  to_return['music_title'] = tiktok_dict['music']['title']
  to_return['music_authorName'] = tiktok_dict['music']['authorName']

  to_return['video_down'] = tiktok_dict['video']['downloadAddr']

  return to_return

liked_videos = api.userLikedbyUsername(username, count=50, language='en', region='US', proxy=None)

liked_videos = [simple_dict(v) for v in liked_videos]
liked_videos_df = pd.DataFrame(liked_videos)
liked_videos_df.to_csv('{}_videos.csv'.format(username),index=False)

@Coloradohusky
Copy link
Contributor

I have a similar issue, userLikedbyUsername only goes up to the amount of videos a user has liked, but I haven't experimented with more than 50 liked videos

@davidteather davidteather added the Hacktoberfest Good issues for Hacktober label Oct 1, 2020
@davidteather
Copy link
Owner

Seems to be fixed now probably due to #333

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hacktoberfest Good issues for Hacktober
Projects
None yet
Development

No branches or pull requests

3 participants