Code Monkey home page Code Monkey logo

node-ytsr's People

Contributors

androz2091 avatar catsmiaow avatar cbrown350 avatar cjh980402 avatar dafatov avatar dependabot[bot] avatar greenkeeper[bot] avatar guilhermeasper avatar jontze avatar jsjack avatar khoohaoyit avatar mattez02 avatar moisout avatar ovyerus avatar pyroignus avatar ragzouken avatar reply2za avatar skick1234 avatar snyk-bot avatar thebrunorm avatar timeforaninja avatar venkataramanab 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  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  avatar  avatar  avatar  avatar

node-ytsr's Issues

I can't search for videos!

I have issues with two examples: the wip version of ytsr on npm, and the current wip version on Github.

NPM wip version:

When I search for videos on the npm version of ytsr, it just doesn't finish searching. It starts searching for videos but it doesn't finish. I tried to console log my results directly below the lines that search for the results, but it doesn't even get to the console log line. It just sits there and does nothing or at least that's what I think. It doesn't go on with the code either it just keeps awaiting on ytsr to search.

Github wip version:

When using the Github wip version that I just downloaded today, it makes my .catch() go off. If I remove .catch(), it throws this error:

Unhandled promise rejection: MinigetError: Status code: 400
    at ClientRequest.<anonymous> (C:\Users\Owner\Documents\BirdyBirdy\node_modules\miniget\dist\index.js:197:27)
    at Object.onceWrapper (events.js:422:26)
    at ClientRequest.emit (events.js:315:20)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:641:27)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:126:17)
    at TLSSocket.socketOnData (_http_client.js:509:22)
    at TLSSocket.emit (events.js:315:20)
    at addChunk (_stream_readable.js:309:12)
    at readableAddChunk (_stream_readable.js:284:9)
    at TLSSocket.Readable.push (_stream_readable.js:223:10) {
  statusCode: 400
}

Neither work and I have no idea what to do at all to fix it.

[BUG] I've got this error today

Error: type richShelfRenderer is not known at parseItem (C:\\node_modules\ytsr\lib\parseItem.js:69:13) at catchAndLogFunc (C:\\node_modules\ytsr\lib\parseItem.js:76:12) at module.exports (C:\\node_modules\ytsr\lib\parseItem.js:99:46) at C:\\node_modules\ytsr\lib\main.js:54:34 at Array.map (<anonymous>) at module.exports (C:\\node_modules\ytsr\lib\main.js:54:25) at runMicrotasks (<anonymous>) at processTicksAndRejections (internal/process/task_queues.js:93:5) at async Object.exports.run (C:\\commands\play.js:14:32)

Does this module no longer works with URLs ?

I used to do requests like :
ytsr('https://www.youtube.com/watch?v=qEfPBt9dU60')
and the promise keeps getting rejected with the following error : Error: link has to include a "search_string" query.

Was there some kind of API change, or are urls no loner supported ?

How can I get the URL of the very first video?

How can I get the URL of the very first video? Pretty much the question is the same as the title. I just want someone to be able to use my code to find the very first song/video and be able to play it.

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

TypeError thrown from util's removeHtml() when parsing YouTube movies

Issue: When an "official" YouTube movie (YouTube Movies) is returned by the search query, the TypeError below is thrown and it can't be caught.

Error:

/home/w1tch/Bot/node_modules/ytsr/lib/util.js:177
     director: exports.removeHtml(filmMeta.split('<li>')[2].replace(/<[^>]+>|^[^:]+: /g, '')),
                                                           ^
 TypeError: Cannot read property 'replace' of undefined
     at Object.exports.parseMovie (/home/w1tch/Bot/node_modules/ytsr/lib/util.js:177:59)
     at Object.exports.parseItem (/home/w1tch/Bot/node_modules/ytsr/lib/util.js:40:20)
     at /home/w1tch/Bot/node_modules/ytsr/lib/main.js:47:22
     at Array.map (<anonymous>)
     at /home/w1tch/Bot/node_modules/ytsr/lib/main.js:47:8
     at IncomingMessage.<anonymous> (/home/w1tch/Bot/node_modules/ytsr/lib/util.js:249:7)
     at IncomingMessage.emit (events.js:215:7)
     at endReadableNT (_stream_readable.js:1183:12)
     at processTicksAndRejections (internal/process/task_queues.js:80:21)

Reproduction: The query that originally caused this error was "Monsters, Inc." (while searching for meme music).

require('ytsr')('monsters inc'); // same results, naked or not

Environment:

Ubuntu 18.04
Node.js v12.11.1
ytsr 6.13.0

No 'Access-Control-Allow-Origin' header is present on the requested resource.

I wanted to use this libraryb in a React project, but when I make a request I get this error:
Access to fetch at 'https://www.youtube.com/results?spf=navigate&gl=US&hl=en&search_query=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dq_BrLvbdgu0%26origin%3Dhttp%3A%2F%2Flocalhost%3A3000' from origin 'http://chat.test:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

I browsed some of the code, it is using MINIGET and I don't know if I can enable no-cors in it ?

Playlist results do not contain valid links

Line 85 in lib/util.js is the culprit:
const cleanID = exports.removeHtml(exports.between(string, 'data-list-id="', '"'));
Changing it to this seems to fix the problem:
const cleanID = exports.removeHtml(exports.between(string, 'href="/playlist?list=', '"'));

Fix channel subscriber count

It seems like there used to be a way of getting an exact subscriber count before the count change, but now all followers fields are 0. You could probably just have it be a string (i.e. "5.52M") or parse it into an estimate number.

{
  type: 'channel',
  name: 'Fitz',
  channel_id: 'UCtb8P4rf_1n8KS8eZk_lNNw',
  link: 'https://www.youtube.com/channel/UCtb8P4rf_1n8KS8eZk_lNNw',
  avatar: 'https://yt3.ggpht.com/a/AATXAJzK8HUDztEw5PfBCjDJz26HxbrfrxwAmaxCjg=s176-c-k-c0x00ffffff-no-rj-mo',
  verified: true,
  followers: 0,
  description_short: "I don't upload very much, but when I do it's always the best.",
  videos: 150
}

search return undefined

Hello, I have a problem with searching. When I try to search something, always it will return undefined.

here is my code:

var res = await ytsr(args.join(' ')).catch(e => {
                    message.channel.send(':x: **Nothing found**');
                    return;
                });

"res" is always undefined.

I have all variables declared. (including ytsr)

Someone help me?

"Unable to find JSON!" in some searches

In some searches for specific strings, 100% of the time I get this error: Unable to find JSON!.

The string that can be used to check for this error is "candy plan b".

I use the latest version available today: [email protected].

Full trace:
Error: Unable to find JSON! at module.exports (/home/xxx/bot/node_modules/ytsr/lib/main.js:11:23) at module.exports (/home/xxx/bbot/node_modules/ytsr/lib/main.js:19:28) at runMicrotasks (<anonymous>) at processTicksAndRejections (internal/process/task_queues.js:97:5) at async Object.exports.run (/home/xxx/bot/commands/play.js:391:17)

Question

I'd like to congrat you, it's a awesome package but I have a question: How could I make it respond my videoSearch more quickly ? I need it more quick as possible. My actual code is like this: ytsr('oi lagum', {limit: 1, hl: 'pt', gl: 'BR'})

Many thanks!

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

Unknown Type

1x0vmmi6op-1604694953485.txt

That's the file I got above. Here is the console log I got;

/********************************************************************************************************************************************************************************************************
unknown type
pls post the the files in C:\Users\Owner\Documents\BirdyBirdy\node_modules\ytsr\dumps to https://github.com/TimeForANinja/node-ytsr/issues
********************************************************************************************************************************************************************************************************\

Today I got the console log above. I decided to follow the instructions in that console log.
Here is the text from the file if you don't want to download it:

{ "emergencyOneboxRenderer": { "title": { "simpleText": "Need help? In the United States" }, "firstOption": { "singleActionEmergencySupportRenderer": { "actionText": { "simpleText": "Call 1-800-273-8255" }, "navigationText": { "simpleText": "National Suicide Prevention Lifeline" }, "navigationEndpoint": { "clickTrackingParams": "CIkBEK5qIhMI6qCaxeLu7AIVxs4WCR3JhwMp", "commandMetadata": { "webCommandMetadata": { "url": "//www.youtube.com/redirect?event=&q=http%3A%2F%2Fwww.suicidepreventionlifeline.org%2F&usg=uo4JShNAAQJqdWnfYwxanQ", "webPageType": "WEB_PAGE_TYPE_UNKNOWN", "rootVe": 83769 } }, "urlEndpoint": { "url": "//www.youtube.com/redirect?event=&q=http%3A%2F%2Fwww.suicidepreventionlifeline.org%2F&usg=uo4JShNAAQJqdWnfYwxanQ" } }, "detailsText": { "simpleText": "Free · 24/7 · Confidential · In English, Spanish" }, "icon": { "iconType": "PHONE" }, "trackingParams": "CIkBEK5qIhMI6qCaxeLu7AIVxs4WCR3JhwMp" } }, "secondOption": { "singleActionEmergencySupportRenderer": { "actionText": { "simpleText": "Text \"SAFE\" to 741-741" }, "navigationText": { "simpleText": "Crisis Text Line" }, "navigationEndpoint": { "clickTrackingParams": "CIgBEK5qIhMI6qCaxeLu7AIVxs4WCR3JhwMp", "commandMetadata": { "webCommandMetadata": { "url": "//www.youtube.com/redirect?event=&q=http%3A%2F%2Fwww.crisistextline.org%2F&usg=GWWeuwrnAjTCSNf94JeGwQ", "webPageType": "WEB_PAGE_TYPE_UNKNOWN", "rootVe": 83769 } }, "urlEndpoint": { "url": "//www.youtube.com/redirect?event=&q=http%3A%2F%2Fwww.crisistextline.org%2F&usg=GWWeuwrnAjTCSNf94JeGwQ" } }, "detailsText": { "simpleText": "Free · 24/7 · Confidential" }, "icon": { "iconType": "SMS" }, "trackingParams": "CIgBEK5qIhMI6qCaxeLu7AIVxs4WCR3JhwMp" } }, "trackingParams": "CIcBEK1qGAAiEwjqoJrF4u7sAhXGzhYJHcmHAyk=" } }

Cannot read property 'simpleText' of undefined

TypeError: Cannot read property 'simpleText' of undefined
    at Object.exports.parseText (/home/alexandre/Projects/Sempiternel/node_modules/ytsr/lib/utils.js:67:50)
    at parseShowingResultsFor (/home/alexandre/Projects/Sempiternel/node_modules/ytsr/lib/parseItem.js:227:40)
    at parseItem (/home/alexandre/Projects/Sempiternel/node_modules/ytsr/lib/parseItem.js:37:14)
    at catchAndLogFunc (/home/alexandre/Projects/Sempiternel/node_modules/ytsr/lib/parseItem.js:68:12)
    at module.exports (/home/alexandre/Projects/Sempiternel/node_modules/ytsr/lib/parseItem.js:88:46)
    at /home/alexandre/Projects/Sempiternel/node_modules/ytsr/lib/main.js:57:34
    at Array.map (<anonymous>)
    at module.exports (/home/alexandre/Projects/Sempiternel/node_modules/ytsr/lib/main.js:57:25)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:93:5)

/********************************************************************************************************************************************************************************************************
failed at func parseItem: Cannot read property 'simpleText' of undefined
pls post the the files in /home/alexandre/Projects/Sempiternel/node_modules/ytsr/dumps to https://github.com/TimeForANinja/node-ytsr/issues
********************************************************************************************************************************************************************************************************\

Hello 👋

I am asking to add a ready API returning with json format and request is with GET method like /? query=Stay%20With%20Me&page=1 and can be run on heroku i hope u get it my English is bad 💔

Substitute HTTPS with fetch

Hello. I have been trying to implement this into my React Native app. However, I've been struggling with changing the getPage method since it uses require('https').

I have tried to substitute it with the following, however unsuccessfully:

export const getPage = (ref, cb) => {
    fetch(ref)
    .then((response) => response.json())
    .then((resp) => {
        cb(null, resp);
    })
    .catch((err) => "Error:", err)
};

Could you provide some feedback on how I can replicate the exact output that https.get would return but by using fetch?

TypeError: "listener" argument must be a function

I am using this library for some basic search which is working fine on aws servers and localhost as well but getting issue when deploying to firebase functions. Below is my code

        ytsr.getFilters(key, (error, filters) => {
            if (error) {
                return res.json({
                    error: "Error Occured : " + error
                });
            }

            filter = filters.get("Type").find((o) => o.name.startsWith("Video"));

            return ytsr(
                null, {
                    limit: limit,
                    nextpageRef: filter.ref,
                },
                (error, results) => {
                    if (error) {
                        return res.json({
                            error: "Error Occured : " + error
                        });
                    }

                    return res.json(results);
                }
            );
        });

Attaching screenshot as well

Annotation 2020-06-12 224251

Unknown type movie-vertical-poster

Hi there!
I'm trying to use this so useful library, with some searches my app crash with:
Error: unknown type |movie-vertical-poster|

Wouldn't be possible to just ignore new types instead of throwing?

Thank you.

Failed at func parseItem: cannot read property 'simpleText' of undefined

Getting the error as stated in the title multiple times (not always, just sometimes).
The dumps:

[
  {
    "showingResultsForRenderer": {
      "showingResultsFor": {
        "runs": [
          {
            "text": "Showing results for"
          }
        ]
      },
      "correctedQuery": {
        "runs": [
          {
            "text": "we're all in this together high "
          },
          {
            "text": "school",
            "italics": true
          },
          {
            "text": " musical"
          }
        ]
      },
      "correctedQueryEndpoint": {
        "clickTrackingParams": "CNwBEPAwGAAiEwiRzKPd_fvtAhVFj3wKHQYKBIo=",
        "commandMetadata": {
          "webCommandMetadata": {
            "url": "/results?search_query=we%27re+all+in+this+together+high+school+musical",
            "webPageType": "WEB_PAGE_TYPE_SEARCH",
            "rootVe": 4724
          }
        },
        "searchEndpoint": {
          "query": "we're all in this together high school musical"
        }
      },
      "searchInsteadFor": {
        "runs": [
          {
            "text": "Search instead for"
          }
        ]
      },
      "originalQuery": {
        "simpleText": "we're all in this together high scool musical"
      },
      "originalQueryEndpoint": {
        "clickTrackingParams": "CNwBEPAwGAAiEwiRzKPd_fvtAhVFj3wKHQYKBIo=",
        "commandMetadata": {
          "webCommandMetadata": {
            "url": "/results?search_query=we%27re+all+in+this+together+high+scool+musical&sp=QgIIAQ%253D%253D",
            "webPageType": "WEB_PAGE_TYPE_SEARCH",
            "rootVe": 4724
          }
        },
        "searchEndpoint": {
          "query": "we're all in this together high scool musical",
          "params": "QgIIAQ%3D%3D"
        }
      },
      "trackingParams": "CNwBEPAwGAAiEwiRzKPd_fvtAhVFj3wKHQYKBIo="
    }
  },
  {
    "originalQuery": "we're all in this together high scool musical ",
    "correctedQuery": "we're all in this together high scool musical ",
    "results": 97008911,
    "activeFilters": [],
    "refinements": [],
    "items": [],
    "continuation": null
  }
]
[
  {
    "showingResultsForRenderer": {
      "showingResultsFor": {
        "runs": [
          {
            "text": "Showing results for"
          }
        ]
      },
      "correctedQuery": {
        "runs": [
          {
            "text": "black eyed peas "
          },
          {
            "text": "compilation",
            "italics": true
          }
        ]
      },
      "correctedQueryEndpoint": {
        "clickTrackingParams": "CNMBEPAwGAAiEwj-rJrwqfTtAhXBnlUKHYKJCYk=",
        "commandMetadata": {
          "webCommandMetadata": {
            "url": "/results?search_query=black+eyed+peas+compilation",
            "webPageType": "WEB_PAGE_TYPE_SEARCH",
            "rootVe": 4724
          }
        },
        "searchEndpoint": {
          "query": "black eyed peas compilation"
        }
      },
      "searchInsteadFor": {
        "runs": [
          {
            "text": "Search instead for"
          }
        ]
      },
      "originalQuery": {
        "simpleText": "black eyed peas compilatieon"
      },
      "originalQueryEndpoint": {
        "clickTrackingParams": "CNMBEPAwGAAiEwj-rJrwqfTtAhXBnlUKHYKJCYk=",
        "commandMetadata": {
          "webCommandMetadata": {
            "url": "/results?search_query=black+eyed+peas+compilatieon&sp=QgIIAQ%253D%253D",
            "webPageType": "WEB_PAGE_TYPE_SEARCH",
            "rootVe": 4724
          }
        },
        "searchEndpoint": {
          "query": "black eyed peas compilatieon",
          "params": "QgIIAQ%3D%3D"
        }
      },
      "trackingParams": "CNMBEPAwGAAiEwj-rJrwqfTtAhXBnlUKHYKJCYk="
    }
  },
  {
    "originalQuery": "black eyed peas compilatieon ",
    "correctedQuery": "black eyed peas compilatieon ",
    "results": 333032,
    "activeFilters": [],
    "refinements": [],
    "items": [],
    "continuation": null
  }
]
[
  {
    "showingResultsForRenderer": {
      "showingResultsFor": {
        "runs": [
          {
            "text": "Showing results for"
          }
        ]
      },
      "correctedQuery": {
        "runs": [
          {
            "text": "shed a light robin "
          },
          {
            "text": "schulz",
            "italics": true
          }
        ]
      },
      "correctedQueryEndpoint": {
        "clickTrackingParams": "CMsBEPAwGAAiEwjfprHf5OztAhWGqXsKHSx8B1Y=",
        "commandMetadata": {
          "webCommandMetadata": {
            "url": "/results?search_query=shed+a+light+robin+schulz",
            "webPageType": "WEB_PAGE_TYPE_SEARCH",
            "rootVe": 4724
          }
        },
        "searchEndpoint": {
          "query": "shed a light robin schulz"
        }
      },
      "searchInsteadFor": {
        "runs": [
          {
            "text": "Search instead for"
          }
        ]
      },
      "originalQuery": {
        "simpleText": "shed a light robin shulz"
      },
      "originalQueryEndpoint": {
        "clickTrackingParams": "CMsBEPAwGAAiEwjfprHf5OztAhWGqXsKHSx8B1Y=",
        "commandMetadata": {
          "webCommandMetadata": {
            "url": "/results?search_query=shed+a+light+robin+shulz&sp=QgIIAQ%253D%253D",
            "webPageType": "WEB_PAGE_TYPE_SEARCH",
            "rootVe": 4724
          }
        },
        "searchEndpoint": {
          "query": "shed a light robin shulz",
          "params": "QgIIAQ%3D%3D"
        }
      },
      "trackingParams": "CMsBEPAwGAAiEwjfprHf5OztAhWGqXsKHSx8B1Y="
    }
  },
  {
    "originalQuery": "shed a light robin shulz ",
    "correctedQuery": "shed a light robin shulz ",
    "results": 48431,
    "activeFilters": [],
    "refinements": [],
    "items": [],
    "continuation": null
  }
]

ytsr is not a function

When trying to follow the example in the readme, I get an error saying "ytsr is not a function".

Running node version 10.4.1

Getting Next video

when we click next button youtube shows similar or whatever video is there a solution with this library or can it be done

Get likes dislikes count

Thanks for the awesome module!

It would be really awesome if we can get likes / dislikes count for every video.

An in-range update of eslint is breaking the build 🚨

The devDependency eslint was updated from 6.5.1 to 6.6.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details

Release Notes for v6.6.0
  • 39dfe08 Update: false positives in function-call-argument-newline (fixes #12123) (#12280) (Scott O'Hara)
  • 4d84210 Update: improve report location for no-trailing-spaces (fixes #12315) (#12477) (Milos Djermanovic)
  • c6a7745 Update: no-trailing-spaces false negatives after comments (fixes #12479) (#12480) (Milos Djermanovic)
  • 0bffe95 Fix: no-misleading-character-class crash on invalid regex (fixes #12169) (#12347) (Milos Djermanovic)
  • c6a9a3b Update: Add enforceForIndexOf option to use-isnan (fixes #12207) (#12379) (Milos Djermanovic)
  • 364877b Update: measure plugin loading time and output in debug message (#12395) (Victor Homyakov)
  • 1744fab Fix: operator-assignment removes and duplicates comments (#12485) (Milos Djermanovic)
  • 52ca11a Fix: operator-assignment invalid autofix with adjacent tokens (#12483) (Milos Djermanovic)
  • 0f6d0dc Fix: CLIEngine#addPlugin reset lastConfigArrays (fixes #12425) (#12468) (Toru Nagashima)
  • 923a8cb Chore: Fix lint failure in JSDoc comment (#12489) (Brandon Mills)
  • aac3be4 Update: Add ignored prop regex no-param-reassign (#11275) (Luke Bennett)
  • e5382d6 Chore: Remove unused parameter in dot-location (#12464) (Milos Djermanovic)
  • 49faefb Fix: no-obj-calls false positive (fixes #12437) (#12467) (Toru Nagashima)
  • b3dbd96 Fix: problematic installation issue (fixes #11018) (#12309) (Toru Nagashima)
  • cd7c29b Sponsors: Sync README with website (ESLint Jenkins)
  • 8233873 Docs: Add note about Node.js requiring SSL support (fixes #11413) (#12475) (Nicholas C. Zakas)
  • 89e8aaf Fix: improve report location for no-tabs (#12471) (Milos Djermanovic)
  • 7dffe48 Update: Enable function string option in comma-dangle (fixes #12058) (#12462) (YeonJuan)
  • e15e1f9 Docs: fix doc for no-unneeded-ternary rule (fixes #12098) (#12410) (Sam Rae)
  • b1dc58f Sponsors: Sync README with website (ESLint Jenkins)
  • 61749c9 Chore: Provide debug log for parser errors (#12474) (Brad Zacher)
  • 7c8bbe0 Update: enforceForOrderingRelations no-unsafe-negation (fixes #12163) (#12414) (Sam Rae)
  • 349ed67 Update: improve report location for no-mixed-operators (#12328) (Chiawen Chen)
  • a102eaa Fix: prefer-numeric-literals invalid autofix with adjacent tokens (#12387) (Milos Djermanovic)
  • 6e7c18d Update: enforceForNewInMemberExpressions no-extra-parens (fixes #12428) (#12436) (Milos Djermanovic)
  • 51fbbd7 Fix: array-bracket-newline consistent error with comments (fixes #12416) (#12441) (Milos Djermanovic)
  • e657d4c Fix: report full dot location in dot-location (#12452) (Milos Djermanovic)
  • 2d6e345 Update: make isSpaceBetweenTokens() ignore newline in comments (#12407) (YeonJuan)
  • 84f71de Update: remove default overrides in keyword-spacing (fixes #12369) (#12411) (YeonJuan)
  • 18a0b0e Update: improve report location for no-space-in-parens (#12364) (Chiawen Chen)
  • d61c8a5 Update: improve report location for no-multi-spaces (#12329) (Chiawen Chen)
  • 561093f Upgrade: bump inquirer to ^7.0.0 (#12440) (Joe Graham)
  • fb633b2 Chore: Add a script for testing with more control (#12444) (Eric Wang)
  • 012ec51 Sponsors: Sync README with website (ESLint Jenkins)
  • 874fe16 New: pass cwd from cli engine (#12389) (Eric Wang)
  • b962775 Update: no-self-assign should detect member expression with this (#12279) (Tibor Blenessy)
  • 02977f2 Docs: Clarify eslint:recommended semver policy (#12429) (Kevin Partington)
  • 97045ae Docs: Fixes object type for rules in "Use a Plugin" (#12409) (Daisy Develops)
  • 24ca088 Docs: Fix typo in v6 migration guide (#12412) (Benjamim Sonntag)
  • b094008 Chore: update version parameter name (#12402) (Toru Nagashima)
  • e5637ba Chore: enable jsdoc/require-description (#12365) (Kai Cataldo)
  • d31f337 Sponsors: Sync README with website (ESLint Jenkins)
  • 7ffb22f Chore: Clean up inline directive parsing (#12375) (Jordan Eldredge)
  • 84467c0 Docs: fix wrong max-depth example (fixes #11991) (#12358) (Gabriel R Sezefredo)
  • 3642342 Docs: Fix minor formatting/grammar errors (#12371) (cherryblossom000)
  • c47fa0d Docs: Fix missing word in sentence (#12361) (Dan Boulet)
  • 8108f49 Chore: enable additional eslint-plugin-jsdoc rules (#12336) (Kai Cataldo)
  • b718d2e Chore: update issue template with --eslint-fix flag (#12352) (James George)
  • 20ba14d Sponsors: Sync README with website (ESLint Jenkins)
  • 566a947 Sponsors: Sync README with website (ESLint Jenkins)
  • 070cbd0 Sponsors: Sync README with website (ESLint Jenkins)
Commits

The new version differs by 53 commits.

  • 879c373 6.6.0
  • c8ba30a Build: changelog update for 6.6.0
  • 39dfe08 Update: false positives in function-call-argument-newline (fixes #12123) (#12280)
  • 4d84210 Update: improve report location for no-trailing-spaces (fixes #12315) (#12477)
  • c6a7745 Update: no-trailing-spaces false negatives after comments (fixes #12479) (#12480)
  • 0bffe95 Fix: no-misleading-character-class crash on invalid regex (fixes #12169) (#12347)
  • c6a9a3b Update: Add enforceForIndexOf option to use-isnan (fixes #12207) (#12379)
  • 364877b Update: measure plugin loading time and output in debug message (#12395)
  • 1744fab Fix: operator-assignment removes and duplicates comments (#12485)
  • 52ca11a Fix: operator-assignment invalid autofix with adjacent tokens (#12483)
  • 0f6d0dc Fix: CLIEngine#addPlugin reset lastConfigArrays (fixes #12425) (#12468)
  • 923a8cb Chore: Fix lint failure in JSDoc comment (#12489)
  • aac3be4 Update: Add ignored prop regex no-param-reassign (#11275)
  • e5382d6 Chore: Remove unused parameter in dot-location (#12464)
  • 49faefb Fix: no-obj-calls false positive (fixes #12437) (#12467)

There are 53 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Premium Youtube videos crash Nodejs

When premium youtube videos show up in the search list of ytsr(), an uncaught exception causes program to crash.

Cause: metaInfo[0] evaluates to undefined (trying to populate the live_views const in utils.js parseVideo).

Current workaround: Added a ternary operator to default the value to 0 if metaInfo[0] is undefined.

expose regional parameters

right now the query URL is built using:
{
gl: 'US',
hl: 'en'
}
parameters.
It would be good to have an option to change those parameters.

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

nextpageRef returns null for all searches

When performing a search, the nextpageRef variable is returning null no matter what type of search I make. This seems to be a recent issue as I haven't had this problem in the past. It's possible that YouTube might have slightly changed their layout.

Thanks for the help.

failed to parse Type: Cannot read property 'runs' of undefined

Hi everyone! I hope y'all are doing well.

Anyway, I got this console log just a few minutes ago and I decided to share it.
/********************************************************************************************************************************************************************************************************
failed to parse Type: Cannot read property 'runs' of undefined
pls post the the files in C:\Users\Owner\Documents\BirdyBirdy\node_modules\ytsr\dumps to https://github.com/TimeForANinja/node-ytsr/issues
********************************************************************************************************************************************************************************************************\

Here is the file:
lvaplkghsv-1605103485674.txt

If you don't want to download the file, here is the text in the file. The search term was together forever. I intended to get the song by Rick Astley:
{
"videoRenderer": {
"videoId": "whBqghP5Oow",
"thumbnail": {
"thumbnails": [
{
"url": "https://i.ytimg.com/vi/whBqghP5Oow/hqdefault.jpg?sqp=-oaymwEjCOADEI4CSFryq4qpAxUIARUAAAAAGAElAADIQj0AgKJDeAE=&rs=AOn4CLBxNmfCSD6mflShX_nbkgDeCowkTg",
"width": 480,
"height": 270
}
]
},
"title": {
"runs": [
{
"text": "Together Forever"
}
],
"accessibility": {
"accessibilityData": {
"label": "Together Forever by Steven Universe Future Mar 14, 2020 11 minutes, 20 seconds"
}
}
},
"descriptionSnippet": {
"runs": [
{
"text": "Connie has a really clear vision for her future. Steven wants to make sure he'll be a part of it."
}
]
},
"publishedTimeText": {
"simpleText": "Mar 14, 2020"
},
"lengthText": {
"accessibility": {
"accessibilityData": {
"label": "11 minutes, 20 seconds"
}
},
"simpleText": "11:20"
},
"navigationEndpoint": {
"clickTrackingParams": "CEYQ3DAYAiITCK2M3bjU-uwCFeVvgwodLqABQDIGc2VhcmNoUhB0b2dldGhlciBmb3JldmVymgEDEPQk",
"commandMetadata": {
"webCommandMetadata": {
"url": "/watch?v=whBqghP5Oow",
"webPageType": "WEB_PAGE_TYPE_WATCH",
"rootVe": 3832
}
},
"watchEndpoint": {
"videoId": "whBqghP5Oow",
"params": "6gILR3pzM3RuNWxiT2_qAgs2ZENreDM1dGQ4QeoCC084MWx6ZmYyN29z6gILNmwyYkRhVHZvdzDqAgt4a0ZOcjdDM1Fyc-oCC0xGX1h2b0Q2WU8w6gILaGN1Qi1pNV9wdmvqAgtLdEJieWdscTM3ReoCCzF6a2xGLXNTanlr6gILUl9sMXNabWE5U3fqAgtENjNKY2RtRFJGOOoCC3NBTHV3VlJOaG5V6gILZWZSVTcydm5qQTjqAgtQc2tvLUdwczVmTeoCCzBKLV9mNG9SdVdJ6gILbDJXcTYtVzdxLTTqAgtReURKZnUzdGVuMOoCC180Y3Z6MzM4dkpR6gILSWZPd0lIbl9ubGuqAxB0b2dldGhlciBmb3JldmVyugMKCOrZlfPn9s2dG7oDCwjA77Xz95ip6OkBugMKCIvd27_fudnmO7oDCwiNxr6n2uHmruoBugMLCLuF3YX7tdOgxgG6AwoI7cHph-j39a8sugMLCPnN_vOiv-DlhQG6AwoIsb-ry6D5lugqugMLCKmeytj-osmc1wG6AwoIrOrrzJm23fxHugMKCN-IjcydrvLWD7oDCwj1jLaildi7gbABugMKCI-Ynt_2nZX6eboDCgjzy7PThp_K5D66AwsI4vLG0Pjv78_QAboDCwju1-6tvt3qspcBugMKCP30te_ur7KQQ7oDCwiU-fLv9_nLw_8BugMKCNm8_s-HhOz5IQ%3D%3D"
}
},
"badges": [
{
"metadataBadgeRenderer": {
"style": "BADGE_STYLE_TYPE_YPC",
"label": "Buy",
"trackingParams": "CEYQ3DAYAiITCK2M3bjU-uwCFeVvgwodLqABQA=="
}
},
{
"metadataBadgeRenderer": {
"style": "BADGE_STYLE_TYPE_SIMPLE",
"label": "CC",
"trackingParams": "CEYQ3DAYAiITCK2M3bjU-uwCFeVvgwodLqABQA=="
}
}
],
"trackingParams": "CEYQ3DAYAiITCK2M3bjU-uwCFeVvgwodLqABQECM9eSfodCaiMIB",
"showActionMenu": false,
"menu": {
"menuRenderer": {
"items": [
{
"menuServiceItemRenderer": {
"text": {
"runs": [
{
"text": "Add to queue"
}
]
},
"icon": {
"iconType": "ADD_TO_QUEUE_TAIL"
},
"serviceEndpoint": {
"clickTrackingParams": "CEkQ_pgEGAYiEwitjN241PrsAhXlb4MKHS6gAUA=",
"commandMetadata": {
"webCommandMetadata": {
"url": "/service_ajax",
"sendPost": true
}
},
"signalServiceEndpoint": {
"signal": "CLIENT_SIGNAL",
"actions": [
{
"clickTrackingParams": "CEkQ_pgEGAYiEwitjN241PrsAhXlb4MKHS6gAUA=",
"addToPlaylistCommand": {
"openMiniplayer": true,
"videoId": "whBqghP5Oow",
"listType": "PLAYLIST_EDIT_LIST_TYPE_QUEUE",
"onCreateListCommand": {
"clickTrackingParams": "CEkQ_pgEGAYiEwitjN241PrsAhXlb4MKHS6gAUA=",
"commandMetadata": {
"webCommandMetadata": {
"url": "/service_ajax",
"sendPost": true,
"apiUrl": "/youtubei/v1/playlist/create"
}
},
"createPlaylistServiceEndpoint": {
"videoIds": [
"whBqghP5Oow"
],
"params": "CAQ%3D"
}
},
"videoIds": [
"whBqghP5Oow"
]
}
}
]
}
},
"trackingParams": "CEkQ_pgEGAYiEwitjN241PrsAhXlb4MKHS6gAUA="
}
}
],
"trackingParams": "CEYQ3DAYAiITCK2M3bjU-uwCFeVvgwodLqABQA==",
"accessibility": {
"accessibilityData": {
"label": "Action menu"
}
}
}
},
"channelThumbnailSupportedRenderers": {
"channelThumbnailWithLinkRenderer": {
"thumbnail": {
"thumbnails": [
{
"url": "https://yt3.ggpht.com/a-/AOh14GjOv2j8NB3mMxwZD8dsCfCUZea07o71MUrrzQ=s68-c-k-c0x00ffffff-no-rj-mo",
"width": 68,
"height": 68
}
]
},
"navigationEndpoint": {
"clickTrackingParams": "CEYQ3DAYAiITCK2M3bjU-uwCFeVvgwodLqABQA==",
"commandMetadata": {
"webCommandMetadata": {
"url": "/channel/UCMRBAbzuBje-TgPdkyYuLfg",
"webPageType": "WEB_PAGE_TYPE_CHANNEL",
"rootVe": 3611
}
},
"browseEndpoint": {
"browseId": "UCMRBAbzuBje-TgPdkyYuLfg"
}
},
"accessibility": {
"accessibilityData": {
"label": "Go to channel"
}
}
}
},
"thumbnailOverlays": [
{
"thumbnailOverlayTimeStatusRenderer": {
"text": {
"accessibility": {
"accessibilityData": {
"label": "11 minutes, 20 seconds"
}
},
"simpleText": "11:20"
},
"style": "DEFAULT"
}
},
{
"thumbnailOverlayToggleButtonRenderer": {
"isToggled": false,
"untoggledIcon": {
"iconType": "WATCH_LATER"
},
"toggledIcon": {
"iconType": "CHECK"
},
"untoggledTooltip": "Watch later",
"toggledTooltip": "Added",
"untoggledServiceEndpoint": {
"clickTrackingParams": "CEgQ-ecDGAMiEwitjN241PrsAhXlb4MKHS6gAUA=",
"commandMetadata": {
"webCommandMetadata": {
"url": "/service_ajax",
"sendPost": true,
"apiUrl": "/youtubei/v1/browse/edit_playlist"
}
},
"playlistEditEndpoint": {
"playlistId": "WL",
"actions": [
{
"addedVideoId": "whBqghP5Oow",
"action": "ACTION_ADD_VIDEO"
}
]
}
},
"toggledServiceEndpoint": {
"clickTrackingParams": "CEgQ-ecDGAMiEwitjN241PrsAhXlb4MKHS6gAUA=",
"commandMetadata": {
"webCommandMetadata": {
"url": "/service_ajax",
"sendPost": true,
"apiUrl": "/youtubei/v1/browse/edit_playlist"
}
},
"playlistEditEndpoint": {
"playlistId": "WL",
"actions": [
{
"action": "ACTION_REMOVE_VIDEO_BY_VIDEO_ID",
"removedVideoId": "whBqghP5Oow"
}
]
}
},
"untoggledAccessibility": {
"accessibilityData": {
"label": "Watch later"
}
},
"toggledAccessibility": {
"accessibilityData": {
"label": "Added"
}
},
"trackingParams": "CEgQ-ecDGAMiEwitjN241PrsAhXlb4MKHS6gAUA="
}
},
{
"thumbnailOverlayToggleButtonRenderer": {
"untoggledIcon": {
"iconType": "ADD_TO_QUEUE_TAIL"
},
"toggledIcon": {
"iconType": "PLAYLIST_ADD_CHECK"
},
"untoggledTooltip": "Add to queue",
"toggledTooltip": "Added",
"untoggledServiceEndpoint": {
"clickTrackingParams": "CEcQx-wEGAQiEwitjN241PrsAhXlb4MKHS6gAUA=",
"commandMetadata": {
"webCommandMetadata": {
"url": "/service_ajax",
"sendPost": true
}
},
"signalServiceEndpoint": {
"signal": "CLIENT_SIGNAL",
"actions": [
{
"clickTrackingParams": "CEcQx-wEGAQiEwitjN241PrsAhXlb4MKHS6gAUA=",
"addToPlaylistCommand": {
"openMiniplayer": true,
"videoId": "whBqghP5Oow",
"listType": "PLAYLIST_EDIT_LIST_TYPE_QUEUE",
"onCreateListCommand": {
"clickTrackingParams": "CEcQx-wEGAQiEwitjN241PrsAhXlb4MKHS6gAUA=",
"commandMetadata": {
"webCommandMetadata": {
"url": "/service_ajax",
"sendPost": true,
"apiUrl": "/youtubei/v1/playlist/create"
}
},
"createPlaylistServiceEndpoint": {
"videoIds": [
"whBqghP5Oow"
],
"params": "CAQ%3D"
}
},
"videoIds": [
"whBqghP5Oow"
]
}
}
]
}
},
"untoggledAccessibility": {
"accessibilityData": {
"label": "Add to queue"
}
},
"toggledAccessibility": {
"accessibilityData": {
"label": "Added"
}
},
"trackingParams": "CEcQx-wEGAQiEwitjN241PrsAhXlb4MKHS6gAUA="
}
},
{
"thumbnailOverlayNowPlayingRenderer": {
"text": {
"runs": [
{
"text": "Now playing"
}
]
}
}
}
],
"topStandaloneBadge": {
"metadataBadgeRenderer": {
"style": "BADGE_STYLE_TYPE_COLLECTION",
"label": "Steven Universe Future  S1 • E13",
"trackingParams": "CEYQ3DAYAiITCK2M3bjU-uwCFeVvgwodLqABQA=="
}
}
}
}

Missing safe search results

@TimeForANinja I need a safe search option for results. But currently, I didn't see an option for that.
It really helps people who need to filter out safe results. Is there any workaround for this?

getFilters function is not in typings

The ytsr.getFilters() function described here is not present in the typings and can't be used with TypeScript.
Thank you for your work and I hope it can be fixed soon!

Two (three) dumps

Hello, today I got 2 dumps while using ytsr. Unfortunately, I didn’t know what the problems they were entailing, because it appeared while other people were using my bot. Perhaps they have something you need, so at the 'request of your console error', I created this issue

/********************************************************************************************************************************************************************************************************
found an unknwon type |||
pls post the the files in ...node_modules/ytsr/dumps to https://github.com/TimeForANinja/node-ytsr/issues
********************************************************************************************************************************************************************************************************\

(I also attached a dump two weeks ago)
dumps.zip

Cannot read property 'contents' of undefined

  • Node.js v14
  • ytsr v3.2.3

Case1

TypeError: Cannot read property 'contents' of undefined
    at module.exports (/home/bot/node_modules/ytsr/lib/main.js:54:28)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

const rawItems = wrapper.contents

Code used

await ytsr('word', { limit: 10 });

Case2

TypeError: Cannot read property 'subMenu' of undefined
    at Object.exports.parseFilters (/home/bot/node_modules/ytsr/lib/utils.js:21:33)
    at AsyncFunction.main.getFilters (/home/bot/node_modules/ytsr/lib/main.js:143:15)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

const filterWrapper = wrapper.subMenu.searchSubMenuRenderer.groups;

Code used

await ytsr.getFilters('word');

It doesn't seem to be a specific word problem, and it's occasionally happening.

Change how HTTP requests are done to be compatible with stream-http

When trying to browserify ytsr, I noticed that the way ytsr makes http requests, while correct, is not supported by stream-http, the "shim" used by webpack and browserify to mimick the nodejs module.

I reported a bug to them: jhiesey/stream-http#116

A small change would make it compatible. In utils.js, replace:
const request = HTTPS.get(ref, options, resp => {

With

options = Object.assign(URL.parse(ref), options);
const request = HTTPS.get(options, resp => {

Would that be ok for you?

Limit question

Can you please explain how limit works?

If we put some insane number like 1,000 or so - will the module break this number on smaller chunks and parse youtube by pages automatically?

Is there any possibility that youtube will rate-limit such big numbers on its side? Or there is some prevention mechanism in ystr like timeouts between queries or so?

Thanks in advance.

Type mix missing links

Hi, I'm getting the following return when the type is mix

{
  firstItem: "https://www.youtube.com/watch?v=&list="
  length: "50+ videos"
  thumbnail: "https://i.ytimg.com/vi/htKY2oD85rs/hqdefault.jpg?sqp=-oaymwEXCPYBEIoBSFryq4qpAwkIARUAAIhCGAE=&rs=AOn4CLAZ9j2JBI2XX0P5RsP8EbXGPE0RKA"
  title: "Mix - HAMMERFALL - Hearts On Fire (OFFICIAL MUSIC VIDEO)"
  type: "mix"
}

As you can see, there's no link prop and firstItem has no video or list id.

BTW, thanks for this great lib.

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.