TweetdeckPlayerDisableHLS

Tweetdeck等の動画プレイヤーで画質が可変になるのをなんとかするやつ(なんとかできないときもある)

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         TweetdeckPlayerDisableHLS
// @namespace    https://rinsuki.net/
// @version      0.1
// @description  Tweetdeck等の動画プレイヤーで画質が可変になるのをなんとかするやつ(なんとかできないときもある)
// @author       rinsuki
// @match        https://twitter.com/i/videos/tweet/*
// @run-at       document-start
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...
    var params = location.search.slice(1).split("&").map(a => {
        a = a.split("=")
        var name = a[0]
        var value = a.slice(1).join("=")
        return [name, decodeURIComponent(value)]
    }).reduce((obj, [k, v]) => ({...obj, [k]: v}), {})
    var dom = document.getElementById("playerContainer")
    var attrName = "data-config"
    var json = JSON.parse(dom.getAttribute(attrName))
    console.log(params)
    if (!params.content_type || !params.video_url) return
    json.content_type = params.content_type
    json.video_url = params.video_url
    dom.setAttribute(attrName, JSON.stringify(json))
})();