Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Invalid regular expression #163

@gurumnyang

Description

@gurumnyang

youtube-grabber.js, line 264~267

channelInfo = {
        channelId: channelPageResponse.data.responseContext.serviceTrackingParams.find((service) => service.service === 'GOOGLE_HELP').params[0].value,
        channelName: new RegExp(`${firstVideoTitle.runs[0].text} by (.*?) ${firstPublishTimeText.simpleText}`, 'g').exec(firstVideoTitle.accessibility.accessibilityData.label)[1]
      }
channelName: new RegExp(`${firstVideoTitle.runs[0].text} by (.*?) ${firstPublishTimeText.simpleText}`, 'g').exec
                                                                                                                       c(firstVideoTitle.accessibility.accessibilityData.label)[1]
                     ^

SyntaxError: Invalid regular expression: /왁피셜)돚거 폼 미쳤다 by (.*?) 1 month ago/: Unmatched ')'
    at new RegExp (<anonymous>)
    at YoutubeGrabber.getChannelVideosMore (C:\Users\GurumNyang\Documents\Github\drabulyfinder2\node_modules\yt-channel-
                                                                                                                       -info\app\youtube-grabber.js:267:22)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.getChannelVideos (C:\Users\GurumNyang\Documents\Github\drabulyfinder2\src\utils\youtube\scrapVideo.j
                                                                                                                       js:121:23)

cannot process this video
image
video Title: 왁피셜)돚거 폼 미쳤다

my solution. I removed video title, using firstVideoTitle.accessibility.accessibilityData.label.replace(firstVideoTitle.runs[0].text, "")

channelInfo = {
        channelId: channelPageResponse.data.responseContext.serviceTrackingParams.find((service) => service.service === 'GOOGLE_HELP').params[0].value,
        channelName: new RegExp(` by (.*?) ${firstPublishTimeText.simpleText}`, 'g').exec(firstVideoTitle.accessibility.accessibilityData.label.replace(firstVideoTitle.runs[0].text, ""))[1]
      }
      ```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions