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

Invalid regular expression #163

Open
gurumnyang opened this issue Feb 22, 2023 · 0 comments
Open

Invalid regular expression #163

gurumnyang opened this issue Feb 22, 2023 · 0 comments

Comments

@gurumnyang
Copy link

gurumnyang commented Feb 22, 2023

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]
      }
      ```
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant