Contents
2 Important note
If you enter Query, it is actually more like a filter on results of a page, meaning? For example, you click on search button with number of results is 20, YouTube will use that querying string to filter first 20 videos of all videos before returns the results. If all 20 videos are not matched, it returns no videos. Say, the 21st video, which is paged in second page, is matched, you have to click next page for second page, so you can get that video in results. My 2 cents: I have no idea what the YouTube developers were thinking about the definition of querying, probably the reason q is not supported in version 2 API.
I made this because sometimes I need to find a video I have favored but I couldn’t recall the exact name. I used to go through all my favorites and still couldn’t find one. With this, it could be a little bit easier.
If I use HTML5 database to download all favorites, I get rid of the problem mentioned in the note above, but I’m lazy.
3 Updates
3.1 Fix pagination and have fast pagination
Thanks to the comments by Lename7, it explains another issue with YouTube API.
In previous code, the code will use next/previous link prepared by the API. But when the queried page doesn’t have any results, then the next/previous navigation link will not be included even there are matched videos in other pages. I have re-coded a bit, so you can manually input the page number, it will be helpful if you want to fast forward quickly when you have <ins>near</ins> 1,000<del>+</del> favorites. Note that the modified code does not check if the page number lies within valid page ranges.
Also, the layout changed a little, all three thumbnails of each video are showed below the entry.
2012-03-01T06:56:22Z, edited at 2013-04-29T14:44:56Z, see below.
3.2 No results after 1,000th video
A comment from thetruelime prompted me to look into the limitation of the number of search results. After read the documentation of API and a bug report, it’s not possible to retrieve videos after 1000th video. In short words, first 1,000 videos are all you can get.
2013-04-29T14:44:56Z
camer here thinking i'd found the holy grail of youtube search... but... it doesnt work :( help?
ReplyDeleteusing chrome on win7
What did you enter in search "username" and "query" field?
ReplyDeleteCould you open Developer Tools (I am not sure what name it is) to see JavaScript error logs? And what version of Chrome you are using?
I cannot find the Next button?
ReplyDeleteIt's located at on the right before and after the list of favorites, see attached screenshot.
ReplyDeleteI am using Mozilla Firefox, and it looks like this to me http://i273.photobucket.com/albums/jj203/drkamazon/Untitled-1.png
ReplyDeleteThanks for the screenshot, now I understand the issue.
ReplyDeletePlease read the updated post, it addresses what cause the problem.
Thank you! It works for me now! :)
ReplyDeleteDamn, this site is amazing, thanks a lot! It helped me find a rare video in my favorites list which has over 3000 videos...
ReplyDeletefor some reason its not searching for videos passed 1000 favorites (or at least its not showing that it is)
ReplyDeleteI looked into it and its the limitation of the API, the first 1,000 videos are all you can get. I have also updated the post with a couple of links, you may want to read up.
ReplyDeleteSorry, there is no one could do about it but YouTube dev team. You can't search via API or on YouTube, they don't even let you search your favorites. The only way to view videos after 1,000th is using YouTube if they does show 11th page. Not sure if they do, I only have 658 favorites.