Greasy Fork is available in English.

openload

Remove anti-adblock, ads, popups and timer waits, and show direct download link

< openloadについてのフィードバック

レート:良 – スクリプトは良好に動作する

§
投稿日: 2018/04/10
編集日: 2018/04/10

New way to detect stream url

Updating the script everytime the devs adds an element to the dom seems pretty annoying,here is a little snippet that can match the stream url directly without having to add a condition everytime:

var src;
//document.querySelectorAll('p[id]').forEach(x => src = src || (x.innerText.match(/^[\w\.~]+$/) && x.innerText.match(/~/)) ? x.innerText : src);
$('p[id]').each(function() {
    // detects a-zA-Z0-9_.~ and no spaces and must contains ~
    src = src || ($(this).text().match(/^[\w\.~]+$/) && $(this).text().match(/~/)) ? $(this).text() : src;
});
if (src) {
    var url = document.location.origin + "/stream/" + src;
    //...
}
leoncastro作者
§
投稿日: 2018/04/21

Hello @daedelus, thanks for the code. I have already updated the script. Let's see if this way we don't have to update much more, although I doubt it.

§
投稿日: 2018/04/22

Sorry, just found a typo in the regex, on some videos, embed links contains a minus sign , so the new regex would be

($(this).text().match(/^[\w\.~-]+$/) && $(this).text().match(/~/))

or a generic regex that ignore tags containing whitespaces and accepts tags containing tildes

($(this).text().match(/^[^\s]+$/) && $(this).text().match(/~/))

返信を投稿

返信を投稿するにはログインしてください。