From 84891a90ebc26c44b40414f72b7afd4484c54388 Mon Sep 17 00:00:00 2001 From: zerodytrash <59258980+zerodytrash@users.noreply.github.com> Date: Thu, 11 Jul 2024 01:33:20 +0200 Subject: [PATCH] format code, bump version --- package.json | 2 +- src/index.js | 2 +- src/lib/tiktokUtils.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index d73dac2..eca0a52 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tiktok-live-connector", - "version": "1.1.8", + "version": "1.1.9", "description": "Node.js module to receive live stream chat events like comments and gifts from TikTok LIVE", "main": "index.js", "types": "./dist/index.d.ts", diff --git a/src/index.js b/src/index.js index 1485df2..0940945 100644 --- a/src/index.js +++ b/src/index.js @@ -77,7 +77,7 @@ class WebcastPushConnection extends EventEmitter { * @param {object} [options[].requestOptions={}] Custom request options for axios. Here you can specify an `httpsAgent` to use a proxy and a `timeout` value for example. * @param {object} [options[].websocketOptions={}] Custom request options for websocket.client. Here you can specify an `agent` to use a proxy and a `timeout` value for example. * @param {object} [options[].signProviderOptions={}] Custom request options for the TikTok signing server. Here you can specify a `host`, `params`, and `headers`. - */ + */ constructor(uniqueId, options) { super(); diff --git a/src/lib/tiktokUtils.js b/src/lib/tiktokUtils.js index 6c8da4e..857c80f 100644 --- a/src/lib/tiktokUtils.js +++ b/src/lib/tiktokUtils.js @@ -4,12 +4,12 @@ function getRoomIdFromMainPageHtml(mainPageHtml) { let idx = 0; do { // loop thru many "room" excerpts and look for a match - idx = mainPageHtml.indexOf('roomId', idx+3); + idx = mainPageHtml.indexOf('roomId', idx + 3); const excerpt = mainPageHtml.substr(idx, 50); let matchExcerpt = excerpt.match(/roomId":"([0-9]+)"/); if (matchExcerpt && matchExcerpt[1]) return matchExcerpt[1]; } while (idx >= 0); - + let matchMeta = mainPageHtml.match(/room_id=([0-9]*)/); if (matchMeta && matchMeta[1]) return matchMeta[1];