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

Way to View/Archive Offline or See Exported Data #47

Open
rmanzt opened this issue May 19, 2020 · 5 comments
Open

Way to View/Archive Offline or See Exported Data #47

rmanzt opened this issue May 19, 2020 · 5 comments
Labels

Comments

@rmanzt
Copy link

rmanzt commented May 19, 2020

Is there any way to save all of the generated comments in a way where they can be viewed in their entirety later on?

The program has an export function but no import function.

I'm trying to archive all of a channels video comments, but want to make sure comments won't change/be deleted based on the current state of the channel in the future.

@rmanzt rmanzt changed the title Way to View/Archive Offline/See Exported Data Way to View/Archive Offline or See Exported Data May 19, 2020
@mattwright324
Copy link
Owner

I guess to clarify how it works...

Once a comment has been downloaded during a refresh it is there in the database and won't be overwritten or deleted on future refreshes. I can't detect when comments have been deleted. I could potentially update comments but do not do that.

You should be fine.

@bernard01
Copy link

This comment suite is awesome. I like the stability of the database. If something does not work as I expect then I can always query the database and find out what is going on. Matt, as you say, you cannot find out whether a comment gets deleted. I am glad that the database keeps old comments that get deleted in YouTube so one can build a good history in the database! Now it is the nature of distributed databases that they get out of sync, and please let me discuss the case where a comment gets deleted. You say you cannot find out. I guess that you mean there is no notification, meaning that YouTube does not let you ask to report deleted comments. Which makes sense. Because they are gone in YouTube.

But I guess it is possible to make a request by the comment ID in a video and check if it can be found in YouTube. This will be an expensive operation because it is a single request for each comment! But can you consider this functionality? The comment table would need a "deleted" flag or we would need a small index table that contains IDs of deleted comments. Or whatever feature that records this state. It would not be that straight forward because there is the added possibility that a video is deleted or an entire channel is deleted of a video is made private with the result being effectively the same. Considering these options it would be possible theoretically even that a deleted comment comes back this way because a video with its comment changes from private back to public..

@bernard01
Copy link

Deleted comments as I mentioned earlier can be handled easily as I found out. I created a new instance with a fresh database that does not contain the deleted comments. Then I work with the differential between the exports of the two databases. So my ideas regarding the flagging of deleted comments was not that good after all.

@mattwright324
Copy link
Owner

mattwright324 commented Aug 25, 2021

Thinking about it, in the realm of 'deleted comments' it could be reasonable for me to display some kind of indicator when a comment is no longer viewable based on the video status. This could for example be new column(s) on the videos table comments_viewable_in_web and comments_viewable_in_api.

A video's comments are not viewable when any of the following is true:

  • Actually has comments disabled
  • Video has madeForKids=true
  • Video is private or no longer exists
  • Video region restriction has ~249 blocked countries (if I remember right)
    • Edit: in the page you see Comments are turned off but you can still see them in the api
  • Could be one other case I'm not thinking of, possibly with livestreams

@bernard01
Copy link

On the other hand:
-- Get the list of videos in the current database to build a fresh database to attach:
select
'https://www.youtube.com/watch?v=' || vid.video_id
from videos vid;

-- Find comments in the current database that do not exist in an attached fresh
-- database. Purpose is to find comments that were added in the current database but deleted after added.
select
*
from
comments co left join fresh.comments co2
on co.comment_id = co2.comment_id
where co2.comment_id is null;

It's really easy to do with "DB Browser for SQLite"

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

No branches or pull requests

3 participants