Youtube MP3 download button → ytmp3.la (auto‑download) - (by SuchtiOnTour)

Letöltés gombot ad a Feliratkozás mellé és automatikusan letölti az MP3‑at a ytmp3.la‑n

  1. // ==UserScript==
  2. // @name Youtube MP3 download button → ytmp3.la (auto‑download) - (by SuchtiOnTour)
  3. // @name:de Youtube MP3 download button → ytmp3.la (Auto‑Download) - (by SuchtiOnTour)
  4. // @namespace Violentmonkey Scripts
  5. // @version 1.5.2
  6. // @author SuchtiOnTour
  7. // @license MIT
  8. // @match https://www.youtube.com/watch*
  9. // @match https://*.youtube.com/*
  10. // @match https://ytmp3.la/*
  11. // @grant GM_addStyle
  12. // @run-at document-idle
  13. // @description Adds a Download button next to Subscribe and auto‑downloads the MP3 via ytmp3.la
  14. // @description:pt-BR Adiciona um botão Download ao lado de Inscrever‑se e baixa MP3 automaticamente pelo ytmp3.la
  15. // @description:ar يضيف زر تنزيل بجوار الاشتراك ويحمل MP3 تلقائياً عبر ytmp3.la
  16. // @description:bg Добавя бутон „Сваляне“ до „Абонирай се“ и автоматично сваля MP3 чрез ytmp3.la
  17. // @description:cs Přidá tlačítko Stáhnout vedle Odebírat a automaticky stáhne MP3 přes ytmp3.la
  18. // @description:da Tilføjer en Download‑knap ved siden af Abonner og downloader automatisk MP3 via ytmp3.la
  19. // @description:de Fügt neben „Abonnieren“ einen Download‑Button ein und lädt die MP3 über ytmp3.la automatisch herunter
  20. // @description:el Προσθέτει κουμπί Λήψη δίπλα στην Εγγραφή και κατεβάζει αυτόματα το MP3 μέσω ytmp3.la
  21. // @description:eo Aldonas elŝutan butonon apud Aboni kaj aŭtomate elŝutas MP3 per ytmp3.la
  22. // @description:es Añade un botón Descargar junto a Suscribirse y descarga automáticamente el MP3 vía ytmp3.la
  23. // @description:fi Lisää Lataa‑painikkeen Tilaa‑napin viereen ja lataa MP3‑tiedoston automaattisesti ytmp3.la‑palvelusta
  24. // @description:fr Ajoute un bouton Télécharger à côté de S’abonner et lance automatiquement le téléchargement MP3 via ytmp3.la
  25. // @description:fr-CA Ajoute un bouton Télécharger à côté de S’abonner et télécharge automatiquement le MP3 via ytmp3.la
  26. // @description:he מוסיף כפתור הורדה ליד הירשם ומוריד אוטומטית את ה‑MP3 דרך ytmp3.la
  27. // @description:hu Letöltés gombot ad a Feliratkozás mellé és automatikusan letölti az MP3‑at a ytmp3.la‑n
  28. // @description:id Menambahkan tombol Download di samping Subscribe dan otomatis mengunduh MP3 via ytmp3.la
  29. // @description:it Aggiunge un pulsante Download accanto a Iscriviti e scarica automaticamente l’MP3 tramite ytmp3.la
  30. // @description:ja チャンネル登録ボタンの隣にダウンロードボタンを追加し、ytmp3.laで自動的にMP3をダウンロードします
  31. // @description:ko 구독 옆에 다운로드 버튼을 추가하고 ytmp3.la를 통해 MP3를 자동으로 다운로드합니다
  32. // @description:nb Legger til en Last ned‑knapp ved siden av Abonner og laster automatisk ned MP3 via ytmp3.la
  33. // @description:nl Voegt een Download‑knop naast Abonneren toe en downloadt automatisch de MP3 via ytmp3.la
  34. // @description:pl Dodaje przycisk Pobierz obok Subskrybuj i automatycznie pobiera MP3 przez ytmp3.la
  35. // @description:ro Adaugă un buton de Download lângă Subscribe și descarcă automat MP3‑ul prin ytmp3.la
  36. // @description:ru Добавляет кнопку «Скачать» рядом с «Подписаться» и автоматически скачивает MP3 через ytmp3.la
  37. // @description:sk Pridá tlačidlo Stiahnuť vedľa Odoberať a automaticky stiahne MP3 cez ytmp3.la
  38. // @description:sr Додаје дугме Преузми поред Пријави се и аутоматски преузима MP3 преко ytmp3.la
  39. // @description:sv Lägger till en Hämta‑knapp bredvid Prenumerera och hämtar automatiskt MP3 via ytmp3.la
  40. // @description:th เพิ่มปุ่มดาวน์โหลดถัดจาก สมัครสมาชิก และดาวน์โหลด MP3 อัตโนมัติผ่าน ytmp3.la
  41. // @description:tr Abone Ol’un yanına İndir düğmesi ekler ve MP3’i ytmp3.la ileดาวน์โหลดอัตโนมัติ
  42. // @description:uk Додає кнопку Завантажити поруч із Підписатися та автоматично завантажує MP3 через ytmp3.la
  43. // @description:ug Subscribe تەڭلىكى يېنىغا چۈشۈرۈش كۇنۇپكىسى قوشىدۇ، ytmp3.la ئارقىلىق MP3 نى ئاپتوماتىك چۈشۈرۈدۇ
  44. // @description:vi Thêm nút Tải xuống bên cạnh Đăng ký và tự động tải MP3 qua ytmp3.la
  45. // @description:zh-CN 在订阅旁添加下载按钮,并通过 ytmp3.la 自动下载 MP3
  46. // @description:zh-TW 在訂閱旁新增下載按鈕,並透過 ytmp3.la 自動下載 MP3
  47. // ==/UserScript==
  48.  
  49. (() => {
  50. /* ---------- YouTube: Button einfügen ---------- */
  51. if (location.host.includes('youtube.com')) {
  52. const API = 'https://ytmp3.la/#';
  53. const BTN_ID = 'dwnldBtn';
  54. const TARGET_SEL = '#owner';
  55.  
  56. GM_addStyle(`
  57. #${BTN_ID}{
  58. background:#0F0F0F;color:#FFF;border:1px solid rgba(255,255,255,.25);
  59. margin-left:8px;padding:0 16px;border-radius:18px;
  60. font:500 14px/normal Roboto,Noto,sans-serif;display:inline-flex;align-items:center;
  61. height:36px;text-decoration:none}
  62. #${BTN_ID}:hover{background:#3F3F3F;border-color:#3F3F3F}
  63. `);
  64.  
  65. const wait = s=>new Promise(ok=>{
  66. if (document.querySelector(s)) return ok(document.querySelector(s));
  67. new MutationObserver((_,o)=>{if(document.querySelector(s)){ok(document.querySelector(s));o.disconnect();}})
  68. .observe(document.body,{childList:true,subtree:true});
  69. });
  70.  
  71. const id = () => (/v=([\w-]{11})|shorts\/([\w-]{11})/i.exec(location.href)||[]).slice(1).find(Boolean);
  72. const url = () => API + id() + '/mp3';
  73.  
  74. function add(){
  75. wait(TARGET_SEL).then(p=>{
  76. if(!p||document.getElementById(BTN_ID)) return;
  77. const a = Object.assign(document.createElement('a'),{
  78. id:BTN_ID,textContent:'Download',href:url(),target:'_blank',rel:'noopener'
  79. });
  80. p.appendChild(a);
  81. });
  82. }
  83. function refresh(){ const b=document.getElementById(BTN_ID); if(b) b.href=url(); }
  84.  
  85. let done=false;
  86. const init=()=>{ if(location.pathname==='/watch'&&!done){ add(); done=true; setTimeout(refresh,100); setTimeout(refresh,300); setTimeout(refresh,600); setTimeout(refresh,1200); } };
  87. window.addEventListener('yt-navigate-finish',()=>{done=false;init();});
  88. init();
  89. }
  90.  
  91. /* ---------- ytmp3.la: Auto‑Download ---------- */
  92. if (location.host === 'ytmp3.la') {
  93. const isDl = el=>{
  94. if(!el) return false;
  95. const t=el.textContent.trim().toLowerCase();
  96. return t==='download' || t.startsWith('download ');
  97. };
  98. const click = ()=>{
  99. const el=[...document.querySelectorAll('a,button')].find(isDl);
  100. if(el){ el.click(); console.log('[YTMP3] Download‑Button geklickt'); }
  101. else setTimeout(click,400);
  102. };
  103. click();
  104. }
  105. })();