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

Error in rbind(deparse.level,...) get_all_comments function #43

Closed
Lucinho91 opened this issue Dec 11, 2017 · 8 comments
Closed

Error in rbind(deparse.level,...) get_all_comments function #43

Lucinho91 opened this issue Dec 11, 2017 · 8 comments

Comments

@Lucinho91
Copy link

Hello,

first of all I would like to thank you for the awesome package you created it already helped me a lot for my masters thesis! I used the get_all_comments () function to extract comments of different videos. For the majority it worked fine but for some it strangely encountered an error.

One example: video_70_comments <-get_all_comments(video_id="zdnybX_qWxY")

"Error in rbind(deparse.level,...): number of columns of arguments do not match"

Do you know a solution to this issue?

Also a second question: Does the get_all_comments() function support running multiple video_ids?

I tried but it only would let me run one video_id at a time. A loop that i wrote did not work either.

Thank you a lot for your help in advance I would greatly appreciate it!!!
Best regards from Germany

@soodoku
Copy link
Member

soodoku commented Dec 11, 2017

Hey, this looks like a bug. I will investigate.

And I will share an example of how to get comments from multiple videos in one go.

@Lucinho91
Copy link
Author

Hey soodoku, thank you so much for your quick answer! :) amazing, I cannot wait for your answer and I am really looking forward to hearing from you.

In addition, I also found another issue with the function. Often times, it returned the same comment multiple times, even though in the youtube comment section the comment was only posted once.
Therefore I had to apply the "unique" function in order to avoid duplicate rows in the data frame.

I hope this can serve you as a bug report or feedback in general as well.
Best regards from Germany

@soodoku
Copy link
Member

soodoku commented Dec 11, 2017

thanks! will investigate that too!

soodoku added a commit that referenced this issue Dec 12, 2017
@soodoku
Copy link
Member

soodoku commented Dec 12, 2017

hey @Lucinho91, I have addressed the first issue. It was there because one of the comments had an extra column called 'ModerationStatus'. I now return that column and id by default. For duplicates, we would want to deduplicate by id. Can you give me a working example where duplicates are returned?

The function is still not final --- I think it can be coded better. But I want to get it work correctly first. So when you get a chance, please send an example of a case where duplicates are returned.

q <- get_all_comments(video_id="zdnybX_qWxY")
nrow(q)
### [1] 6

@Lucinho91
Copy link
Author

Hey @soodoku thank you for your quick answer and fix. However, now after downloading the updated version of tuber I receive a new error which I didn't get before.

error in data.frame(..., check.names = FALSE) :
arguments imply differing number of rows: 99, 100

Do you know how to solve this issue? It now appears with almost every video that I tested.

Now to the problem concerning duplicate rows: this video ID gave me duplicate rows before you updated the package (now the error above wouldn't let me extract the comments anymore)

duplicaterows <- get_all_comments(video_id="XpaOjMXyJGk")

If you filter by author display name you should see that several times the same author with the same comment is included in the data frame.

Thank you a lot for your help and I hope you can solve the new error that I described above.

Best regards

@Lucinho91
Copy link
Author

Hey just another question: I committed a stupid mistake. I already downloaded around 16000 comments from different videos for my master thesis and somehow I didn't store them correctly. Now due to the changes and the new error I cannot download a single comment anymore. Will you get that error fixed? That would be so nice, I really need those comments. I am a little desperate right now :( :D

@soodoku
Copy link
Member

soodoku commented Dec 14, 2017

I will look at this very soon. We should be able to resolve the bug. I have just been doing lazy coding. Will clean up.

@soodoku
Copy link
Member

soodoku commented Dec 14, 2017

Hey @Lucinho91,

fixed the issue + duplication

ans <- get_all_comments(video_id="XpaOjMXyJGk")
nrow(ans)
# [1] 11317
length(unique(ans$id))
# [1] 11317

your other question was about how to get comments from multiple videos in one go. Just use lapply and then you can ldply rbind the list elements:

ans <- lapply(list("zdnybX_qWxY", "zdnybX_qWxY"), get_all_comments)
ldply(ans, rbind)

@gojiplus gojiplus deleted a comment from dripti Feb 11, 2018
soodoku added a commit that referenced this issue Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants