Use native esm
This commit is contained in:
parent
c4354a6600
commit
70bd12a4d6
37 changed files with 379 additions and 119 deletions
|
@ -2,9 +2,9 @@ import { parse } from 'url';
|
|||
import querystring from 'querystring';
|
||||
import request from 'superagent';
|
||||
import Nodebrainz from 'nodebrainz';
|
||||
import { toSeconds, parse as ptParse } from 'iso8601-duration';
|
||||
import iso8601 from 'iso8601-duration';
|
||||
import debuglog from 'debug';
|
||||
import urlMatch from './url';
|
||||
import urlMatch from './url.js';
|
||||
|
||||
const debug = debuglog('combine.fm:youtube');
|
||||
|
||||
|
@ -32,7 +32,7 @@ export async function lookupId(id) {
|
|||
const result = await request.get(apiRoot + path);
|
||||
const item = result.body.items[0].snippet;
|
||||
|
||||
const duration = toSeconds(ptParse(result.body.items[0].contentDetails.duration));
|
||||
const duration = iso8601.toSeconds(iso8601.parse(result.body.items[0].contentDetails.duration));
|
||||
|
||||
const split = item.title.match(/([^-]+)-(.*)/);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue