OpenSubtitles | Download Enabler (2019)

Reenable Subtitle downloading on OpenSubtitles.com and OpenSubtitles.org, without using the official 'OpenSubtitles PRO' extension. A requirement as of early 2019.

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 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.

(У мене вже є менеджер скриптів, дайте мені встановити його!)

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            OpenSubtitles | Download Enabler (2019)
// @namespace       de.sidneys.userscripts
// @homepage        https://gist.githubusercontent.com/sidneys/b654b054a02b4389aa91f293d08c5108/raw/
// @version         0.9.9
// @description     Reenable Subtitle downloading on OpenSubtitles.com and OpenSubtitles.org, without using the official 'OpenSubtitles PRO' extension. A requirement as of early 2019.
// @author          sidneys
// @icon            https://static.opensubtitles.org/favicon.ico
// @include         *://www.opensubtitles.com/*
// @include         *://www.opensubtitles.org/*
// @require         https://greasyfork.org/scripts/38888-greasemonkey-color-log/code/Greasemonkey%20%7C%20Color%20Log.js
// @run-at          document-start
// ==/UserScript==

/**
 * ESLint
 * @global
 */
Debug = false


/**
 * The OpenSubtitles access level, sourced from the "OpenSubtitles.com PRO" extension.
 * @global
 * @default
 * @type {String}
 * @see {@link https://addons.mozilla.org/en-US/firefox/addon/opensubtitles-pro/|OpenSubtitles Pro}
 */
const accessLevel = 'extpremium'


/**
 * Create a new <meta> Element using OpenSubtitles.com credentials.
 * @param {String} url - Target URL
 */
let renderMetaTag = (url) => {
    console.debug('renderMetaTag')

    // Create <meta> element with desired access level
    const metaElement = document.createElement('meta')
    metaElement.name = 'accesslevel'
    metaElement.id = 'extinstalled'
    metaElement.content = accessLevel

    // Append <meta> element
    document.querySelector('head').appendChild(metaElement)

    // Status
    console.info('OpenSubtitles.com Access Level set to:', accessLevel)
}


/**
 * Initializer
 */
let init = (() => {
    console.debug('init')

    // Render <meta> Tag
    renderMetaTag()
})()