Giter VIP home page Giter VIP logo

masterchat's People

Contributors

jprochazk avatar madprobe avatar ronnieeeeee avatar stu43005 avatar uetchy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

masterchat's Issues

Milestone message parsing error!

Incorrect durationText parsing lead to error while running durationToSeconds

Seem to caused by the .slice(1)


Code:

const message = renderer.message ? renderer.message.runs : null;
const durationText = renderer
.headerPrimaryText!.runs.slice(1)
.map((r) => r.text)
.join("");


Example payload from https://www.youtube.com/watch?v=oSGkmRhur0Y

{
  "id": "Ci8KLUNNV2F4WVA5cF9zQ0ZTSXZzd0FkQ3JvSF93LUxveU1lc0lELTMzNDEzOTU3Ng%3D%3D",
  "timestampUsec": "1670697881347497",
  "authorExternalChannelId": "UCQRNmDmpBneN3fKlcuMLHZQ",
  "headerPrimaryText": {
    "runs": [
      {
        "text": "Member for 1 month"
      }
    ]
  },
  "headerSubtext": {
    "simpleText": "Bachelor"
  },
  "message": {
    "runs": [
      {
        "text": "WE MISSED YOU TOO VESPER! We understand what you need to do!"
      }
    ]
  },
  "authorName": {
    "simpleText": "Chelsea Rose"
  },
  "authorPhoto": {
    "thumbnails": [
      {
        "url": "https://yt4.ggpht.com/P9mNI29I_xVBKxDmtjUjPecjV94zpQ4K4lsfyHse6XY1Kb1bexrgR5Dp8UKFmbUF0AbTrLMImA=s32-c-k-c0x00ffffff-no-rj",
        "width": 32,
        "height": 32
      },
      {
        "url": "https://yt4.ggpht.com/P9mNI29I_xVBKxDmtjUjPecjV94zpQ4K4lsfyHse6XY1Kb1bexrgR5Dp8UKFmbUF0AbTrLMImA=s64-c-k-c0x00ffffff-no-rj",
        "width": 64,
        "height": 64
      }
    ]
  },
  "authorBadges": [
    {
      "liveChatAuthorBadgeRenderer": {
        "customThumbnail": {
          "thumbnails": [
            {
              "url": "https://yt3.ggpht.com/N2Cpdqu4kPhdc6jS1KLQMOzhk24cBRyj2-S71GEGwrIzJRDxbDWPMlqXBKasCCVzqyctv2lY=s16-c-k",
              "width": 16,
              "height": 16
            },
            {
              "url": "https://yt3.ggpht.com/N2Cpdqu4kPhdc6jS1KLQMOzhk24cBRyj2-S71GEGwrIzJRDxbDWPMlqXBKasCCVzqyctv2lY=s32-c-k",
              "width": 32,
              "height": 32
            }
          ]
        },
        "tooltip": "Member (1 month)",
        "accessibility": {
          "accessibilityData": {
            "label": "Member (1 month)"
          }
        }
      }
    }
  ],
  "contextMenuEndpoint": {
    "clickTrackingParams": "CAYQ4f0GIhMIwef3ztrv-wIVT_A4Bh1fXgMP",
    "commandMetadata": {
      "webCommandMetadata": {
        "ignoreNavigation": true
      }
    },
    "liveChatItemContextMenuEndpoint": {
      "params": "Q2pFS0x3b3RRMDFYWVhoWlVEbHdYM05EUmxOSmRuTjNRV1JEY205SVgzY3RURzk1VFdWelNVUXRNek0wTVRNNU5UYzJHaWtxSndvWVZVTkVVbGRUVHpJNE1XSkpTRmxXYVMxUFZqTnBSbGxCRWd0dlUwZHJiVkpvZFhJd1dTQUJLQUV5R2dvWVZVTlJVazV0Ukcxd1FtNWxUak5tUzJ4amRVMU1TRnBST0FKSUFGQVg="
    }
  },
  "contextMenuAccessibility": {
    "accessibilityData": {
      "label": "Chat actions"
    }
  },
  "trackingParams": "CAYQ4f0GIhMIwef3ztrv-wIVT_A4Bh1fXgMP"
}

The test cannot be passed.

I want to make a pull request but the test does not pass.

Will this code be complete?

git clone https://github.com/holodata/masterchat
cd masterchat
git switch dev
yarn install
yarn build

yarn test

Invalid example in MANUAL.MD

This example won't do anything since the async iterator doesn't do iterations eagerly as arrays do and method like .toArray() may help to do all the iterations.

 import { Masterchat } from "masterchat"; 
 import { appendFile, writeFile, readFile } from "node:fs/promises"; 
  
 const mc = await Masterchat.init("<videoId>"); 
  
 await mc 
   .iter() 
   .filter((action) => action.type === "addChatItemAction") // only chat events 
   .map((chat) => JSON.stringify(chat) + "\n") // convert to JSONL 
   .map((jsonl) => appendFile("./chats.jsonl", jsonl)); // append to the file 

[Question] Reason for large delay?

This works flawlessly but I was wondering why the timeout is so long between messages? I manually set the delay to 1 second and it seems to work fine.

if (this.isLive ?? true) { const timeoutMs = continuation.timeoutMs; await delay(1000, signal); }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.