WWW::Y...cation(3pm)
π NAME π
okay so this is WWW::YoutubeViewer::Authentication β a 3pm page from the User Contributed Perl Documentation crew β and itβs literally all about OAuth login support π
.
β¨ SYNOPSIS β¨
use WWW::YoutubeViewer;
my $hash_ref = WWW::YoutubeViewer->oauth_login($code);
π οΈ SUBROUTINES/METHODS π οΈ
oauth_refresh_token()
Refreshes the access_token using the refresh_token π. Returns a HASH ref with the access_token or undef. Thatβs it, no cap.
get_accounts_oauth_url()
Creates an OAuth URL with the 'code' response type. (Googleβs authorization server.) π
β οΈ This method is deprecated: https://developers.googleblog.com/2022/02/making-oauth-flows-safer.html
get_user_auth_code()
OAuth 2.0 for TV and Limited-Input Device Applications. πΊ
Returns info containing the user code for:
https://www.google.com/device
Returned data structure:
{
"device_code" => "...",
"user_code" => "...",
"expires_in" => 1800,
"interval" => 5,
"verification_url" => "https://www.google.com/device"
}
More info: https://developers.google.com/identity/protocols/oauth2/limited-input-device
oauth_login_tv($code_info)
OAuth 2.0 for TV and Limited-Input Device Applications. πΊβ¨
Takes the output returned by get_user_auth_code().
On success, it returns the following structure, containing the access and refresh tokens:
{
access_token => "...",
expires_in => 3600,
refresh_token => "...",
scope => "https://www.googleapis.com/auth/youtube",
token_type => "Bearer",
}
oauth_login($code)
Returns a HASH ref with the access_token, refresh_token and some other info. π«Ά
The $code can be obtained by going to the URL returned by the get_accounts_oauth_url() method.
load_authentication_tokens()
Will try to load the access and refresh tokens from authentication_file. π
encode_token($token)
Encode the token with the key and return it. π
decode_token($token)
Decode the token with the key and return it. π
save_authentication_tokens()
Encode and save the access and refresh into the authentication_file. πΎ
load_credentials($file)
Load the API key and the client ID/SECRET values from a given JSON file having the following format:
{
"key": "API_KEY",
"client_id": "CLIENT_ID",
"client_secret": "CLIENT_SECRET"
}
Returns true on success and false otherwise. β
π AUTHOR π
Trizen, "<echo dHJpemVuQHByb3Rvbm1haWwuY29tCg== | base64 -d>"
π¬ SUPPORT π¬
You can find documentation for this module with the perldoc command.
perldoc WWW::YoutubeViewer::Authentication
π LICENSE AND COPYRIGHT π
Copyright 2013-2015 Trizen.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See https://dev.perl.org/licenses/ for more information.
okay bye bestie π«Ά this page was generated with perl v5.42.2 and is dated 2026-02-15 β¨
π¦ where this page comes from
- alpine 3.24: youtube-viewer-doc 3.11.6-r1 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms