Page 1 of 1

No Category After adding YouTube Key, Here is a Quick Fix

Posted: Wed Nov 20, 2019 2:07 pm
by aashish97
SafeSquid's YouTube Categorization is it really plug and play or do i need to be a techie to use SafeSquid's YouTube Category Feature.

Recently, SafeSquid-SWG has introduced Youtube Category Integration.
which means we can now use YouTube Category to allow/block youtube videos.
which is a very cool feature.
The only thing that SafeSquid Admin should do is create a YouTube V3 API (Which is Free!!).
and add that key in SafeSquid Libs (In other words paste the Key in File: /var/lib/safesquid/youtube/keys).
After doing the Integration (In other words, adding the key and doing a SafeSquid Restart).
All Youtube Categories will be shown in SafeSquid's Category Section(While Creating a Profile).
and then we can easily allow/block youtube videos based on the category.
we can also create a granular configuration with this.
like only allowing youtube category for a specific group, time, browser, etc.

But I faced a problem while doing so.
I added my key (Not the Original One!) in File: /var/lib/safesquid/youtube/keys and then restarted SafeSquid.
Still, I was not able to see any YouTube Category in SafeSquid's Category Section(While Creating a Profile)
image.png
image.png (42.85 KiB) Viewed 1251 times
I went through the log file and saw this:
image.png
image.png (63.42 KiB) Viewed 1251 times
The above Screenshot shows Request made by SafeSquid to Google APis to fetch YouTube Categories and the server responds with: HTTP/1.1 400 Bad Request
BUT, Why do i see a Broken Key and No Category in Category Section.

Hmm, Strange

Did i made a Mistake.
Let me create a New One

New YouTube Key Added and did a Restart. : AIzhjaFkusDxwjKlQ7cJ7GQgtUP3uJpzS_Jklop
It worked.
image.png
image.png (117.25 KiB) Viewed 1251 times
Also the log line shows the complete Key,

After doing some troubleshoot.
I think there is minor bug in SafeSquid,
where when the YouTube Key has "-",youtube does not fetches the incomplete key.it fetches the key till "-"hypen and rest is ignored including "-"hypen.
my new key does not contain a hypen, so it worked like charm.

So,
Untill unless you get a YouTube key without a "-" hypen, It is Plug and Play.
If you get a hypen"-", then.. Create a New One, till you you get no hypen"-" in the key String.
:D :) ;)