Fails if playlist is deleted
See original GitHub issueThe 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.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
i found my deleted playlist but cant do anything w...
The deleted playlists can only be restored within 90 days from the deletion. This means that a playlist deleted long ago cannot be...
Read more >playlist can't be deleted - YouTube Music Community
1. Restart your phone. · 2. Uninstall and reinstall the YouTube Music app. · 3. See if you can delete the playlist on...
Read more >Youtube playlist: "unavailable videos are hidden" -- remove ...
If you manage a Youtube playlist and get a message at the top that says "unavailable videos are hidden", here's what you need...
Read more >API bug: Cannot remove specific song from a playlist ... - GitHub
Recreating a second playlist with the exact same songs does not reproduce the error. If you call the same function without the positions...
Read more >Remove Deleted Videos from YouTube Playlists
YouTube now shows a warning at the top of the page when some of the videos from a playlist have been deleted from...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found the problem!!! I basically know no JavaScript, no Google Apps scripts, no YouTube API, no Google Sheets API, not your code, but I still found the bug! I only discovered the logger when I was already done, until then I passed the “sheet” variable to other methods to be able to write something into a cell. This was to try to reduce the problem to a minimum example as good as I can, but then I found out that var results = YouTube.PlaylistItems.list(‘snippet’, {playlistId: playlistId, maxResults: 50, order: “date”, publishedAfter: lastTimestamp, pageToken: nextPageToken}); gives an error, so the
catch
block gets run. Then I wanted to look at all parameters of that individually, but puttingplaylistId
into the table cell was already enough, because I saw the third playlist ID. I thought “hm, that’s strange, why doesn’t it fail at the first or second one”, so I looked at the playlist on YouTube and what did I find? The playlist was deleted!So apparently the script fails if the playlist it tries to get the items from does not exist. This could probably be solved by adding something to the
catch
block that just skips the playlist or maybe writes something into the table or whatever, so that the next time the user gets an automated failure summary from Google, the error is easier to find. Or at least an FAQ entry that says that this error means “check your playlist IDs”. Because “TypeError: Cannot read property "items" from undefined. (line 169, file "Code")
” isn’t really a helpful error message.On Sat, 4 Aug 2018 at 08:06, Elijas Dapšauskas notifications@github.com wrote:
Closing this after adding new logs to script