diff --git a/src/Utils.ts b/src/Utils.ts index 3d3036e..28cc0ac 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -11,7 +11,7 @@ import fs from 'fs'; async function extractGuids(url: string, client: ApiClient): Promise | null> { const videoRegex = new RegExp(/https:\/\/.*\/video\/(\w{8}-(?:\w{4}-){3}\w{12})/); - const groupRegex = new RegExp(/https:\/\/.*\/group\/(\w{8}-(?:\w{4}-){3}\w{12})/); + const groupRegex = new RegExp(/https:\/\/.*\/(group|channel)\/(\w{8}-(?:\w{4}-){3}\w{12})/); const videoMatch: RegExpExecArray | null = videoRegex.exec(url); const groupMatch: RegExpExecArray | null = groupRegex.exec(url); @@ -20,7 +20,7 @@ async function extractGuids(url: string, client: ApiClient): Promise | undefined) => response?.data.metrics.videos); const result: Array = []; @@ -28,7 +28,7 @@ async function extractGuids(url: string, client: ApiClient): Promise = await client.callApi( - `groups/${groupMatch[1]}/videos?$skip=${100 * index}&` + + `${groupMatch[1]}s/${groupMatch[2]}/videos?$skip=${100 * index}&` + '$top=100&$orderby=publishedDate asc', 'get') .then( (response: AxiosResponse | undefined) =>