Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/benr0th/PlaylistSearch
Search your Youtube™ playlists
https://github.com/benr0th/PlaylistSearch
Last synced: 12 days ago
JSON representation
Search your Youtube™ playlists
- Host: GitHub
- URL: https://github.com/benr0th/PlaylistSearch
- Owner: benr0th
- Created: 2020-09-16T05:03:38.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-02-27T01:23:44.000Z (9 months ago)
- Last Synced: 2024-02-27T02:33:09.291Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 6.52 MB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PlaylistSearch
Live website URL: https://brothstudios.pythonanywhere.comSign in to your YouTube™ account to show your playlists, click the playlist and then search for any video in that playlist.
Due to YouTube™'s API restrictions there is a 5000 video limit per playlist, so unfortunately any videos that are past the 5000 mark in the playlist will not show up in the search.
YouTube™ does not allow developers to access your "Watch Later" or "History" playlists, so this will not work on those playlists.
Uses Flask to create the webpage and routes, the search function and all YouTube™ API processes are done with JavaScript. Search results and playlists are displayed using Handlebars.
# How It Works
Using YouTube™'s Data API, once the user logs in it sends a call to the user's account and grabs all their playlist ID's and info. The playlist information is stored in a Javascript object, Handlebars is used to loop through the object and make a card on the homepage for each playlist, displaying the name, thumbnail, and a link to send to the /playlist route page. The link contains the playlist ID in the URL, so when you go to the /playlist page another API call is made using the playlist ID from the URL which grabs all the videos from the playlist and puts them in a Javascript object.The search feature filters through the object values (which contains the video titles) and creates an object of all the matches it finds. Handlebars is used to loop through this object and display cards for each result, once again displaying the name, thumbnail, and a link which opens the video in a new tab. With the way the YouTube™ API works, it does not get the correct channel name for the videos so it does not currently display that.