you may have heard by now but youtube
has officially decided to remove the
dislike count on all videos across its
entire platform this started off as a
test earlier this year and the research
team decided
let's do it
on the entire platform since they
officially decided to do that just a
couple days ago plenty of creators have
come out against this idea mkbhd
coffeezilla asthma and gold as well as
myself in a tweet and this video i guess
we all have similar reasons my main
reason is all the tutorials and guides
that are on the platform that are
supposed to help individuals learn
something or do something diy whatever
it may be
you could tell the validity of that
video through the like to dislike ratio
but without that dislike count the likes
compared to the views don't do anything
and then the comments can help but
creators can delete comments creators
cannot remove the dislike count unless
they remove the like and dislike count
altogether and then when they do that
then you subconsciously know
okay maybe this video i shouldn't watch
because they intentionally removed the
count so all of the indicators would let
you know whether or not that video is
valid we now have basically no idea
because the ratio of likes to views is
not always consistent across the entire
platform on all videos and while i don't
have control over all of those videos
and youtube platform as a whole i do
have control over my own channel
a little bit of control i still have to
abide by the youtube guidelines but
again a little bit of control so i've
decided that i'm going to restore the
dislike count on my own channel for all
my videos so what does that entail we
don't actually have the ability as
youtube creators to go in and reactivate
the dislike count but as a programmer
there are a few ways to go about doing
this which is exactly what this code
does right here it goes through all my
videos and for each individual video
gets my statistics the views the likes
the dislikes i pull those out i figure
out the ratio the date to make sure you
know when i'm updating this and we post
a comment containing that information
we'll get a little bit more detail of
this code a little bit later on for
those that are actually interested in
that but the result here
is this a comment just like this on
every single one of my videos that reads
this is an automated comment to display
likes and dislikes for the video you're
currently watching since youtube decided
to disable the dislike count on videos
the current views
the likes the dislikes and the ratio
which the ratio is the amount of likes
compared to the overall likes and
dislikes and then whenever this comment
was last updated as i don't want to post
a new comment every single time so i
just go through and update this comment
with whatever the current likes and
dislikes are and then i finish this off
with youtube please don't ban or
shadowband me i learned how to do this
from your own docs lol thanks which is
um which is absolutely true because i
figured out actually how to do all of
this
via the documentation of the youtube
data api as you can see i've done quite
a bit of research here in order to get
this working properly and this is all
python i'm a java developer but python
seemed like a fun way to do that so if i
can't do this if youtube is watching
this or they see any of my comments
all of the data that i am pulling and
pushing to and from my own youtube
channel
is done via their api and i learned how
to do all of this
via their documentation for said api and
if you can hear that in the background
even my three-month-old son is upset
with youtube about this he wants the
dislike count shown on all these videos
he's expressing his opinion right there
i thought you were for the kids youtube
come on
as far as the overall idea of this video
is concerned that's about it i'm about
to kind of dive into some of the more
technicals into the program how you can
go about using it and some of the
problems that i am facing and or things
that i need to implement
so if you're interested in that hey
stick around let's get started i did say
i was going to dive into
a little bit more of what this code does
with a little bit more detail i kind of
went over all you know that's whatever
this is api boilerplate stuff that you
need in order to access the api this is
in order to get the video id list i
talked about all of this up until well
actually i did not go into as much
detail here as i wanted to so let's do
that now after the api boilerplate code
we get video id list this is getting the
unique video id for every single video
on my channel and for each of those
individual videos we are doing all of
this so we start off by getting the
statistics that is getting the views the
likes the dislikes and a number of other
statistics that we don't actually need
which is why we have this right here to
pull out what i do need from this
particular video we do a little bit of
math in order to figure out the ratio we
gather today's date i properly format
that date so it looks a little bit
prettier then we hop into the text
original which is the comment with the
appropriate views likes dislikes ratio
for that particular video however we
don't want to create a new comment every
single time we run this job for every
single video because if a comment
already exists we want to edit it or
update it so that is what this does
right here so get my stat comment we
actually
come through here and we
search on that particular video to see
if that comment already exists with that
data and if it does then we come through
here if it does then we come through
here and we update that comment with the
current data and then if it doesn't then
we create a new comment which will then
next time we run this job will be
updated
because the comment already exists and
that is the entirety of this code i'm
not going to go line by line explaining
everything that's going on here but i
think you get the overall gist and all
of this code is available on github for
you to use yourself on my yt dislike
repository on my github account this
will be linked down in the description
below and it contains two files so one
is the real file the yt dislikes python
file that you see right here and then
the other one is the get ignore file i
only bring this up because you're going
to need to get this information yourself
the your client secretfile.json
is the file that you receive to access
the api you come in you create your own
project you go through the oauth consent
screen and you create new credentials
oauth credentials and then that provides
you with a json file and then you rename
it to whatever you have right here or
you just change this text to whatever
your json file is titled but regardless
this needs to match whatever your json
file is that contains all that
information and then when it comes to
the dot m file these are just a few
things that i wanted to hide from the
public repository which are these few
things right here and a few things that
i have yet to address
the first one is mildly out of my
control that is why i created an issue
on the matter and that is to pin newer
updated comments i have searched through
all of this documentation come over here
there's a lot of information in the
youtube data api and the documentation
for comments and comment threads but
nowhere does that have any information
on how to go about pinning a comment and
why do i want to pin a comment i think
it's fairly obvious we're going to talk
about it anyway is because this comment
even though it's done by the creator of
the video will get lost in the shuffle
it is not pinned to the top of the
comment section and if you cannot
readily access it then it does you no
good so i'd love to have a little bit of
a code snippet right here for when i
update the existing comment and the same
code snippet and here for when i create
a new comment so that every single time
i run this job every single comment that
is new or updated is pinned to the top
of the comment section readily available
but i don't know how to do that since
the documentation does not say anything
if you can figure it out submit a pull
request i'll test it out if everything
works
i'll merge it in and i'll be a very
happy man i do also have one other
concern that may or may not be out of my
control currently
at the time of recording this video the
dislike count is available i don't know
where exactly we're getting all of the
statistics for each individual video am
i getting it from the back end like
studio or am i getting it from the
youtube app itself if i'm getting it
from the youtube app itself then there's
going to be a big problem because i
won't be able to access the dislikes
considering they're removing the
dislikes i'll have to figure out a way
to reroute it back to the studio because
as the creator of the video i still have
access to the dislikes just on the
studio version of it which is
my back-end access to the videos and
everything like that and all the
analytics and whatnot so that is a bit
of a problem
if it becomes a problem we'll have to
just wait and find out but aside from
that some things that i actually do have
in my control is one
i don't want to have to manually run
this script every single day i need to
set up a cron job or something to run
this job once a day twice a day however
often i feel
is correct i think once a day would
suffice so i don't hit my youtube quota
for that particular day running it
multiple times and in order to do that
i need to
finish off all the google oauth crap
because when i come down here and i run
the youtube dislikes python in order to
run all of this code and update all the
comments and create all the new comments
i am met with this please visit this url
to authorize this application
basically i need to give this
application access to my youtube data in
order to retrieve the video id retrieve
the statistics for those videos and post
or update the comment on those videos
you log into your gmail account you
click on the youtube channel and then
you're met with this screen right here
to allow access to this which is of
course hooked up to your api stuff over
here
to see edit and permanently delete your
youtube videos ratings comments and
captions now
that may sound a little bit scary but
it's not because at the end of the day
you're the one running this program
giving access to your account to do all
this stuff that you already have
permission to do so as long as you
understand what this code is doing and
that you're okay with exactly what it is
doing
you have nothing to worry about you're
ultimately just giving access to
yourself but then you click on this you
enter the authorization code and then it
runs this code and updates comments and
creates new comments if that doesn't
exist and then there is also one more
thing i almost forgot about this one is
that right now i am only doing five
videos that is what it is set out to
because that is the automated results
per page when i run this code as you can
see that is indicated right here but
i've been testing it out and the maximum
results per page is 50. and then i have
to go in and implement the next page
token automatically in another for loop
you know if there's a next page token
enter it and then do all of the same of
this for the next 50 videos and i
continue through that loop until there's
no more next page token which indicates
that i have gone through all of these
results which are all of my videos and
that's kind of how it works so those are
a few things that i need to get done
those are a few things that i may or may
not be able to complete but at the end
of the day
this was just a fun little thing that i
put together yesterday after i heard
that uh that they're going to officially
remove the dislike count from all videos
so let's see if this program actually
works once they remove it and then we'll
go from there like subscribe if you
aren't already hit the bell if you are
already and uh
i'll see y'all sometime next week if i
make a video next week we'll see