Coder Social home page Coder Social logo

elijas / auto-youtube-subscription-playlist-2 Goto Github PK

View Code? Open in Web Editor NEW
247.0 29.0 54.0 240 KB

Script automatically adds videos to playlists from Youtube channels and/or subscriptions (Youtube Collections alternative).

License: MIT License

JavaScript 94.94% HTML 5.06%
youtube-playlist youtube-api youtube-api-v3 youtube-channel youtube-channel-crawler google-script automation playlist-generator playlist-maker youtube

auto-youtube-subscription-playlist-2's Introduction

Description

This is a Google Apps Script that automatically adds new Youtube videos to playlists (a replacement for Youtube Collections feature).

This is done using Google Sheets for interface, Google Script + Youtube API v3 for executing and scheduling.

(Older version here)

Features

  • Add all new videos to Youtube playlists (uploaded later than some date);

    • from all subscribed channels;

    • from any list of channels (by channel ID);

    • from any other playlist (by playlist ID);

  • Set automatic interval for updates (optional);

  • Deploy as a web app to update or show playlist (optional);

  • Remove videos in the playlists that are older than a certain number of days before the execution of the script (optional).

  • Remove videos less than 1 minute in length (e.g. shorts) (optional)

(Extra) Scripts to easily remove multiple items from a youtube playlist here

Where to get help

issuehunt

If you ran into problems, here are some of the possible sources for solutions:

  • Troubleshooting section at the end of this README
  • Issues board in GitHub
  • Community support forum: Official Message Board
  • 3rd party copies of the project (Forks)
    • If you'd like improve the code yourself: some issues were introduced with merges from 3rd party forks. Last commit before the merges can be found here

Set-up Instructions

  1. Copy the Sheet to your Google Drive. Afterwards you might want to update the script to the latest version of sheetScript.gs

  2. Setup your playlists and channels (white cells in the Sheet):

  • Clear all existing white rows, they are just examples (i.e. delete the 3 rows).
  • For each new playlist you want to use:
    • In a new row:
    • Add your Playlist ID in the first white column (you can find it in the URLs of your playlists, after ?list=)
    • Add your Channels (in other white columns of the same row) (Example of a successful set-up, from user topdogmsn)
      • Any of the following:
      • User ID (last part (after last /) in https://www.youtube.com/user/someusername)
      • Channel ID (last part (after last /) in https://www.youtube.com/channel/UCzMVH2jEyEwXPBvyht8xQNw)
      • Playlist ID (last part (after ?list= in https://www.youtube.com/playlist?list=PLd0LhgZxFkVKh_JNXcdHoPYo832Wu9fub)
      • ALL, to add all new videos from all of your subscriptions
      • NOTE: custom URLs cannnot be used (i.e. the last part of https://www.youtube.com/c/skate702). Please get the channel's ID as described in the Troubleshooting section under Cannot query for user <USERNAME>
    • Optionally add a number of days in column C. The playlist in this row will not be updated until that many days have passed.
    • Optionally add a number of days in column D. Videos in the playlist that have been published that many days before are going to be removed from the playlist.
    • Optionally add No to column E to remove all new videos under 1 minute in length from being added to the playlist.
  1. Run the script:

    • In Sheet's menu: YouTube Controls / Update Playlists
    • Grant access in the dialog
  2. (Optional) Adjust Timezone:

    • In menu (of the Sheet): Extensions / Apps Script
    • If you don't see an appsscript.json file in the editor, got to Project Settings tab and select Show "appsscript.json" manifest file in editor
    • Select appsscript.json in the editor
    • Change the string after timeZone to your timezone. Pick one from this list image
    • Save Project/Ctrl+S

Usage

Manual playlist update:
  1. Open the Google Sheet, then in menu: Functions / Update Playlists. (Notice: when used first time, only a timestamp will be added (prevents overflow with old videos)).
Scheduled playlist update:
  1. In menu (of the Sheet): Extensions / Apps Script
  2. Go to Triggers tab
  3. Press the blue button in the lower right corner + Add Trigger
  4. Select updatePlaylists -> Head -> Time driven -> Hour timer -> Every hour
  5. Save
Deploy as a web app:
  1. In menu (of the Sheet): Extensions / Apps Script
  2. Click on Deploy -> New Deployment
  3. Use the cog beside Select type. Ensure web app is selected.
  4. Click Deploy (you will get a special link to use)
  5. Optional - create a tiny.cc redirect link for easy acess (tiny.cc is recommended as it allows you to pass parameters to the url)
  6. Usage: append ?pl=N to select the Nth playlist in the spreadsheet.
  • append ?update=True to force update all the playlists.
  • e.g. tiny.cc/myplaylist?update=True&pl=3 will force update and open the third playlist.

Update script

Often, changes will be made to the script which you will need to add to your copy of the sheet. There are two ways to do this:

  1. Get a new copy of the sheet and copy your data from your old one to the new one
  2. Edit the script in your existing sheet:
    • In menu (of the sheet) click on: Extensions / Apps Script
    • Replace the script (Code.gs) with the new script found here

FAQ

Q: I followed the instructions and nothing happened?

A: Only videos that are uploaded after the first run of the script are added (i.e. the timestamp is set to current date). New videos should be up. Alternatively, you can modify the timestamp yourself.

Q: How to temporarily pause updating only some of the channels?

A: Cut (or delete) the contents of the playlist ID cell in the row you want to pause.

Q: I want to say thanks!

A: Feel free to buy me a cup of coffee here: Donate. Although, I'd appreciate even more if you could help support other users and/or create pull requests for fixes and improvements!

ko-fi

Q: I have more questions.

A: See Feedback section below.

Troubleshooting

Q: Google keeps asking to authorize, even when I did so.

A: A known fix is to use an account with Gmail, YouTube accounts are known to have this issue. Notice that you will only be able to use the playlists accessible by the authorized account (i.e. your 'Gmail' account in YouTube site).

Q: I get this error: TypeError: Second argument to Function.prototype.apply must be an array. (line 27, file "")

A: Do the step laid out in the instructions above: go to Resources > Developers Console Project > Click the link to your API console project > On the left, APIs & Auth > APIs > YouTube Data API > Enable API. (thanks to josn0w and theit8514, also nmgoh and saso5tr)

A: See https://stackoverflow.com/a/48912679/1544154 (thanks to LPanic)

Q: I get this error: TypeError: Cannot read property "items" from undefined. (line 169, file "Code")

A: If it only happens sometimes, it can be safely ignored, the next round will work normal again. If it happens on every execution, check your playlist and channel IDs. The script stops working if any of your playlists or channels doesn't exist, for example because it was deleted.

Q: I get Quota or Cannot (Search) YouTube errors

A: Make sure the sheet can access YouTube's API:

  • Open the Script Editor (in menu: Extensions / Apps Script) of the Sheet
    • Under the Services section, make sure YouTube is there, otherwise use the plus button beside Services and search for YouTube Data API v3.
  • Close the Developers Console and Script Editor, open the Sheet again
Q: I get this error: Cannot query for user <USERNAME> where <USERNAME> is the channel's username found in the channel's shortened URL (i.e. youtube.com/c/<USERNAME> or youtube.com/user/<USERNAME> or youtube.com/@<USERNAME>

In the sheet, channel usernames and custom URLs cannot be used, only channel ids. To get a channel id for a specific channel, use the Get Channel ID function in the custom menu. After inputting a channel's name and hitting Ok, it will give you channel URLs to verify it has found the right one. Once it's correct, click Yes and it will give you the channel ID, which you should then copy and paste into the spreadsheet.

Q: I want to experiment with the error further

A: Copy-paste the contents of the debug.gs file into your Script Editor

Q: I have more questions.

A: See Feedback section below.

Feedback

Github Issue Board

Official Reddit Thread

Official Message Board

auto-youtube-subscription-playlist-2's People

Contributors

danilose avatar deepfriedmind avatar elijas avatar evertonbatini avatar fabian42 avatar jesperdramsch avatar logicer16 avatar michalpawl avatar pekapa avatar raleph avatar sinasab avatar victorjzsun 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

auto-youtube-subscription-playlist-2's Issues

TimeStamp Updated when Daily Quota Reached

I've got the script running and it added the videos from the last day. When trying to add videos from a week ago, I got the following error:

Jan 4, 2020, 9:00:31 PM Error Error: 90 videos were not added to playlist correctly, please check Debug sheet. Timestamp has not been updated.
at updatePlaylists(Code:151)
at insideUpdate(Code:427)

Upon checking the debug sheet, I saw that I was hitting the Youtube API quota limit. I tried running Update Playlists again, but this time the the script logged that I've hit the Daily Quota Limit, however, it still updated the TimeStamp.

I'm thinking that any quota related error should mean the time stamp is not updated.

Script successfully finished, but no video's added to playlist

So the script itself says that it ran successfully and that it added a couple of video's, but when I look at my watch later playlist, there are no video's added. I tried the older and updated version of the script, but I got the same result. Also my watch later playlist says that it updated today.
1
2
3
4

Just a typo on the app...

I literally found this like 5 minutes ago (yougather.xyz) and i'm super excited to give this a try.

I found a typo... when the page is loading, it says:

Found 473 channels.
Playlists using subscritptions will be updated accordingly.

Thanks!

Script doesn't work with empty channels

There are a few channels that I added to my script to see if they ever upload videos. One example is this one: https://www.youtube.com/channel/UCAqzgFGOss0mFN0OUKkdqMw/videos
When I add "UCAqzgFGOss0mFN0OUKkdqMw" to the sheet, I get this error message now:

Cannot search YouTube with playlist id UU2ynvCFT085PuHzwG0xO8nA, ERROR: Message: [API call to youtube.playlistItems.list failed with error: The playlist identified with the request's playlistId parameter cannot be found.] Details: {"code":404,"message":"The playlist identified with the request's playlistId parameter cannot be found.","errors":[{"reason":"playlistNotFound","location":"playlistId","locationType":"parameter","domain":"youtube.playlistItem","message":"The playlist identified with the request's playlistId parameter cannot be found."}]}

This did not use to happen, so I assume some YouTube API change broke it. It also happens with channels that used to have videos, but no longer do. The "<code>" tags are part of the error message, but get parsed by Github as markdown. I guess that's intentional.

Better error Handling

On the first run, I didn't change any value in the spreadsheet so the script wasn't able to find the playlist it is written by default and it came up with an "undefined variable.items.length"

So maybe better handle error when a playlist cannot be found.

Thanks, awesome scripts!

Error when deploying webapp

Hi,

when trying to deploy the script as a web app I get following error:

Exception: No HTML file named index was found. (line 481, file "Code")

Thx for your help

Filter by title

Is there a way - and I believe it would have to be done in function getVideoIdsWithLessQueries to filter videos by title so only videos containing a certain phrase would be included into the playlist?

Cannot query for user RedstoneQuarry

I recently added "RedstoneQuarry" to the sheet for this channel: https://www.youtube.com/c/RedstoneQuarry/videos
Since then, it got stuck on that entry with the debug sheet message "Cannot query for user RedstoneQuarry".
When I use "UUW_OAaMdUH3fF00fh8_Koeg" instead, which is the playlist ID of their automatic "all uploads" playlist, that fails with "Cannot query for user UUW_OAaMdUH3fF00fh8_Koeg". Only the channel ID, which is "UCW_OAaMdUH3fF00fh8_Koeg" (C as second character) works, which can apparently only be obtained by saving the HTML source of the channel page and finding the »"externalId":"UCW_OAaMdUH3fF00fh8_Koeg"« element in some long JSON object (or maybe it's always the playlist ID, but with a C?).
Other short channel URLs, like "slicedlime", "TheHappieCat" or "SiberianHat" work fine.

Seems to skip (some?) videos that are uploaded while the channel is streaming

This channel has a 24/7 music stream: https://www.youtube.com/user/epicmusicvn/videos
But they also upload regular videos. Recently one video got added to my playlist, but two days ago one was skipped.
The most logical explanation seems to be that the script ignores everything as long as a stream is running so that it doesn't keep adding old, deleted streams. And that the channel had a brief stream pause when it published one of the videos, but not for the other. But I don't know for sure.

Script updatePlaylists experienced an error

When running Update Playlist function as usual, after 3-4 seconds of running the script get an error: Script updatePlaylists experienced an error. I didn't change anything and it was running well for more than a year prior. Anyone with similar issue?

Cannot find function toString in object

The script failed 24 out of 24 times yesterday, with the following error:

TypeError: Cannot find function toString in object {year=2019, month=2, day-of-month=13, day-of-week=3, week-of-year=7, hour=21, minute=34, second=58, timezone=UTC, authMode=FULL, triggerUid=1232464547}. (line 17, file "Code")

A pointer what to do would be nice. I've checked the channels and playlists, they all exist. I would like to avoid debugging a program in a language that I don't know again. :D

Hitting Daily Quota limit after first execution

Upon first execution of the Updateplaylist function (after the timestamp is settled) videos will add. However, any attempt to update the sheet afterwards results in the following error: "API call to youtube.playlistItems.insert failed with error: Daily Limit Exceeded."

I've tried to access the quota and view the project, but every time I follow the link it says "failed to load". Is there something I'm missing in the setup to allow me to access the project? Should I try to manually setup the spreadsheet and script vs copying the sheet to see if that resolves the issues?

Strange mail from YouTube, maybe related to this script?

I got mails from YouTube that asked me to fill in "YouTube API compliance audits". After contacting various semi-helpful Google support chats/phone numbers, I got a suspicion that this might be caused by this script.
Has anyone else experienced this and maybe even knows how to handle this? Apparently YouTube now imposed additional limits to my API usage. I didn't see any major issues so far from that, but maybe I will in the future.

Duplicates

When updating I get duplicates of videos, and some videos from the subscription feed are skipped/not included in the automated playlist.

Update frequency and "findnextrow" clash

Using findnextrow to set the minimum row in the spreadsheet will skip processing for all preceding rows. If the update frequency of the lower rows is lower than earlier rows, this leads earlier rows to be skipped.

What is the reason to use findnextrow instead of simply setting initial iRow to reservedTableRows to process all rows reliably?

Script not adding new videos

The script was working perfectly until yesterday. It doesn't show any errors but new videos are not being added to my playlist. I tried to disable and re-enable the YouTube API but that didn't help. I attached the updatePlaylists script.. could someone please check to see if it looks correct? I have around 1100 videos on my playlist but that shouldn't be an issue (I know it stops working once you have 5000 videos on the playlist).

Any help would be appreciated.
Thanks in advance,

Aaron

yougather.xyz login problems: Server Error (500)

For the most part, yougather.xyz has been working phenomenally for me. Makes it super easy to watch a chronological list of subscriptions in the Watch Later list.

Recently, I noticed that videos were not being added. This came after I enabled 2 factor authentication. I've tried logging into yougather.xyz, but all I get is "Server Error (500)". Clearing cache, using a different computer, using incognito (on chrome), using a different browser does not resolve anything.

Any suggestions going forward? For now I've reverted to using the script + google sheets.

Script fails if video gets deleted while script runs

I just got a mail with this error:
Document 1eNL_C5WZZSiM5ULX3hvikaK9pqPKdKfKATZ0Znxqric is missing (perhaps it was deleted?) (line 17, file "Code")
I suspect that means that a new video was detected by the script, then deleted by the uploader and then the script tried to add it to my playlist.
Worst case scenario: In a playlist that allows duplicates, all videos that the script had already handled before the error would be added twice.

Can't update by playlist ID

I managed to get new videos from channels, but when I do the same with playlists ID I get this error:

Cannot search YouTube, ERROR: Message: [API call to youtube.search.list failed with error: Invalid channel.] Details: {"message":"Invalid channel.","code":400,"errors":[{"domain":"youtube.search","reason":"invalidChannelId","message":"Invalid channel.","locationType":"parameter","location":"channelId"}]}

Tried both playlists from my account and different users, same results. I haven't seen people mention this unless I'm doing something wrong. Also I'm using a YouTube account from back in the day.

TypeError: Cannot read property "items" from undefined.

Seems like working, but only date is updated and error appears.
For keystring: PL1YG9ktx9sVfaeZtTh0riY1nOrHkWaj6c it produce that error.
Of more info needed let me know.

XHR finished loading: POST "https://docs.google.com/spreadsheets/u/0/d/1YjauQJ8HCsnfHcb6GBUV33MpRMVYm70pthcLLV0UFso/scripts/invoke?ruid=221&id=ZZZZZZZZZZZ&lib=M2zyjyQPfO10gQct8sMcXmj5r6QE2Pvz2&func=insideUpdate&ctx=%7B%22gid%22%3A%220%22%2C%22scol%22%3A2%2C%22ecol%22%3A3%2C%22srow%22%3A3%2C%22erow%22%3A4%7D&usit=1&sid=2297dc458b0a1a14&c=1&w=1&smv=33&token=ZZZZZZZZZZZ&includes_info_params=true".
p.send @ 720521041-ritz_waffle_i18n_core__pl.js:321
KR.Wfa @ 720521041-ritz_waffle_i18n_core__pl.js:4224
wm.send @ 720521041-ritz_waffle_i18n_core__pl.js:479
p.OPb @ 720521041-ritz_waffle_i18n_core__pl.js:4153
p.send @ 720521041-ritz_waffle_i18n_core__pl.js:4152
lUb.N3 @ 720521041-ritz_waffle_i18n_core__pl.js:4228
p.Ae @ 720521041-ritz_waffle_i18n_core__pl.js:477
p.mLa @ 4080546244-ritz_waffle_i18n_ritzmaestro__pl.js:113
p.kPb @ 4080546244-ritz_waffle_i18n_ritzmaestro__pl.js:126
wqa @ 720521041-ritz_waffle_i18n_core__pl.js:436
zjc @ 2995667118-ritz_waffle_i18n_postshellbase__pl.js:20
MDd @ 4080546244-ritz_waffle_i18n_ritzmaestro__pl.js:126
p.hob @ 4080546244-ritz_waffle_i18n_ritzmaestro__pl.js:137
p.jK @ 720521041-ritz_waffle_i18n_core__pl.js:602
p.xc @ 720521041-ritz_waffle_i18n_core__pl.js:606
(anonymous) @ 720521041-ritz_waffle_i18n_core__pl.js:1093
Zca @ 720521041-ritz_waffle_i18n_core__pl.js:100
p.dispatchEvent @ 720521041-ritz_waffle_i18n_core__pl.js:98
p.Qh @ 720521041-ritz_waffle_i18n_core__pl.js:844
p.Jo @ 720521041-ritz_waffle_i18n_core__pl.js:843
p.Jo @ 720521041-ritz_waffle_i18n_core__pl.js:850
p.mY @ 720521041-ritz_waffle_i18n_core__pl.js:953
Xca @ 720521041-ritz_waffle_i18n_core__pl.js:95
Tca @ 720521041-ritz_waffle_i18n_core__pl.js:96
c @ 720521041-ritz_waffle_i18n_core__pl.js:2402
(anonymous) @ 720521041-ritz_waffle_i18n_core__pl.js:92
4080546244-ritz_waffle_i18n_ritzmaestro__pl.js:112`
Google Apps Script: TypeError: Cannot read property "items" from undefined.

ADD sync times for each channel

each channel should have their own sync times

use case A:

user has lots of playlists and lots of channels in each playlist.
sync is unable to complete in the 6 mins alloted by Google

use case B:

user adds a new channel and wants all the videos from it from date X in the past

TypeError in line 27

TypeError: Second argument to Function.prototype.apply must be an array. (line 27, file "")

Quota Exceeded

Does this project use the same key and ID? I keep getting

Could not get subscribed channels, ERROR: Message: [API call to youtube.subscriptions.list failed with error: The request cannot be completed because you have exceeded your quota.] Details: {"errors":[{"domain":"youtube.quota","message":"The request cannot be completed because you have exceeded your <a href="/youtube/v3/getting-started#quota">quota.","reason":"quotaExceeded"}],"code":403,"message":"The request cannot be completed because you have exceeded your <a href="/youtube/v3/getting-started#quota">quota."}

No matter what day or anything. How do i fix this issues as it was working perfectly fine till about May 22nd and this started to happen. I have thousands of calls i can use but i am curious if this is using your Key and your KEY is reached its limit.

Playlist has a large ammount of repeated videos

Hello! I have run in to an error where videos get added multiple times in the same playlist.

For some reason this only happened in one of the four playlist I have created. I have tried to recreate this playlist multiple times, but sadly this error eventually always happened again.

So, I assume it has something to do with the list of channels for this playlist?

I really don’t know, is there anyway to solve this problem?

Cannot update playlist for brand account using personal account

I followed the instructions, but couldn't execute the second step completely:

2. Allow the Sheets to access Youtube:
  * Then, Google Developers Console / Youtube Data API / Enable API, close the tab, go back to Script Editor and click OK

I can't find any Google Developers Console in the Resources / Advanced Google Services dialog. According to https://developers.google.com/apps-script/guides/services/advanced#enabling_advanced_services that option is available for a standard GCP project (or an older default GCP project that was created prior to April 8, 2019).

Nonetheless I tried to "Update Playlists" in the sheet document and this is the error message in the debug sheet:

Mon Oct 28 16:19:57 EET 2019 Couldn't update playlist with video (5Aq7jyS8AAU), ERROR: Beim API-Aufruf von "youtube.playlistItems.insert" ist dieser Fehler aufgetreten: Forbidden

Sorry for the German log message. It means something like Couldn't update playlist with video (5Aq7jyS8AAU), ERROR: The following error occured at api call "youtube.playlistItems.insert": Forbidden

YouTube search broken -> App broken

Currently the app is broken and it's basically impossible to fix, without rewriting this thing entirely.

https://support.google.com/youtube/thread/2494861?hl=en

YouTube have broken their search filters a couple days ago. You can try it out on the website itself too, it's not just the API we use.

Writing this as top issue for people to find easily. The rewrite of this app would include some kind of cache of videos that have already been added. Considering the amount of work this would take and the space this would take up, I'd suggest waiting until YouTube itself is fixed.

You can subscribe to the issue on Google to get updated. The newest version here with PR #33 will not stop the error messages, but it will make sure the script will start with the videos where YouTube got broken, instead of updating itself despite the errors.

option to get all old videos as well as new ones

Is there anyway to set an option to add all the videos from the channels ive entered into the playlist. I wish to run a playlist on the tv at my shop for customers, but id like it to add all the videos from the channels so i can put the playlist on random and repeat and it be able to play 24/7, but only adding new videos from the channels I've entered doesn't give me enough content to keep playing all day.

If theres an edit to script i can do to make it do so please give me some feedback id really appreciate it. Im using google sheets for the playlist

No videos added to playlists

For a few days already, no new videos get added to my playlists. There's no error message and the debug sheet just says "Acquired 0 videos" for each.

Error when private video added to playlist

When a newly uploaded private video gets added to one of the playlists on the right, the script tries to add it to the playlist on the left and fails. The debug sheet shows this error:

Couldn't update playlist with video (UuZv1vdNoxM), ERROR: Message: [API call to youtube.playlistItems.insert failed with error: Video not found.] Details: {"message":"Video not found.","code":404,"errors":[{"domain":"youtube.playlistItem","reason":"videoNotFound","message":"Video not found."}]}

This might be related to the fact that "made for kids" videos now cannot be added to playlists (usually?), so it probably fails on all private videos, because it can't check if it has that property set or not. But that's just a guess.

I don't know what the best solution would be here, because just skipping all private videos would make the script not add any videos ever that were uploaded with a schedule.

Seems that Live Videos don't get Ignored and Results in Error

Error: 1 video(s) were not added to playlists correctly, please check Debug sheet. Timestamps for respective rows has not been updated.

I get this error, and I believe it is because one video that is from a subscription is live. Which doesn't need to be downloaded anyways. I am still new to using this service, so let me know if it's something I am doing wrong.

But I am lead to believe that it's the live video. Anyways it would be nice for the service to ignore it instead of giving an error.
Thanks for your time.

Some channels work only after hotfix in editor

Some channels (eg. UC6Iaz96RkYE-MOjnq5NPgqw) work only after hotfix in editor. This may have something to do with

if (e.parameter.update == "True") {

Because when it is commented all is updated as expected, but with this line update is not performed. This work on channels with playlist in them, but for this without that line make's error

updatePlaylists | Bad value (line 17, file "Code")

Script is not working.

Since 2019-09-18 the script has stopped working,

If you're a user:

If you're a programmer:

  • We'd appreciate if you could take a look at it, I'd happily merge the PR and give a shout-out in the main README.

Errors when undefined

On line 17 I added a condition to suppress an error
if (sheet == undefined || sheet.toString() != 'Sheet')...

Script runs but not fetching any new videos

Dear @Elijas et al,

I set up your script successfully. I performed the initial update to create the timestamp. Then I waited until a new video got uploaded to one of the channel ids.

I ran the script again. It succeeded without any error. However, the video did not get added to the playlist.

Do you have any ideas how I could further debug this?

I am adding some screenshots.

Yours

image

image

image

image

image

Pull spreadsheet id on onOpen call

Prevent users from forgetting to change the id, better to do it automatically.
Since the link to spreadsheet automatically opens it, this script will be guaranteed to run at least once.

Or maybe another alternative on when to pull id?

Fails if playlist is deleted

The last successful run on 1.8.2018 at 4:35, since then every hourly run gives this error message for the updatePlaylists function:
TypeError: Cannot read property "items" from undefined. (line 169, file "Code")
Sadly Google Sheets doesn't give any more output than that.

Logging into yougather.xyz results in a server error.

Here is an image what I see. The right part on the page shows up after I click reload channels in the menu. The left side repeats the error when I try to reload the playlists. This is my first time logging into this site, but I have created a subscriptionPlaylists google sheet copy and tried it there. I wanted to see how it would work on the site, but I can't do anything currently.
screen shot 2016-09-28 at 12 00 07 pm

UTC Issue

I realize that the UTC is not GMT, but I tried changing the UTC offset to R (eastern standard), instead of it being set to Z, and nothing fixes my issue.

The issue: I believe the timestamp is ahead of time from the youtube video upload time, as if I change the timestamp back several hours, it fixes the issue.

Any ideas?

function ISODateString(d) { // modified from src:
http://stackoverflow.com/questions/7244246/generate-an-rfc-3339-timestamp-similar-to-google-tasks-api
function pad(n){return n<10 ? '0'+n : n}

return d.getUTCFullYear()+'-'
+ pad(d.getUTCMonth()+1)+'-'
+ pad(d.getUTCDate())+'T'
+ pad(d.getUTCHours())+':'
+ pad(d.getUTCMinutes())+':'
+ pad(d.getUTCSeconds())+'.000R'

Limit number of videos to import per channel

Is there a way to limit the number of videos to import per channel? I have a playlist which videos are added from different channels. some of the channels have too many videos so i would like to import just a certain number from them so that my quota doesnt get used up by only one channel. I will appreciate your help!

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.