How to delete spam comments on my youtube videos and block spammy channels from commenting on my videos? - youtube

Using YouTube API V3 I have successfully identified the spam comments on my channel. The problem is using the delete API costs 50 credits which is alot given daily 10K credits only.
YouTube studio provides no way of deleting comments by ID and if I go to Settings -> Community -> Hidden users and add the spammy users to the list according to YouTube it will take a lot of days for the past comments to get removed. What to do, please help?

The 10k quota is for development use only YouTube expects you to request a quota extension if you need more quota then that. Fill out the form and request more.
YouTube API Services - Audit and Quota Extension Form
Should take a couple of weeks to get approved.

I would try out https://github.com/ThioJoe/YT-Spammer-Purge. It is a tool that lets you filter and search for spammer comments on your channel and other's channel(s) in many different ways AND delete/report them all at once.
The tool has a full wiki to help you with using it.
Here is the creators video showing it off:
https://www.youtube.com/watch?v=-vOakOgYLUI
Here is an LTT video showing how it works:
https://www.youtube.com/watch?v=zo_uoFI1WXM

Related

YouTube API: Check if Someone Else's Video is Monetized or Not

There is a website called: TubeSift
This tool determines whether a video is "monetized" or not.
My simple question is...
Is there a way to determine if a specific YouTube video is monetized (can show in-stream ads) via some YouTube API?
If yes, which YouTube API?
If no, how then might TubeSift be determining this? Scraping the response?
Important distinction: this would be a video that you DON'T have authentication or credentials to manage - ie: it's someone else's video.
Similar questions asking slightly different things
youtube api to get channel monetization status?
Disclaimer
I realize this question seems off-topic because it doesn't have a code example but YouTube's How to Get Help says to basically ask questions here on StackOverflow for help.
We support the YouTube Data API on Stack Overflow. Google engineers
monitor and answer questions with the youtube-api, youtube-data-api,
and youtube-v3-api tags.
There's really nowhere else to ask.
Youtube provides API to YouTube content partners. I also checked the tubetarget and used scraping also but scraping is very slow as compared to the tubetarget
See this page to get enrolled.
According to youtube: When using delegation in the YouTube Data API, the onBehalfOfContentOwner parameter is always required. The parameter's value is an ID that uniquely identifies the content owner. You can retrieve the ID programmatically by calling the YouTube Content ID API's contentOwners.list method.
Detailed description here
YouTube Partner Program overview, application checklist, & FAQs
Also, check this
YouTube Partner Program policies
Please let me know if you are able to get Content Id API
In my opinion, i think if the video is greater than 10 minutes, therefore that video is being monetized, i read somewhere before that a video needs to have at least 10 minutes in order to be monetized, and obviously we can get the video duration via the API.
The json key is:
+"contentDetails": {#213 ▼
+"duration": "PT4M21S"
The time is formatted as an ISO 8601 string. PT stands for Time Duration, 4M is 4 minutes, and 13S is 13 seconds.
But the way Tubesift does it is just an intelligent guess or maybe some randomizing the "monetized" tagged of a video.
Hope that helps.

Youtube Data API v3: Sort by date not working

The sorting is not working as expected since a few hours.
https://www.googleapis.com/youtube/v3/search?order=date&part=snippet&channelId=UC_x5XG1OV2P6uZZ5FSM9Ttw&key=YOUR_API_KEY
Can be tried in the API explorer (Execute without OAuth) as well.
https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.search.list?part=snippet&channelId=UC_x5XG1OV2P6uZZ5FSM9Ttw&order=date
date: Resources are sorted in reverse chronological order based on the date they were created.
https://developers.google.com/youtube/v3/docs/search/list
What is going wrong?
In case you are looking to get the latest videos of a channel:
Get the channels upload playlist from Channels
Get the latest videos in the channels upload playlist from PlaylistItems
Alternatively, you can use the channels RSS feed:
https://www.youtube.com/feeds/videos.xml?channel_id={ChannelId}
https://www.youtube.com/feeds/videos.xml?user={User}
This does not replace the full search sorted by date function however.
Thanks YouTube for making me work on a Sunday, all I wanted was to watch the latest videos from my favorite channels. At least I don't have to wait for a fix anymore, good luck to those less lucky!
Reports in Google's forum were commented by a Google employee:
https://support.google.com/youtube/thread/2494861?msgid=2520468
YouTube is aware the search/sorting functions aren't working as expected – this is temporary and part of our efforts to better respond, review and remove graphic, violative content from YouTube. Thanks for your patience while we work through this. Will update this thread when these features are working normally again, feel free to subscribe for updates.
Bug reports for this include:
https://issuetracker.google.com/issues/128673031
https://issuetracker.google.com/issues/128673552
Both have an official comment from Google:
Thank you all for bringing this up here. These specific filters have been currently disabled on both YouTube.com and through the APIs. We should have updates on this soon. Thanks again.
Not sure how credible that is:
Just confirming that this is only temporary, and related to YouTube's efforts to better respond, review and remove graphic, violative content from YouTube. Thanks for your patience while we work through this.
https://www.reddit.com/r/youtube/comments/b1plj5/sort_by_upload_date_not_working/eiojtjh/

Likes report on third-party YouTube videos

I'm creating a website for users to post their videos on a particular topic. The videos will be processed with an intermediate server and then uploaded to each user's YouTube channel. However, I would like to know if the YouTube API, lets you know the number of likes you get each of these videos on YouTube.
Thank you for helping me
https://developers.google.com/youtube/v3/docs/videos/list
This is where to look. Please invest some effort of your own before asking on SO. Your question is easily solvable by using a search engine.
If you don't yet know how the YouTube API works, inform yourself first. Once you do know and were able to try something out, but are stuck, I encourage you to ask another question with your particular problem (after researching, of course).

YouTube API "mostPopular" requests doesn't seem to give updated results

It seems that the YouTube API doesn't give updated results for mostPopular videos in my country since few days.
Example:
This request (https://www.googleapis.com/youtube/v3/videos?part=snippet,contentDetails&chart=mostpopular&regionCode=FR) doesn't give me the same videos results than the ones displayed directly on YouTube for the French most popular channel (https://www.youtube.com/channel/UCmzy72gDEpfXoFV9Xdtd0DQ). It seems that the results of this request is not updated since the 1th of february. Results was real time updated before this.
Does someone know if something is wrong with my API request, or if there are some issues with the YouTube API at this moment?
There is nothing wrong with your request. This is a known issue with the YouTube API reported here for Saudi Arabia (but also applicable to multiple regions), and another related issue here with regard to content from France.
Your best bet would be to follow up with the YouTube team on one of those defects, or potentially (and dangerously) scrape the YouTube site for the correct results.
Problem seems to be solved since 13th of february (maybe someone from Google have seen my post..)
YouTube Channels and chart=mostPopular parameter data are separate data entities, aka you will get different results. They may be related but there is no guarantee you will get the same data. To get the data that you want you may need to query for channel itself and its videos.
I got this information from the thread #Jal linked, there was an update by matthewc...#google.com a few days ago:
The most popular channel for Saudia
Arabia and
the mostPopular chart parameter in the video.list
call
are separate and distinct entities. If you'd like to get the content
of the most popular channel for Saudia
Arabia
please use the Data API video.list call to list the videos with the
channel ID (in this case "UCWY-_j1MCth6yf24m58Bh_Q") by setting the
items/snippet/channelId parameter.
My current concern right now is that there is supposedly a way to get video information from the videos.list endpoint using a channelId, which does not seem the case in the API Explorer. I will update my answer once I figure out what this person meant exactly.

What is the easiest way to get the latest comment on any of my videos, using v2 of the YouTube API?

As pointed out in the question How do I fetch comments in version 3 of the YouTube API?, there is currently no way of fetching video comments using version 3 of the YouTube API. Now I'm trying to figure it out using version 2 instead.
What I want is the latest comment on any of my uploaded videos, in other words the latest comment in the "aggregated" comment feed of all my videos.
It seems like the only way to do this is too fetch all videos, and then make a call for each of them to get the comments. With a few hundred uploaded videos, this becomes very expensive in terms of number of API calls and total time for completion.
Is there a simpler and/or better way?
There's no way to be "notified" via the API when a video gets a new comment, so you're going to have to do some polling. The comments feed for a given video id, e.g. https://gdata.youtube.com/feeds/api/videos/fhWaJi1Hsfo/comments?v=2 for video id fhWaJi1Hsfo, is sorted in reverse-chronological order by default, so the last comment added should always be first in the list of entries.
Making a request for the comments feed of several hundred videos, even if you do that a couple of times a day, doesn't sound like an unreasonable amount of traffic. You should follow the best practices outlined in this blog post if you do run into any quota issues, though.

Resources