Apr 262019
 

Finding no working downloader at userscripts or other repositories for Greasemonkey scripts I had to write my own. This provides links instead of video to the video and can download videos that are set as non downloadable by the user or pay to download. Here it is:

// ==UserScript==
// @author      Trip
// @version     0.2
// @name        Access All
// @description Enabled Downloading of mvideos that you are not meant tom be able to
// @date        2019 July 4
// @include     *pornhub.com/view_video.php*
// @run-at      document-idle
// @grant       none
// @license     Public Domain
// @icon        https://gmgmla.dm2301.livefilestore.com/y2pAKJYeZAp4tG23hG68x1mRuEUQXqb1MxdLbuqVnyyuHFxC7ra5Fc-tfq6hD-r9cNnVufT3egUHaimL547xDlESrOVmQsqNSJ5gzaiSccLYzo/ExtendPornHub-logo.png
// @namespace   649b97180995e878e7e91b2957ef3bbee0f840a0
// ==/UserScript==

(function() {
    'use strict';
    console.log("Access All Running");
    function parseScript(script_object)
    {
        if (script_object.innerText == null || !script_object.innerText.trim().startsWith("var flashvars"))
        {return null;} //typeof script_object == 'undefined' ||
        var str=script_object.innerText.trim();
        str=str.substring(str.indexOf("{"));
        var str_end = str.indexOf("var player_mp4_seek = \"ms\";");
        str=str.substring(0,str_end);
        str_end = str.lastIndexOf(";");
        str=str.substring(0,str_end);
        var json = null;
        try {
            json = JSON.parse(str)
        } catch (err) {
            location.reload();
            return null;
        }
        if (json!==null)
        {return json};
        return null;
    };

    function make_links(el,json)
    {
        var out ="";
        for (var i=0;i<json.mediaDefinitions.length;i++)
        {
            if (json.mediaDefinitions[i].videoUrl=="")
                {continue;}
            var a = document.createElement('a');
            var linkText = document.createTextNode(json.mediaDefinitions[i].quality);
            a.appendChild(linkText);
            a.title="Qal";
            a.href = json.mediaDefinitions[i].videoUrl;
            //a.download='Test.mp4' //html5
            el.appendChild(a);
            el.appendChild(document.createElement("br"));
        }
        return out;
    }

    //var all_doc;
    //all_doc = document.body.innerHTML;
    //console.log(all_doc);
    var scripts = document.scripts;
    var json = null;
    for ( var i=0; i<scripts.length; i++)
    {
        json=parseScript(scripts[i]);
        if (json!==null)
            {break;}
    }
    var div = document.createElement("DIV");
    //div.style="position: absolute; visibility: visible; left: 20px; top: 300px; height: 75px; width: 150px; z-index: 200;"
    div.style="display: block; visibility: visible; left: 10px; bottom: 10px; height: 75px; width: 30px; margin-left: 30px; z-index: 200;"
    var out = make_links(div,json);
    //replace video with links
    var elm_vid_parent = document.getElementById("player").parentNode;
    elm_vid_parent.parentNode.replaceChild(div,elm_vid_parent);
    console.log('Finished');
})()
Share

  9 Responses to “Greasemonkey / Tamper Monkey script for Porn Hub”

  1. Top adult websites offer high-quality content for adult entertainment.
    Choose trusted platforms for a safe and enjoyable experience.

    Also visit my web blog :: Mana Mana

  2. Volwassen inhoud streamen op veilige en betrouwbare platforms.
    Vind betrouwbare sites voor een premium ervaring.

    Feel free to surf to my site; FULL PORN MOVIES

  3. Latest adult websites bring innovative content for adult entertainment.
    Explore reliable fresh sites for a modern experience.

    my blog BUY RIVOTRIL

  4. We are a group of volunteers and opening a brand new scheme in our
    community. Your site provided us with useful info to work on. You’ve performed an impressive task and
    our whole neighborhood will probably be thankful to you.

    my homepage BUY RIVOTRIL

  5. Where to watch porn by exploring trusted adult platforms
    online. Discover secure content sources for a
    private experience.

    my website: Buy Rivotril

  6. BEST ANAL PORN SITE is available on various adult websites for entertainment.
    Always choose reliable adult sites for a protected experience.

  7. Adult video’s kijken op veilige en betrouwbare platforms.
    Vind gegarandeerde videobronnen voor een premium ervaring.

    my webpage :: Buy Rivotril

  8. We stumbled over here from a different web page and thought
    I might as well check things out. I like what I see so now i’m following you.
    Look forward to going over your web page repeatedly.

  9. Premier adult platforms offer secure and premium content for adults.

    Discover trusted platforms for a quality experience.

    Also visit my page: orgy porn videos

Leave a Reply to Buy Rivotril Cancel reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>