MediathekViewWeb - Single Click Download

Direct download of shows via single click

  1. // ==UserScript==
  2. // @name MediathekViewWeb - Single Click Download
  3. // @description Direct download of shows via single click
  4. // @author TheRealHawk
  5. // @license MIT
  6. // @namespace https://greasyfork.org/en/users/18936-therealhawk
  7. // @match https://mediathekviewweb.de/*
  8. // @version 1.3
  9. // @require https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js
  10. // @require https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js
  11. // @require https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js
  12. // @grant GM_download
  13. // ==/UserScript==
  14.  
  15. // Workaround to get rid of "is not defined" warnings
  16. /* globals $, jQuery, moment */
  17.  
  18. function modTitleCol() {
  19. $('#mediathek > tbody > tr > td:nth-child(2),' +
  20. '#mediathek > tbody > tr > td:nth-child(3),' +
  21. '#mediathek > tbody > tr > td:nth-child(5)').hover(
  22. // Mouseover
  23. function() {
  24. $(this).css(
  25. {color:'#0ce3ac'}
  26. );
  27. },
  28. // Mouseout
  29. function() {
  30. $(this).css(
  31. {color:'#ffffff'}
  32. );
  33. }
  34. );
  35.  
  36. $('#mediathek > tbody > tr').each( function() {
  37. const url = $('td', this).last().find('a').attr('href');
  38. const topic = $('td', this).eq(1).text();
  39. const title = $('td', this).eq(2).text();
  40. const orgTime = $('td', this).eq(4).text();
  41. const modTime = moment(orgTime, 'DD.MM.YYYY').format('YYYY-MM-DD');
  42.  
  43. $('td', this).eq(1).bind('click', function() {
  44. $(this).effect('pulsate');
  45.  
  46. const details = { url: url,
  47. name: modTime + ' - ' + topic + ' - ' + title.replace(/[\\\?\.\*<>]/g, '').replace(/[\|:/]/g, ' - ').replace(/"/g, '\'').replace(/[\s]{2,}/g, ' ') + '.mp4',
  48. saveAs: true
  49. };
  50. GM_download(details);
  51. } );
  52.  
  53. $('td', this).eq(2).bind('click', function() {
  54. $(this).effect('pulsate');
  55.  
  56. const details = { url: url,
  57. name: modTime + ' - ' + title.replace(/[\\\?\.\*<>]/g, '').replace(/[\|:/]/g, ' - ').replace(/"/g, '\'').replace(/[\s]{2,}/g, ' ') + '.mp4',
  58. saveAs: true
  59. };
  60. GM_download(details);
  61. } );
  62.  
  63. $('td', this).eq(4).bind('click', function() {
  64. $(this).effect('pulsate');
  65.  
  66. const details = { url: url,
  67. name: modTime + '.mp4',
  68. saveAs: true
  69. };
  70. GM_download(details);
  71. } );
  72. } );
  73. }
  74.  
  75. const observer = new MutationObserver( function() {
  76. modTitleCol();
  77. } );
  78.  
  79. observer.observe($('#mediathek')[0], {childList: true});