Remove unnecessary bluebird dependency
This commit is contained in:
parent
b87476abc9
commit
42b6cd5a32
9 changed files with 10437 additions and 231 deletions
|
@ -3,7 +3,6 @@ import querystring from 'querystring';
|
|||
import request from 'superagent';
|
||||
import Nodebrainz from 'nodebrainz';
|
||||
import { toSeconds, parse as ptParse } from 'iso8601-duration';
|
||||
import 'superagent-bluebird-promise';
|
||||
import debuglog from 'debug';
|
||||
import urlMatch from './url';
|
||||
|
||||
|
@ -30,7 +29,7 @@ const apiRoot = 'https://www.googleapis.com/youtube/v3';
|
|||
export function* lookupId(id) {
|
||||
const path = `/videos?part=snippet%2CcontentDetails&id=${id}&key=${credentials.key}`;
|
||||
try {
|
||||
const result = yield request.get(apiRoot + path).promise();
|
||||
const result = yield request.get(apiRoot + path);
|
||||
const item = result.body.items[0].snippet;
|
||||
|
||||
const duration = toSeconds(ptParse(result.body.items[0].contentDetails.duration));
|
||||
|
@ -85,7 +84,7 @@ export function* search(data) {
|
|||
}
|
||||
|
||||
const path = `/search?part=snippet&q=${encodeURIComponent(query)}&type=video&videoCaption=any&videoCategoryId=10&key=${credentials.key}`;
|
||||
const result = yield request.get(apiRoot + path).promise();
|
||||
const result = yield request.get(apiRoot + path);
|
||||
const item = result.body.items[0];
|
||||
|
||||
if (!item) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue