Script Summary: The BEST script to automatically Loop(repeat) Youtube videos! - Full, or just a part of it(start time to end time). Works seamlessly with Firefox 3.6.* and above, and Chrome as well !
Version: 3.5.9.0
Better Loopy for YouTube 3.5 !
New features! Now send link of a looped part of youtube videos to your friends (they must have Better Loopy installed)! Cosmic Panda support! Set a max limit on the number of times to loop a video ;). More coming !Better Loopy for YouTube 3 is here!
Major update! This has everything you requested so far! Now you control what you want to use, and what not. See the highlights: Better Loopy for YouTube 3! New look, lots of new features and very customizable!). It is certainly out of the league than the others now. Give your feedback in the discussions page. Works in Firefox 3.6.*, Firefox 4.0, and Google Chrome as well!Description
The script was once built over the old(and now dead) initiative 'Loopy for YouTube'(http://userscripts.org/scripts/show/28832) but has come a long way since then, and adds numerous functionality besides making it work in old/new Youtube, Firefox & Chrome.So What's BETTER?
- Of course, you can loop just a duration of a video besides looping it whole.
- The older Loopy won't work on links like http://youtube.com/watch?videos=* . This one does!
- Shows a counter of how many times you have looped a video. (Hover your mouse on the 'Loop' button.)
- Using this, you can also Auto Play all the YouTube videos on ANY webpage in the order they are present - by just click of a button! (Explained below)..
- Works in New Youtube layout as well !!(the original one didn't).
- It keeps itself updated, so that you don't have to bother doing that.
- Works in Firefox 3.6.*, Firefox 4.0 betas, and Google Chrome!
- You can loop all videos by default(optional).
- Works in YouTube's Pop-up, full screen mode!
- You choose which features to enable!
- see this discussion for more features.
Looping part of a video
Besides the small 'Loop' button below the Youtube video to play it again and again (if you want only this, change from the settings), you will also find three text boxes below it. For looping a given video within only a specific time duration(you need that many times don't you?), just write the start time and end times in this format:minutes:seconds
e.g. out of a 10 minutes video if you want to loop only its part from 1:32 to 8:46 you can do that. Just type these values in Start time, End time and press 'Loop'. New in version 3.0.6.0! - You can also press the 'Enter' key to set the current video time in any of these boxes. If any of them is blank, the default start time is taken as zero and default end time is of course the end of video.

Play All YouTube videos on ANY Page
To enable auto playing of all the Youtube videos (linked or embedded!) present on any given HTML page by just click of a button with the help of this script, follow this really simple step:Right click your Firefox Bookmarks Toolbar and click 'New Bookmark'. Write the following values in Name and Location and Press Add.
Name:
Play All VideosLocation:
javascript:var links = document.getElementsByTagName('a'); var youtubeVideosFound = false; var res = new String(); var nextVideos = new String(); var videoID = new String(); for (i = 0; i < links.length; i++) { var url = new String(links[i].href); if (url.indexOf('youtube') > 0) { res = res + url + '\n'; index = url.indexOf('?v='); if (index > 0) { var indexEnd = url.indexOf('&', index + 3); if (indexEnd > 0) indexEnd = Math.min(indexEnd, url.length - 1); else indexEnd = url.length; if (videoID == '') { videoID = url.substring(index + 3, indexEnd).replace('#',''); youtubeVideosFound = true; } else { newVideoID = url.substring(index + 3, indexEnd).replace('#',''); if (videoID != newVideoID && nextVideos.indexOf(newVideoID) < 0) nextVideos = nextVideos + newVideoID + ';'; } } } } links = document.getElementsByTagName('param'); for (i = 0; i < links.length; i++) { if (links[i].getAttribute('name') != 'movie') continue; var url = new String(links[i].getAttribute('value')); if (url.indexOf('youtube') > 0) { res = res + url + '\n'; index = url.indexOf('/v/'); if (index < 0) index = url.indexOf('?v='); if (index > 0) { var indexEnd = url.indexOf('&', index + 3); if (indexEnd > 0) indexEnd = Math.min(indexEnd, url.length - 1); else indexEnd = url.length; if (videoID == '') { videoID = url.substring(index + 3, indexEnd).replace('#',''); youtubeVideosFound = true; } else { newVideoID = url.substring(index + 3, indexEnd).replace('#',''); if (videoID != newVideoID && nextVideos.indexOf(newVideoID) < 0) nextVideos = nextVideos + newVideoID + ';'; } } } } if (youtubeVideosFound) { nextLocation = 'http://www.youtube.com/watch?v=' + videoID; if (nextVideos.length > 0) nextLocation += '&nextVideos=' + nextVideos; window.location = nextLocation; } else alert('No youtube videos found on the page');(yes, copy all this upto the last semi colon in the location section.)
Now, you can just press this newly created button on any page having youtube videos, and it should play them all in the correct order, one by one, automatically in YouTube!
For example,
If you see some youtube links on a webpage like this:
How to solve a Rubik's Cube:
Youtube Link Part 1
Youtube Link Part 2
Youtube Link Part 3
Youtube Link Part 4
Just press this button (you can try it on this page itself after installing the script and adding the button!) to see them all automatically in the same order.
If you want to skip any video from the list, just press the "Next>" link. The "next videos to be played" list is just a semi-colon separated list of youtube video IDs and you can add them manually too. For example, in the link http://www.youtube.com/watch?v=LcJ-y39GzzQ, the video id is LcJ-y39GzzQ.
Changelog
Version 3.5.8.0 (Current) : 29th October 2011- [BugFix] - Make Better Loopy work on some pages it didn't work.
- [BugFix] - Don't run multiple times (GM bug)
- [Feature] - Prepare for next exciting features
- [Features][Look&Feel][BugFixes] - See this discussion for a list of changes.
- [Features][Look&Feel][BugFixes] - Major Update! See this discussion for a list of changes.
- [Feature]: Better Loopy for YouTube should now auto check for updates in every 7 days and notify when an updated version is available.
- [Look&Feel]: Loopy button for New youtube was detached from the YouTube player. Remove the empty space in between to make it attached to the player again.
- [BugFix] : Fixed a small bug in which looping times of x:08 and x:09 would loop only from/to x minutes.
- [BugFix] : Fixed a bug in which disabling the duration loopy bar by making extensionEnabled = false would stop simple looping of videos (See changes for 2.2.1).
- On users' request have a variable in the script, 'extensionEnabled', which can be turned to 'false' to disable the complete bar below the 'Loop' button.
- [BugFix] : Better loopy had a bug in which if after setting some duration and pressing 'Set' if you forward the video, it wouldn't respect the End time. It is resolved now.
- Change the placement of Loopy button and Duration panel only for new YouTube, so that other div's don't overlap it.
- Make Better Loopy work with the New YouTube design.
- Add a counter to the 'Loop' button, which shows how many times the video has been looped. (Hover your mouse over it)



