Comments (15)
Not sure if this is helpful, but it turned out to be really easy to just move my YouTube brand account to a personal Google. Then the script worked great (minus hitting my quota). Thanks for making this tool.
YouTube Help: Move your YouTube channel to another account
from auto-youtube-subscription-playlist-2.
I removed that second step, as you're right, it is default now.
Regarding the error, according to documentation, the Forbidden
error occurs when either The playlist already contains the maximum allowed number of items
or The request is not properly authorized to insert the specified playlist item
. Can you please check both of these?
from auto-youtube-subscription-playlist-2.
The new (target) playlist was empty. How do I check the proper authorization?
from auto-youtube-subscription-playlist-2.
As in make sure that you own the playlist (there might be some conflict if you're trying to add to another user's playlist). Make sure that the playlist ID you put into the first column of the sheet does indeed point to the right playlist by going to the link https://www.youtube.com/playlist?list=[yourplaylistIDhere]
replacing [yourplaylistIDhere]
with the actual ID.
from auto-youtube-subscription-playlist-2.
I've also pushed a new change to the sheets script (to log more details on API fail errors) so if you could update your script in the script editor and post the result, that'd be great.
from auto-youtube-subscription-playlist-2.
Thanks for the administration.
I copied the sheet freshly from the github starting page, granted access and the script ran. It failed with the following error.
Tue Nov 05 22:46:43 EET 2019 | Acquired 1 videos |
---|---|
Tue Nov 05 22:46:43 EET 2019 | Couldn't update playlist with video (XB8sV_DMFDE), ERROR: Message: [API call to youtube.playlistItems.insert failed with error: Forbidden] Details: {"message":"Forbidden","code":403,"errors":[{"domain":"youtube.playlistItem","reason":"playlistItemsNotAccessible","message":"Forbidden"}]} |
Tue Nov 05 22:46:43 EET 2019 | Added 0 videos to playlist. Error for 1 videos. |
See the attachments for my setup.
from auto-youtube-subscription-playlist-2.
One thing I'm noting is that the account you're using for the sheet is not the same as the YT account with the playlist (Purple A vs Dog profile icon). Please use the same account as the one that owns the playlist since there might be some complications with using a different account to add videos
from auto-youtube-subscription-playlist-2.
That may be the issue. However, the dog profile is my brand account (under the A account) which I've been using for several years and I'm kind of dependent on it. I'd like to avoid a migration to the A account, since I've been using the dog account for many years (playlists, subscriptions, comments and so on are connected to it). I'm going to verify that this is the problem and think about migrating. On the other hand I'd appreciate it very much, if you could find a way to support brand accounts.
from auto-youtube-subscription-playlist-2.
That's interesting, and it seems like the reason why it's giving a forbidden error. Brand accounts are completely separate from the personal accounts associated with them, so permissions are not transferable.
According to this post, you can try logging into Google Drive/Sheets using that brand account and run the script under that account instead of the "A" account. This will be a temporary solution until I can figure out exactly how permissions work between playlists and if I can find a better solution than switching accounts. I'll see what I can do.
from auto-youtube-subscription-playlist-2.
I have the feeling the StackOverflow answer is outdated. I can't choose Google Drive as an product at https://myaccount.google.com when signed in as my brand. And I haven't found a way yet to log in with the mentioned @pages.plusgoogle.com address to Google Drive directly. It tells me I have the wrong password, when I'm using the A account's password. I contacted the StackOverflow user for advice.
from auto-youtube-subscription-playlist-2.
I have the feeling the StackOverflow answer is outdated. I can't choose Google Drive as an product at https://myaccount.google.com when signed in as my brand. And I haven't found a way yet to log in with the mentioned @pages.plusgoogle.com address to Google Drive directly. It tells me I have the wrong password, when I'm using the A account's password. I contacted the StackOverflow user for advice.
I can't find a way to login to google drive with the brand account. I assume google scrapped this feature together with google plus.
from auto-youtube-subscription-playlist-2.
I tried the method of generating a refresh token as mentioned in this Stackoverflow post about YouTube APIs, but I am a novice with regards to scripting, working with APIs, etc.
How would I incorporate a generated refresh token into this script to make it work for a YouTube brand account?
from auto-youtube-subscription-playlist-2.
That would be pretty difficult and hard to automate without creating a whole new standalone app. I was able to generate a token for a brand account and then use that token to request data from an API, but I cannot do so using a google app such as Google Apps Script, since such an app restricts the caller of the script to be the main account and not a brand account. Basically, since google doesn't allow anyone to sign into a script with a brand account, we'd need to create a whole sign-in architecture that allows for brand accounts.
For anyone who still wants to dive deeper into this issue, here's the process for creating a brand account token:
- Set up an
Desktop App
oauth client id/secret to a project as described here - Send a request to
https://accounts.google.com/o/oauth2/v2/auth
as described here, passing the client id generated above and setting theredirect_uri
tourn:ietf:wg:oauth:2.0:oob
for manual copy and paste of auth code. Make sure to provide the API scopes you need and setrequest_type
tocode
This can be done with a formatted request on a browser, an app like Postman won't work because the sign-in dialog box is returned - Sign in to the dialog provided using the brand account, accept all the conditions and then copy the auth code that's given to you.
- Send a request to
https://oauth2.googleapis.com/token
as described here, passing in the auth code you got from above, as well as client id/secret, and specifyinggrant_type=authorization_code
. Again, setredirect_uri
tourn:ietf:wg:oauth:2.0:oob
to get the token manually. - Copy the token from the response and now you have a valid auth token to use (for now).
In terms of how to use this token, at least to test if it works, just send a request to any Google API with an auth header with your token and it should work. To run an Apps Script, the only way I can see is by using something like clasp to run the script remotely using a certain set of credentials (your generated token), but I have yet to see if this works.
from auto-youtube-subscription-playlist-2.
Long story short, if we wanted to do something about it, we might as well be Google employees
from auto-youtube-subscription-playlist-2.
Hi, here is the solution https://stackoverflow.com/a/64902884/7484338
from auto-youtube-subscription-playlist-2.
Related Issues (20)
- Error: No empty spots HOT 3
- Time Based Trigger No Longer Working HOT 5
- TypeError: Cannot read property '1' of undefined HOT 7
- Videos being repeatedly added to playlist HOT 3
- 3 seperate youtube accounts deleted for spam using this script? HOT 3
- Delete old videos option not working HOT 8
- error adding videos HOT 5
- Silly Question HOT 11
- Feature request: Exclude "shorts" respectively short videos not longer than x minutes/seconds HOT 10
- I can't authorize sending emails HOT 2
- No New Videos for certain playlists HOT 3
- Feature: filters by tag, name, lenght HOT 1
- Feature Request: Skip All Vertical Videos Such As "YouTube Shorts" HOT 2
- No error when input playlist empty HOT 1
- Can't update Watch Later HOT 2
- Update in batches (x days) HOT 3
- Add Videos Between Two Dates.
- Compare dates instead of date strings HOT 1
- Filter upcoming videos
- im not getting any video in my playlist HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from auto-youtube-subscription-playlist-2.