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

Release/0.3.5 #36

Merged
merged 5 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 24 additions & 13 deletions API/youtubeAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,30 @@ var google = require('@googleapis/youtube');
var OAuth2 = google.auth.OAuth2;

async function youtubeAPI(tokens, resolveName, id, args) {
var oauth2Client = new OAuth2(
GOOGLE_CLIENT_ID,
GOOGLE_CLIENT_SECRET
);

oauth2Client.setCredentials({
access_token: tokens.googleaccesstoken,
});

var youtube = google.youtube({
version: 'v3',
auth:oauth2Client
});

if (tokens.googleaccesstoken) {
const oauth2Client = new OAuth2(
GOOGLE_CLIENT_ID,
GOOGLE_CLIENT_SECRET
);

oauth2Client.setCredentials({
access_token: tokens.googleaccesstoken,
});

youtube = google.youtube({
version: 'v3',
auth: oauth2Client
});
}
else if (tokens.googleapikey) {
youtube = google.youtube({
version: 'v3',
auth: tokens.googleapikey
});
} else {
throw new Error('No authentication method provided');
}

try {
const pages = args['pages'] - 1;
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.3.5] - 2024-07-17
### Added
- Google API key as an alternative way to authorize [#179](https://github.com/ncsa/standalone-smm-smile/issues/179)

## [0.3.4] - 2024-06-27
### Added
- Randomly gather YouTube video using random search string [#169](https://github.com/ncsa/standalone-smm-smile/issues/169)
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "smile_graphql",
"version": "0.3.4",
"version": "0.3.5",
"private": true,
"scripts": {
"start": "forever ./bin/www",
Expand Down
Loading