Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Second argument to Function.prototype.apply must be an array. (ligne 45, fichier "Code") #23

Closed
Flavien06 opened this issue Feb 20, 2018 · 27 comments

Comments

@Flavien06
Copy link

Hi
I use the script for some days
It worked for the first few days and without changing anything I have the following error:

TypeError: Second argument to Function.prototype.apply must be an array. (ligne 45, fichier "Code")

@Elijas
Copy link
Owner

Elijas commented Feb 20, 2018

Just making sure if you did this already:
Resources > Developers Console Project > Click the link to your API console project > On the left, APIs & Auth > APIs > YouTube Data API > Enable API

@Flavien06
Copy link
Author

Flavien06 commented Feb 20, 2018

Yes, I have already activated "YouTube Data API v3" on https://console.cloud.google.com

@deepfriedmind
Copy link
Contributor

I've been getting the same error since a few days ago. Did you find a fix?

@Fabian42
Copy link
Contributor

Fabian42 commented Mar 17, 2019 via email

@Fabian42
Copy link
Contributor

Fabian42 commented Mar 17, 2019 via email

@deepfriedmind
Copy link
Contributor

Actually, I only get this error when using the ALL keyword. If I just input a playlist ID and a channel ID, it finishes without errors but doesn't actually add any videos.

@Fabian42
Copy link
Contributor

Oh, I didn't notice what report I was commenting on: Yes, I also got this error and it went away when I replaced "all" with the individual channel IDs, then it gave this "property of undefined" error instead. So, @deepfriedmind, yes, I found a potential workaround, maybe it works for you.

@deepfriedmind
Copy link
Contributor

Like I said, if I just input a playlist ID and a channel ID, it finishes without errors but doesn't actually add any videos. I guess it's the same issue as #26.

@deepfriedmind
Copy link
Contributor

deepfriedmind commented Mar 17, 2019

I looked in the log and noticed ERROR: API call to youtube.search.list failed with error: Daily Limit Exceeded. I now see that my daily queries have risen astronomically and exceed the limit of 1,000,001. I have a trigger set to run the script every hour and haven't been close to reach the limit before.

@jcrbcn
Copy link

jcrbcn commented Aug 5, 2019

Still no fix for this? Has the YouTube API changed or something?

@victorjzsun
Copy link
Collaborator

victorjzsun commented Sep 15, 2019

Stuff from Mar 17th is due to YT taking their search down. This should be fixed now so this should no longer pose as an issue. For the first error mentioned above, seems like that code is outdated. Is the issue still there? @Flavien06

@Capacino
Copy link

I get this error as well, and it only happens when i use "ALL" keyword. I also don't get any videos added when i put a channel or playlist id instead of "ALL."

@victorjzsun
Copy link
Collaborator

Hi @Capacino, thanks for your input.

I'm not too sure why you're still getting this issue, as I can still use the script with no problems.

First off, make sure you've done this

To help you debug the program, can you please replace the script in your sheet with this one on my new branch, which has a better error checking and handling. If you don't know how to access the script, on your Google Sheet, go to Tools -> Script Editor. Then, run the function through the Sheets UI as normal, and once it finishes, look at the Debug sheet that will be generated.

@Capacino
Copy link

@dudemario, so when i input your updated script, the error with "ALL" keyword stopped. The first time i ran the script it added some of the videos and seemed like it works. But when i ran it a couple of hours later it gave this error in the logs: https://imgur.com/a/1kb6LyR

@victorjzsun
Copy link
Collaborator

victorjzsun commented Sep 25, 2019

How many subs do you have? Can you try going back in history to see if the debug sheet had an "Acquired subscriptions (number of subs)" that equals the number you have?

In fact, you might have more errors in the debug sheet from before that might expose other bugs, so if you can take a look that'd be great.

If you don't have that many channels, can you change line 10 to be var debugFlag_logWhenNoNewVideosFound = true; to add more logs when running it again hopefully after the quota refills.

@Capacino
Copy link

So i have over 76 on the current youtube account i'm using. When the script ran it did say that it acquired all 76 subscriptions. Then after that it always puts the over quota error. Does the script have a limit to how many videos and/or subscribers it can pull from?

@victorjzsun
Copy link
Collaborator

victorjzsun commented Sep 25, 2019

How many quota errors do you see? I'll do some testing. If there aren't that many videos it shouldn't pass the quota that fast.

@JesperDramsch
Copy link
Collaborator

I copied the new log script too. Worked real good first time. Then only returns empty.

When I turn the debug flag on, no channel has new video, regardless whether they do or not. (Played around with timestamps too to no avail)

@Capacino
Copy link

Capacino commented Sep 29, 2019

So I've been messing around with the number of channels i could get videos from. And currently it's best to avoid using the ALL keyword if you have more than 50+ channels as it takes up too many of the api calls maxing out your quota for the day. Just copying the channel IDs your subbed to is much less calls to the api. The upper limit of what I've tested is 75 channels at 1 previous day timestamp. Other than that, the script works perfectly.

@victorjzsun
Copy link
Collaborator

@JesperDramsch and others, the script is working perfectly due to YouTube's API being a bit broken as mentioned in this issue, which can be tested using their API explorer page. (This especially affects vids released within the last 24h). I'll see what I can fix in the meantime, but if vids are not getting added, this might be the cause

@victorjzsun
Copy link
Collaborator

As mentioned in #41 YouTube's API has pretty much been fixed, so the script should be working fine now. @JesperDramsch can you check if you're still encountering the same issue? Pushed a new set of changes to the debug branch (even more logging) so try using this new version.

@JesperDramsch
Copy link
Collaborator

Works again as also mentioned in #41. I'll check out the debug branch

@JesperDramsch
Copy link
Collaborator

@dudemario Checked it out. I like it, except for the proposed change in #45

@victorjzsun
Copy link
Collaborator

@Capacino Do you still have quota error? If you go to the link that the quota error provides, what's your quota limit?

@Capacino
Copy link

Capacino commented Oct 3, 2019

@dudemario No i don't get the quota error anymore. I just split my 400+ subscriptions across 6 google accounts and it works perfectly. I think more than 100 subscribers makes you hit the quota easily.

@JesperDramsch
Copy link
Collaborator

I have 150 subscriptions, but they're not daily vloggers.

@victorjzsun
Copy link
Collaborator

Closing this after implementing changes to script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants