Boton Descarga MP3 con Inicio y Final para videos de Youtube

Al cargar un video de Youtube se agrega un Boton para descargar el MP3 de manera directa haciendo uso del servicio (http://youtubeinmp3.com/api/). Ademas puedes indicar el Inicio y Final del audio para evitar partes del video no deseadas como dialogos o intros.

// ==UserScript==
// @name			Boton Descarga MP3 con Inicio y Final para videos de Youtube
// @author			ELDiDi
// @version			1.3
// @description			Al cargar un video de Youtube se agrega un Boton para descargar el MP3 de manera directa haciendo uso del servicio (http://youtubeinmp3.com/api/). Ademas puedes indicar el Inicio y Final del audio para evitar partes del video no deseadas como dialogos o intros.
// @match			https://www.youtube.com/*
// @require			http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @grant GM_xmlhttpRequest
// @grant GM_getValue
// @grant GM_setValue
// @run-at document-end
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAABcSAAAXEgFnn9JSAABD82lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4KPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMwNjcgNzkuMTU3NzQ3LCAyMDE1LzAzLzMwLTIzOjQwOjQyICAgICAgICAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgICAgICAgICAgeG1sbnM6cGhvdG9zaG9wPS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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIAo8P3hwYWNrZXQgZW5kPSJ3Ij8+q/StgQAAACBjSFJNAAB6JQAAgIMAAPn/AACA6AAAUggAARVYAAA6lwAAF2/XWh+QAAAEbUlEQVR42uybb0yVVRzHP+fcP8AFBoGIQYItekEzAjemNlmyhgmzF4Wr0RzMtDfC+jOxZtpYrjWKtHTNF22yslljZW0aqC1doMSL1iCTYDXNRASR/+j9w73P8/SCB7kGKm8uPNzn+W7P7p678+yc7+ee8/ude55zhMaUfgeuAtH6vQrYIE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8AHPCDFHBZ0w8TmUUaMA4nJLRKPxCAD4SJzNsAF7wvADkA9MKFG7BbJXTr7wab+OyzwzkXII7pAcABxMMXASjVwnjcK1DvgQ0B/f6Oo7ODwK9QFwEvhGNPsMFPQ1AwytRK0LSpsAovAlVh6P8TDQome8Jdj87qgWKPgEeAH8PAeDPwuAZv/N/8/dYpLwHPaBMgSvTj849OhAqkAecOUg/yI8BFDZokfA38ea+Y9t8AwrNcA9OsjQYAAAAASUVORK5CYII=
// @namespace https://greasyfork.org/users/73478
// ==/UserScript==


/*
--- waitForKeyElements():  A utility function, for Greasemonkey scripts, that detects and handles AJAXed content.

    Usage example:

        waitForKeyElements ("div.comments", commentCallbackFunction);

        //--- Page-specific function to do what we want when the node is found.
		function commentCallbackFunction (jNode) {
            jNode.text ("This comment changed by waitForKeyElements().");
        }

    IMPORTANT: This function requires your script to have loaded jQuery.
*/

function waitForKeyElements (
    selectorTxt,    /* Required: The jQuery selector string that
                        specifies the desired element(s).
                    */
    actionFunction, /* Required: The code to run when elements are
                        found. It is passed a jNode to the matched
                        element.
                    */
    bWaitOnce,      /* Optional: If false, will continue to scan for
                        new elements even after the first match is
                        found.
                    */
    iframeSelector  /* Optional: If set, identifies the iframe to
                        search.
                    */
) {
    var targetNodes, btargetsFound;

    if (typeof iframeSelector == "undefined")
        targetNodes     = $(selectorTxt);
    else
        targetNodes     = $(iframeSelector).contents ()
                                           .find (selectorTxt);

    if (targetNodes  &&  targetNodes.length > 0) {
        btargetsFound   = true;
        /*--- Found target node(s).  Go through each and act if they
            are new.
        */
        targetNodes.each ( function () {
            var jThis        = $(this);
            var alreadyFound = jThis.data ('alreadyFound')  ||  false;

            if (!alreadyFound) {
                //--- Call the payload function.
                var cancelFound     = actionFunction (jThis);
                if (cancelFound)
                    btargetsFound   = false;
                else
                    jThis.data ('alreadyFound', true);
            }
        } );
    }
    else {
        btargetsFound   = false;
    }

    //--- Get the timer-control variable for this selector.
    var controlObj      = waitForKeyElements.controlObj  ||  {};
    var controlKey      = selectorTxt.replace (/[^\w]/g, "_");
    var timeControl     = controlObj [controlKey];

    //--- Now set or clear the timer as appropriate.
    if (btargetsFound  &&  bWaitOnce  &&  timeControl) {
        //--- The only condition where we need to clear the timer.
        clearInterval (timeControl);
        delete controlObj [controlKey]
    }
    else {
        //--- Set a timer, if needed.
        if ( ! timeControl) {
            timeControl = setInterval ( function () {
                    waitForKeyElements (    selectorTxt,
                                            actionFunction,
                                            bWaitOnce,
                                            iframeSelector
                                        );
                },
                300
            );
            controlObj [controlKey] = timeControl;
        }
    }
    waitForKeyElements.controlObj   = controlObj;
}

// Fuerza la ejecucion del script para resolver el problema de tener que refrescar pagina para hacerlo funcionar
waitForKeyElements("#watch7-views-info", ObtenerInfoDelVideo);


// Comprueba el link por primera vez, obtiene la duracion del video, titulo enlace de descarga.
function ObtenerInfoDelVideo () {
	// Obtiene URL del video
	var VideoURL = document.URL.split("&")[0];

	// AJAX Load link
	var url = '//youtubeinmp3.com/fetch/?format=json&video='+VideoURL+"&hq=1";
	var method = 'GET';
	var xmlhttp = new XMLHttpRequest();
	if (!("withCredentials" in xmlhttp) && typeof XDomainRequest != "undefined") {
	// XDomainRequest for IE.
	xmlhttp = new XDomainRequest();
	xmlhttp.open(method, url);
	} else {
	// xmlhttp for Chrome/Firefox/Opera/Safari.
	xmlhttp.open(method, url, true);
	}

	// Old style
	if (!xmlhttp) {
	xmlhttp = new XMLHttpRequest();
	xmlhttp.open(method, url, true);
	}
	//Respuesta de la solicitud por AJAX
	xmlhttp.onload = function () {
		if (xmlhttp.readyState==4 && xmlhttp.status==200) {
			var response = xmlhttp.responseText;
			// Si la respuesta contiene la palabra titulo signigica que el servicio puede convertir el video, caso contrario muestra mensaje.
			if(response.indexOf("title") == -1){
			InsertDiv('Lamentablemente este video no puede ser convertido a MP3');
			}else{

			var JSONObj = JSON.parse(response);
			var VideoTitle = JSONObj.title;
			var VideoLength = JSONObj.length-1;
			var VideoDownloadLink = JSONObj.link;

			//Se declaran variables Globales
			window.VideoURL = VideoURL; //Global
			window.VideoTitle = VideoTitle;
			window.VideoLength = VideoLength;
			window.VideoDownloadLink = VideoDownloadLink;

			InsertDiv();

			}
		}
	};

	xmlhttp.onerror = function () {
	InsertDiv('Ocurrio un error al obtener datos del video. Por favor reintente la operacion.');
	};

	xmlhttp.send();
} // END FUNCTION ObtenerLink



function InsertDiv(Error){
	// Si se recibe Error, muestra el mensaje, caso contrario muestra Campos Inicio-Final y boton Descargar
	var DivNode = document.createElement('div'); //crea el elemento DIV 
	DivNode.id = 'id_div';

	if (Error){
	DivNode.style = 'padding:10px;';
	DivNode.innerHTML = '<strong>'+Error+'</strong>';
	DivNode.innerHTML += '<br>Puedes intentar hacerlo manualmente desde <a href="http://www.youtubeinmp3.com/download/?video='+ VideoURL +'" target="_blank">aqui</a>'; // y le mete el contenido
	}else{
		//Se agrega STYLE a la cabezera de la pagina
		var head, style;
		head = document.getElementsByTagName('head')[0];
		if (head){
		style = document.createElement('style');
		style.type = 'text/css';
		style.innerHTML = '#InicioTexto:hover, #FinalTexto:hover{text-decoration: underline;}';
		style.innerHTML += '#InicioTexto,#FinalTexto{cursor:pointer;}';
		style.innerHTML += '#startInput, #endInput{padding:3px;border-width:1px;border-color:#cccccc;border-style:solid;font-size:12px;text-align:center;}';
		style.innerHTML += '#DivForWarnings {padding:5px;border-width:0px;font-size:12px;color:red;text-align:center;}';
		head.appendChild(style);
		}
	
	DivNode.style = 'overflow: hidden;';
	DivNode.style = 'display:inline-block';
	DivNode.style = 'height:auto';
	//var htmlDuracion = 'Duracion: '+VideoLength+' seg. ';
	var htmlDuracion = '';
	var htmlInput1 = '<span id="InicioTexto" title="Haga click aqui para obtener la posicion actual del video.">Inicio:</span> <input id="startInput" onClick="this.select();" type="text" size="4"> ';
	var htmlInput2 = '<span id="FinalTexto" title="Haga click aqui para obtener la posicion actual del video.">Final:</span> <input id="endInput" onClick="this.select();" type="text" size="4">';

	var iframeSource = '//www.youtubeinmp3.com/es/widget/button/?video='+VideoURL+'';
	var iframe = '<iframe id="IframeBotonDescargar" style="width:150px;height:30px;border:0;padding-top: 5px; margin-left: 10px; margin-bottom: -7px;;" scrolling="no" src="'+iframeSource+'"></iframe>';
	var DivForWarnings = '<br><div id="DivForWarnings" style="display:none1">&nbsp;</div>';
	
	DivNode.innerHTML = htmlDuracion + htmlInput1 + htmlInput2 + iframe + DivForWarnings;
	}

	// Add to page
	var parentElement=document.getElementById('watch7-views-info');
	if (parentElement) {
		var DivDOM = document.getElementById('id_div');

		if (DivDOM) {
		console.log('El DOM ya estaba en la pagina.');
		DivDOM.parentElement.removeChild(DivDOM);
		console.log('El DOM fue removido.');
		}

		parentElement.appendChild(DivNode);
		console.log('El DOM ha sido incrustado.');

		//Se establecen funciones para los elementos Inicio-Final
		document.getElementById('InicioTexto').addEventListener('click', ObtenerPocisionInicio, false);
		document.getElementById('FinalTexto').addEventListener('click', ObtenerPocisionFinal, false);

		var InicioInput = document.getElementById('startInput');
		var FinalInput = document.getElementById('endInput');

		InicioInput.addEventListener("focus", DisableDownloadBtn, false);
		InicioInput.addEventListener('focusout', OnChangeInput, false);
		InicioInput.addEventListener("keyup", FormatearTiempo, false);		

		FinalInput.addEventListener("focus", DisableDownloadBtn, false);
		FinalInput.addEventListener('focusout', OnChangeInput, false);
		FinalInput.addEventListener("keyup", FormatearTiempo, false);

		InicioInput.value = ConvertirSegundosSinPuntosAMiuntosConDosPuntos(0);
		FinalInput.value = ConvertirSegundosSinPuntosAMiuntosConDosPuntos(VideoLength);

	}else{
	alert('ERROR: No se encuentra el lugar adecuado para agregar el boton de descarga. Youtube debe haber cambiado algo en el sitio.');
	return;
	}
} //end function InsertDiv


function ObtenerPocisionInicio() {
	var Reproductor = document.getElementById("movie_player");
	var TiempoObtenido = Reproductor.getCurrentTime();

	var TiempoObtenido_ConvertidoConPuntos = ConvertirSegundosSinPuntosAMiuntosConDosPuntos( Math.floor(TiempoObtenido) );

	InicioInput = document.getElementById("startInput");
	InicioInput.value = TiempoObtenido_ConvertidoConPuntos;

	OnChangeInput();
}
function ObtenerPocisionFinal(){
	var Reproductor = document.getElementById("movie_player");
	var TiempoObtenido = Reproductor.getCurrentTime();

	var TiempoObtenido_ConvertidoConPuntos = ConvertirSegundosSinPuntosAMiuntosConDosPuntos( Math.floor(TiempoObtenido) );

	FinalInput = document.getElementById("endInput");
	FinalInput.value = TiempoObtenido_ConvertidoConPuntos;

	OnChangeInput();
}


function OnChangeInput(){
	var InicioInput = document.getElementById('startInput');
	var FinalInput = document.getElementById('endInput');
	
	

	var TiempoInicio = ConvertirASegundosSinPuntos(InicioInput.value);
	var TiempoFinal = ConvertirASegundosSinPuntos(FinalInput.value);
	
	if (isNaN(TiempoInicio)){
	InicioInput.value = ConvertirSegundosSinPuntosAMiuntosConDosPuntos(0);
	}else if (isNaN(TiempoFinal)){
	FinalInput.value = ConvertirSegundosSinPuntosAMiuntosConDosPuntos(VideoLength);
	}else if (TiempoInicio == TiempoFinal){
	//alert("El valor de Inicio no puede ser igual al de el Final.");
	MostrarWarning('El valor de Inicio no puede ser igual al del Final.');
	InicioInput.value = ConvertirSegundosSinPuntosAMiuntosConDosPuntos(0);
	FinalInput.value = ConvertirSegundosSinPuntosAMiuntosConDosPuntos(VideoLength);
	}else if (TiempoInicio < 0 || TiempoInicio > VideoLength){
	//alert("El valor de Inicio es incorrecto.");
	MostrarWarning('El valor de Inicio es incorrecto.');
	InicioInput.value = ConvertirSegundosSinPuntosAMiuntosConDosPuntos(0);
	}else{
		if (TiempoFinal < TiempoInicio || TiempoFinal > VideoLength){
		//alert("El tiempo Final no puede ser menor al tiempo Inicial.");
		MostrarWarning('El tiempo Final no puede ser menor al tiempo Inicial.');
		//FinalInput.value = ConvertirSegundosSinPuntosAMiuntosConDosPuntos(VideoLength);	
		}else{
		GenerarBotonDescargar(VideoURL, TiempoInicio, TiempoFinal);
		}
	}
	//alert("OnChangeInput\nVideoUrl: "+VideoURL+"\nInicioValue: "+ InicioValue +"\nFinalValue: "+FinalValue +"\nInicio: "+Inicio+"\nFinal: "+Final);
}

function MostrarWarning(Mensaje){
var DivForWarningsDOM = document.getElementById('DivForWarnings');

DivForWarningsDOM.innerHTML = '&nbsp;';

DivForWarningsDOM.innerHTML = Mensaje;
InicioInput.value = ConvertirSegundosSinPuntosAMiuntosConDosPuntos(0);
FinalInput.value = ConvertirSegundosSinPuntosAMiuntosConDosPuntos(VideoLength);
setTimeout(function(){DivForWarningsDOM.innerHTML='&nbsp;';}, 3000);
}


function GenerarBotonDescargar(VideoURLParameter, InicioParameter, FinalParameter){
//alert("Se va a generar el boton con los siguientes parametros:\nVideoURLParameter: "+VideoURLParameter+"\nInicioParameter: "+InicioParameter+"\nFinalParameter: "+FinalParameter);
if (VideoURLParameter == null){ var VideoURLParameter = VideoURL;}
if (InicioParameter == null){ var InicioParameter = ConvertirASegundosSinPuntos(document.getElementById('startInput').value);}
if (FinalParameter == null){ var FinalParameter = ConvertirASegundosSinPuntos(document.getElementById('endInput').value);}

//var iframeSource = '//www.youtubeinmp3.com/widget/button/?video='+VideoURLParameter+'&start='+InicioParameter+'&end='+FinalParameter+'&title='+VideoTitle+'_'+InicioParameter+'_'+FinalParameter;
var iframeSource = '//www.youtubeinmp3.com/widget/button/?video='+VideoURLParameter+'&start='+InicioParameter+'&end='+FinalParameter+'';
var BotonGenerado = '<iframe id="IframeBotonDescargar" style="width:150px;height:30px;border:0;overflow:hidden;" scrolling="no" src="'+iframeSource+'">';
var iframeDOM = document.getElementById('IframeBotonDescargar');
iframeDOM.src = iframeSource;
}


function DisableDownloadBtn(){
	var Iframe = document.getElementById('IframeBotonDescargar');
	//Iframe.src = 'about:blank';	
	var html_code= '<!DOCTYPE html><html><body style="background-color:#D8D8D8;"></body></html>';
	Iframe.src = "data:text/html;charset=utf-8," + escape(html_code);
}


function FormatearTiempo(e) {
	//alert(VideoLength);
	if (VideoLength>=3600){ // Si los segundos son igual o mayor que 3600 (60 minutos o mas) FORMATO SERA 1:00:00
    var r = /([0-9]{1})([0-9]{2})([0-9]{2})/i, str = e.target.value.replace(/[^0-9]/ig, "");
    while (r.test(str)) {
        str = str.replace(r, '$1' + ':' + '$2' + ':' + '$3');
    }
    e.target.value = str.slice(0, 7);

	}else if (VideoLength>=600){ // Si los segundos son igual o mayor o que 600 (10 minutos o mas) FORMATO SERA 10:00
    var r = /([0-9]{2})([0-9]{2})/i, str = e.target.value.replace(/[^0-9]/ig, "");
    while (r.test(str)) {
        str = str.replace(r, '$1' + ':' + '$2');
    }
    e.target.value = str.slice(0, 5);

	}else{ // Si los segundos son menores que 600 (9:59 minutos o menos) FORMATO 0:00
    var r = /([0-9]{1})([0-9]{2})/i,
        str = e.target.value.replace(/[^0-9]/ig, "");
    while (r.test(str)) {
		str = str.replace(r, '$1' + ':' + '$2');
    }
    e.target.value = str.slice(0, 4);
	}
};


function ConvertirASegundosSinPuntos(MinutosConDosPuntosParameter){ // ejemplo: 3:47 transformado en 227
	var str = MinutosConDosPuntosParameter;
	var p = str.split(':'),
        s = 0, m = 1, h = 2;

    while (p.length > 0) {
        s += m * parseInt(p.pop(), 10);
        m *= 60;
    }
//alert(MinutosConDosPuntosParameter + " equivalen a "+ s +" segundos.");
return s;
}


function ConvertirSegundosSinPuntosAMiuntosConDosPuntos(SegundosSinPuntosParameter){ // ejemplo: 227 transformado en 3:47
var Horas = Math.floor(SegundosSinPuntosParameter / 3600);

var Minutos = Math.floor(( SegundosSinPuntosParameter - Horas * 3600) / 60);

var Segundos = (SegundosSinPuntosParameter) - (Horas * 3600) - (Minutos * 60);

	if(VideoLength >= 3600){ 			// 3600 segundos o mas -  60 minutos o mas - Formato 1:00:00
		(Minutos.toString().length < 2) ? Minutos = "0" + Minutos : Minutos = Minutos;
		(Segundos.toString().length < 2) ? Segundos = "0" + Segundos : Segundos = Segundos;
	DuracionConDosPuntos = Horas +":"+ Minutos +":"+ Segundos;

	}else if (VideoLength >= 600){ 	// 600 segundos o mas - 10 minutos o mas - Formato 10:00
		(Minutos.toString().length < 2) ? Minutos = "0" + Minutos : Minutos = Minutos;
		(Segundos.toString().length < 2) ? Segundos = "0" + Segundos : Segundos = Segundos;
	DuracionConDosPuntos = Minutos +":"+ Segundos;
	
	}else{ 											// 599 o menos segundos - menos de 10 minutos - Formato 0:00
		(Minutos.toString().length < 2) ? Minutos = Minutos : Minutos = Minutos;
		(Segundos.toString().length < 2) ? Segundos = "0"+Segundos : Segundos = Segundos ;
	 DuracionConDosPuntos = Minutos +":"+ Segundos;
	}
return DuracionConDosPuntos;
}