erome download links

Exposes media-download links for erome media galleries

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name erome download links
// @author Arnold François Lecherche and EromeScriptThrowaway
// @namespace greasyfork.org
// @icon https://www.erome.com/android-chrome-192x192.png
// @version 1.00
// @description Exposes media-download links for erome media galleries
// @include http://erome.com/*
// @include http://*.erome.com/*
// @include https://erome.com/*
// @include https://*.erome.com/*
// @grant none
// @run-at document-end
// @copyright 2020 Arnold François Lecherche
// ==/UserScript==
(function (A, w, d, b) {
  'use strict';
  var v = A.from(d.getElementsByTagName('video'));
  function videoSourceFilter(n) {
    return n.tagName && n.tagName.toLowerCase() === 'source';
  }
  function videoHDFilter(s) {
    return s && s.src && s.getAttribute('label') === 'HD';
  }
  function videoMap(v) {
    var s = A.from(v.childNodes).filter(videoSourceFilter);
    if (s.length === 1) return s[0].src;
    return videoSources.filter(videoHDFilter)[0].src;
  }
  function addLink(s, e) {
    var l = d.createElement('a');
    l.setAttribute('href', s);
    l.download = '';
    l.textContent += s;
    e.parentElement.parentElement.appendChild(l);
    e.parentElement.parentElement.appendChild(d.createElement('br'));
  }
  function init() {
    var i = (v || '').length || 0, s, j;
    while (i--) {
      s = A.from(v[i].childNodes).filter(videoSourceFilter);
      j = s.length;
      while (j--) addLink(s[j].src, v[i]);
    }
    d.removeEventListener('DOMContentLoaded', init, false);
    w.removeEventListener('load', init, false);
  }
  switch (d.readyState) {
    case 'interactive':
    case 'complete':
      init();
      break;
    default:
      d.addEventListener('DOMContentLoaded', init, false);
      w.addEventListener('load', init, false);
  }
})(Array, window, document, document.body || document.getElementsByTagName('body')[0] || document.getElementsByTagName('frameset')[0]);