Urgent.News

What's breaking now, across hundreds of outlets.

Tech

3 YouTube Data API traps I hit deleting liked videos in bulk

Years of likes add up. My own Liked videos list holds thousands, a couple of hundred of them now private or deleted, hidden behind "Unavailable videos are hidden" . YouTube lets you unlike them one at a time, and that's it. I built TidyList, a web app for cleaning up big YouTube playlists, on the YouTube Data API v3. Liked videos looked like the easy case, since it is just a playlist. It nearly…

YouTube's data API presents challenges when attempting to delete a large number of liked videos. The writer, who manages thousands of likes, discovered three main issues while building TidyList, a web application for cleaning up big YouTube playlists.

Firstly, the playlist id for liked videos is not derivable, unlike other playlists. Unlike playlists obtained through playlists.list?mine=true, liked videos are not included in this list. To obtain the id of the liked videos playlist, one must retrieve their channel details via GET https://www.googleapis.com/youtube/v3/channels?part=contentDetails&mine=true, where the relevant id is found in contentDetails.relatedPlaylists.

This id must be obtained manually and inserted into the API requests each time, as it cannot be derived from other data.

Secondly, the API provides a limit of 5,000 most recent liked videos, creating a window of access rather than a complete list. Older liked videos are inaccessible through this method. This limitation must be communicated to users, as they may believe their list is incomplete. The writer notes that videos.list?myRating=like only allows a maximum of 1,000 items, and this should be displayed to the user when the full list is reached.

Finally, deleting a liked video removes it from the list and impacts the user's YouTube recommendations, as the like and entry are equivalent in this context. Deleting a video from the liked list is achieved via DELETE requests targeting the playlistItems endpoint, using the playlist item's id. However, adding a video to the liked list cannot be done through playlistItems.insert, as likes are created by videos.rate.

With an average of 50 quota units consumed per delete, unliking 200 videos will exhaust a new project's default daily quota of 10,000 units. Alternatively, TidyList offers a simple solution for bulk deletion, with the option to remove private, deleted, or specific category of liked videos.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

How to stay focused: what research and athletes show

Originally published on Mindima Learn . In short: To stay focused, decide in advance when and where you will do one task, silence notifications, and work in a single block instead of switching back…

  • Researchers and athletes agree on focusing on one task at a time
  • Turn off notifications and keep phone out of reach to reduce distractions
  • Use a pre-performance routine to improve focus and performance

Confused lost and unashamed

So it's been an interesting 2 weeks ever since I discovered python, I love it and how expressive you can be. But I find myself lost and confused but i love it and I want to learn and discover its…

Wan 2.2 MoE sampler: accelerate low noise, keep dynamics, and use native control

Wan 2.2's MoE sampler combines the high- and low-noise stages into one sampler, making acceleration placement much easier to control.

  • Wan 2.2's innovative MoE sampler streamlines high- and low-noise stages
  • Accelerated low-noise stage preserves dynamics while speeding up process
  • Wan 2.2's native inpaint/control implementation excels in motion details

How to check a redirect map before a website migration

The redirect map is the spreadsheet behind a website migration: one row per old URL, with the new URL it should go to. The redirect rules are built from it, so every mistake in the map becomes a live…

  • Redirect map is a spreadsheet mapping old URLs to new ones during website migration.
  • Verify redirect map before going live to prevent live issues across platforms.

More from Wednesday 25 November →